GuideNovember 30, 20266 min read
What a memory MCP server costs in context before the first question
A memory server is connected in every session of every agent, so its tool definitions are a fixed cost. How to measure it, what Claude Code, Codex and Cursor do with the tool list, and the problem with deferring the tools of a server the agent has to call first.

Most MCP servers earn their place in a session now and then. The browser server matters when the task has a page in it, the tracker server when there is a ticket. A memory server is different. You connect it to every agent, in every tool, and you want it called before the first answer. Whatever its tool definitions cost, the team pays on every session.
We measured ours on November 28, 2026, with the default set of 36 tools: 27,069 characters of definitions, about 6,767 tokens, before anyone types a word.
What reaches the model before the first message
Two server responses can land in the context before any question. The initialize response carries an optional instructions string, which the MCP spec calls a hint to the model that may be added to the system prompt. The tools/list response carries every tool with its name, description and input schema. A client that loads tools upfront forwards that whole list on every request.
Both are fixed. They do not change with the task. What changes is what each call returns, and you already control that part with limits and budgets. The fixed part is the one almost nobody measures.
A week of it

Our workspace completed 1,474 agent tasks in the last 7 days, measured November 28, 2026 at 10:07 (UTC-3). If each of them opened a session with all 36 definitions loaded, that is about 10 million estimated tokens of tool definitions in the week (1,474 × 6,767) before a single question. With only the names and instructions, about 1.2 million (1,474 × 791).
That is arithmetic, not metering. We did not meter those sessions one by one. Whether you pay full price for the definitions on every turn depends on prompt caching in your harness and provider. The space in the context window is taken either way. And the token figures are estimates, characters divided by four. They are good for comparing servers and settings. For the real number in a Claude Code session, run /context.
For scale: MCP's reference memory server, @modelcontextprotocol/server-memory 2.2.2, has 9 tools and 8,047 characters of definitions, about 2,012 tokens, and no instructions. Ours is 3.4 times that. The two do different jobs. The reference server keeps a local knowledge graph across one user's chats, and ValorBrain carries dated facts, corrections, task state and handoffs between agents. So the comparison says nothing about which one remembers better. It says how much each one takes up before any work is done.
What your harness does with the list
Read in each product's own docs on November 28, 2026.
Claude Code defers MCP tools by default. At session start only the tool names and the server instructions load, and a tool's definition comes in through a search step when the task needs it. ENABLE_TOOL_SEARCH changes that: auto loads tools upfront while their definitions total under 10% of the context window, and false always loads everything. A single server can be exempted from deferral with "alwaysLoad": true in its config.
Codex's MCP page does not describe deferral. Trimming is manual, with a per-server allow list in config.toml (enabled_tools). With the nine tools of ValorBrain's main loop, the definitions drop to 9,135 characters, about a third of the full set.
Cursor's two MCP pages we read have no setting for deferral or for a tool limit. You can toggle individual tools in the list at the top of the chat panel, or turn the whole server off.
Deferral fixes the cost and creates another problem
For most servers, deferral works well. The user mentions a ticket, the model searches for ticket tools, the definition loads.
Nobody opens a session by asking the agent to check the team's memory. The agent gets asked "what's the staging database called?" and has to know, unprompted, that there is a place to look before answering. With definitions deferred, all it has to go on is the list of names and the server instructions. And the instructions get cut: in Claude Code, the model sees nothing past 4,096 characters. Before v2.1.296 the cut was at 2,048.
So on a memory server, the "check memory first" rule has to sit at the top of the instructions. In the last paragraph, it may be exactly the part that gets cut.
Four things to check on yours
- Measure. The guide has an 89-line script with no dependencies that calls
initializeandtools/liston any MCP server, over HTTP or stdio, and prints the sizes. Read it before you run it, since it will hold your token. - Find the call-first rule. Run the script with
SHOW_INSTRUCTIONS=1, find the sentence that tells the agent to consult memory, and note the character where it starts. In Claude Code, the 4,096 limit can be changed withCLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH, from v2.1.280. - Don't rely on the model alone. A rule in the instruction file your harness always loads (
CLAUDE.md,AGENTS.md,.cursor/rules) does not depend on any tool definition. A hook at session start or on each prompt goes further: the memory arrives as context whether or not the model thought to ask. - Test it. Open a fresh session and ask something only the memory can answer, without mentioning memory. Five times with deferral on, five with the server exempted, and count how often the agent checked before answering.
The step-by-step, per-tool numbers and sources are in the guide: What a memory MCP server costs before the first question.
What ValorBrain does and does not do
ValorBrain's instructions measure 2,680 characters, and the first rule, to call memory_prepare first, starts around character 800. That fits well under the 4,096 cut. On a working connection, the server adds pending notices and a short brief of the workspace's state, and caps the whole text at 3,900 characters: what does not fit is dropped from the notices and the brief, and the rules are never cut. @valorbrain/connect writes the same loop into the harness's instruction file and installs hooks. On Claude Code, Codex, Gemini CLI and Kiro, a hook runs at session start and on each prompt.
What it does not do, today:
- It is not the small option. The default set costs about 3.4 times the reference server's in definitions. If your harness loads everything upfront and you want one person's notes across chats, the smaller server is the cheaper fit.
- It has no trimmed version of the default set. To load nine tools instead of 36, trim on the client, as in the Codex example, and accept that the instructions will mention tools the agent cannot reach.
- It does not mark any tool to load upfront. In Claude Code, even
memory_prepareis deferred unless you setalwaysLoadon the server. - The rules alone are 2,088 characters and do not fit the older 2,048 limit. On Claude Code before v2.1.296, the last rules are cut.
- We have not measured real tokens inside a harness, or how often an agent calls the memory with deferral on and off. The five-and-five test is yours to run on your setup.
ValorBrain works over MCP, in Claude Code, Cursor and any compatible client. The free plan needs no card: valorbrain.com.br.
Sources, read November 28, 2026: Claude Code, Connect Claude Code to tools via MCP, section "Scale with MCP tool search"; Codex, Model Context Protocol; Cursor, Model Context Protocol and Cursor MCP help; MCP specification, InitializeResult; MCP reference memory server. ValorBrain and reference server measurements are from the guide, taken November 28, 2026 between 10:12 and 10:18 (UTC-3). Team task count from team.valorbra.in.
Next step
Less starting over. More continuity
Bring a real project. In one conversation we map where context gets lost between the people and agents on your team, and where to start.