longform-memory-mcp
Your AI writing assistant remembers chapter 3 when it writes chapter 300 — and the prompt never gets bigger.
Power your agent
पब्लिशर की अपनी कमांड। PlugMCP एंडपॉइंट नहीं।
Host a copy with our keys and logs.
npx -y [email protected]Claude Code में लोकल कमांड के लिए इंस्टॉल लिंक नहीं है। नीचे दी गई कमांड कॉपी करें और टर्मिनल में चलाएँ।
claude mcp add longform-memory-mcp -- npx -y longform-memory-mcp@0.1.1टर्मिनल में चलाएँ।
{ "mcpServers": { "longform-memory-mcp": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}claude_desktop_config.json
रिमोट URL या आपकी मशीन पर कमांड? दोनों इंस्टॉल में क्या अंतर है
PlugMCP पर चलाएँ
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
लॉन्चपब्लिशर से
Your AI writing assistant remembers chapter 3 when it writes chapter 300 — and the prompt never gets bigger.
MCP server that gives your AI writing assistant a constant-size memory of a long document. Chapter 1000 costs the same tokens as chapter 10. Local-only: no account, no API key, no network.
One line in your MCP config. No account, no key, no sign-up.
Claude Desktop — claude_desktop_config.json
Cursor — ~/.cursor/mcp.json
Windsurf, Cline, Zed, Continue — same shape
{
"mcpServers": {
"longform-memory": {
"command": "npx",
"args": ["-y", "longform-memory-mcp"],
"env": { "LONGFORM_MEMORY_PROJECT": "my-novel" }
}
}
}
Claude Code
claude mcp add longform-memory -e LONGFORM_MEMORY_PROJECT=my-novel -- npx -y longform-memory-mcp
Restart your client. Then say: "remember this chapter" and "recall context for chapter 12".
Write anything long with an LLM — a novel, a manual, a course, a serialised story — and you hit the same wall twice.
Withhold the past and it contradicts itself. A character who died in chapter 12 speaks in chapter 30. The key planted in chapter 3 is never mentioned again.
Send the past and you cannot afford it. Pasting every prior summary is O(n): tens of thousands of tokens by chapter 100, and by chapter 1000 it does not fit at all. Filling the window also makes things worse — models skip the middle.
Both are the same problem wearing two hats: there is no budget ceiling.
memory in the prompt
│
61k ─┤ ╭──── just paste it all
│ ╭─────╯
30k ─┤ ╭─────────────╯
│ ╭─────────────╯
4k ─┤════════════╪═════════════╪═════════════╪════ longform-memory
└──────┬─────┴──────┬──────┴──────┬──────┴────
10 100 500 1000 chapter
Measured on a real 1000-chapter book: 61,331 tokens → 4,396, and going from chapter 500 to chapter 1000 grew the block by 2 tokens.
┌─ recall_context(12) ──────► paste into your drafting context
│
├─ list_open_threads(12) ───► what's still owed
│
├─ …write chapter 12…
│
└─ remember_chapter(12, …) ─► summary · entity states · thread moves
Step four is where the value is made. Your assistant is the model doing the extraction — it just read the chapter, so it already knows what changed.
This server has no LLM inside it. The client calling it already is one.
So remember_chapter does not run an extraction pass over your prose — it asks your assistant to hand over what it understood while reading. That single decision is why there is:
Everything lives in plain files under ~/.longform-memory/<project>/:
~/.longform-memory/my-novel/
├── events.jsonl # append-only: summaries, entity states, threads
└── chapters/
├── 000001.txt # your prose, only if you passed `text`
└── 000002.txt
Readable, greppable, rm-able, and yours. No telemetry. The only outbound request this package can ever make is to an embedding endpoint you configure yourself — and if you configure none, the code path never runs.
Why an append-only log rather than SQLite: this server is launched by npx inside someone else's editor, and a native module that fails to build there is not a degraded experience — it is a server that never starts, and you would never find out why.
All three embedding variables must be set together — a half-configured endpoint that quietly does nothing is worse than no feature. search_memory always states which mode actually ran.
check_continuity covers the part a model is bad at — remembering exactly, across a thousand chapters.The server is a thin adapter; everything is callable directly.
import { recallContext, rememberChapter } from 'longform-memory-mcp';
await rememberChapter({
project: 'my-novel',
chapter: 12,
summary: 'Ines burns the letter and lies to her brother about it.',
entities: [{ name: 'Ines', state: 'lying to Tomas', note: 'first outright lie' }],
threads: [{ summary: 'what the letter actually said', deadlineChapter: 30 }],
});
const { recall } = await recallContext({ project: 'my-novel', chapter: 13 });
console.log(recall.text); // paste-ready block
console.log(recall.sections); // { entity: { usedTokens, kept, dropped }, … }
The budgeting core is published separately, with no dependencies at all:
longform-memory (npm) · longform-memory (PyPI).
npm install
npm test # 54 tests, including a real stdio protocol round-trip
npm run build
The test suite spawns the built binary and speaks JSON-RPC to it, because the failures that only appear there are the expensive ones — a non-executable bin, a schema the SDK rejects, a stray write to stdout corrupting the transport.
MIT © Emberspun. Built for Emberspun, an AI book writer for self-publishers — this memory layer runs there on every chapter.
Tool descriptions tell a model what a call returns. They cannot tell it that
recalling after drafting is useless, or that a [T3] from one chapter must not
be quoted at another. That is sequencing and judgement, and it lives in a skill:
git clone https://github.com/emberspun/longform-memory-skill.git \
~/.claude/skills/longform-writing
Kept in its own repository so there is exactly one copy — the same text in two places drifts, and the stale one is the one somebody reads.
MCP server that gives your AI writing assistant a constant-size memory of a long document. Chapter 1000 costs the same tokens as chapter 10. Local-only: no account, no API key, no network.
{ "mcpServers": { "longform-memory-mcp": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}टूल
अभी टूल सूची नहीं है। रिमोट सर्वर को पहले हेल्थ चेक के बाद सूची मिलती है।
FAQ
इस पेज पर Cursor, Claude Desktop, Claude Code या VS Code के लिए stdio कॉन्फ़िग कॉपी करें। यह पब्लिशर का इंस्टॉल इस्तेमाल करता है, PlugMCP प्रॉक्सी नहीं।
इस रिकॉर्ड में कोई ज़रूरी एनवायरनमेंट वेरिएबल दर्ज नहीं है।
Longform Memory stdio पर लोकल चलता है।
पिछली जाँच 2026-11-14 को हुई। MCP server that gives your AI writing assistant a constant-size memory of a long document. Chapter 1000 costs the same tokens as chapter 10. Local-only: no account, no API key, no network.