MCP Connector for Obsidian
[!NOTE] Blank window on Obsidian 1.14 (Electron 43): fixed in 3.1.1. If Obsidian's window went white while this plugin loaded, update to 3.1.1 or later. Both causes were in the plugin. Read with Electron's own symbol files, the crash reports hold two signatures. The first is V8 stopping inside a read of Node's
AsyncLocalStorage: Node 24 (Electron 40 and later) keeps its frames in a V8 slot that Chromium also writes to, and 3.1.0 no longer uses it inside Obsidian. The second is V8 running out of JavaScript heap: every reload of the plugin kept the previous instance in memory, about 40 MB each, through a$arkglobal that the plugin's schema library registers and never removes, and 3.1.1 removes it at unload. On one Mac, toggling the plugin off and on: 3.0.3 crashed on the first reload and 3.1.0-alpha.2 once in 200 (Obsidian 1.14.5, Electron 43.8.3), 3.1.1 never in 420 (Obsidian 1.15.0, Electron 43.8.3). The reporter of #597 confirmed it on Obsidian 1.14.4 with 3.1.1 and closed the issue. #609 stays open until its reporter confirms. Details in ADR-0032 and on the Obsidian forum.
Your Obsidian vault, exposed to AI clients over the Model Context Protocol. The MCP server runs inside Obsidian, on loopback, with no binary to download and no cloud round-trip. Claude Desktop, Claude Code, Cursor, Cline, Continue, Windsurf and VS Code all connect to the same endpoint.
What's new · Quick start · Tools · Rendered search results · Adaptive tool loading · Per-client tokens · Prompts · Protocol · Clients · Troubleshooting · Security · For developers
How it works
Obsidian (Electron) your AI client
┌─────────────────────────────────────┐
│ shared broker, hosted by one vault │◄──HTTP──► Claude Code, Codex, Cursor,
│ 127.0.0.1:27200/v1/<route-id>/mcp │ POST only Cline, Continue, Windsurf,
└──────────────────┬──────────────────┘ VS Code
│ forwards by route
┌──────────────────▼──────────────────┐
│ MCP Connector plugin, every vault │
│ ├─ MCP server (in-process) │
│ ├─ 66 tools │
│ ├─ prompt renderer │
│ └─ on-device embeddings │◄──stdio─► Claude Desktop
└─────────────────────────────────────┘ via .mcpb shim
127.0.0.1:27201-27212/mcp
Client configs point at the shared broker on 127.0.0.1:27200. One open vault hosts it inside Obsidian, every open vault registers a route with it, and it forwards each request to that vault's own port. A vault's port can change between restarts without breaking a saved config. If the hosting vault closes, another open vault takes over after a short outage. Details in ADR-0027
Four things follow from that shape:
- Nothing leaves your machine. The server binds to loopback only. Vault reads and writes go through Obsidian's own
app.vaultandapp.metadataCacheAPIs, so Obsidian's permission model still applies. - No binary ships from this repo. The server is plugin code running in Obsidian's renderer, which removes the supply-chain surface of downloading and executing a prebuilt executable.
- Semantic search is on-device. Transformers.js runs the embedding model locally. No API key, no Smart Connections requirement.
- Every request carries its own credentials. The transport keeps no session state, which is what makes per-client tool surfaces possible.
What's new in 3.2.2
| Change | Why it matters |
|---|---|
| Picking EmbeddingGemma or multilingual-e5 starts the download | The model download and the index build start as soon as you choose the provider, with no "Rebuild now" press. |
| The banner says what the build is doing | Building (with chunks so far), not built yet, or failed with Retry. "Rebuild now" answers with a notice, and a notice says when the index is ready. |
What's new in 3.2.1
| Change | Why it matters |
|---|---|
| EmbeddingGemma finds the right notes | Gemma now runs on the CPU and reads the model's real sentence vector. On a 12-note test vault the expected note came first in 7 queries out of 7, against 1 in 7 before. The Gemma index is rebuilt once after the update. |
| Download progress for every model | The settings bar shows the EmbeddingGemma and multilingual-e5 downloads too, by name, with Retry. |
What's new in 3.2.0
| Change | Why it matters |
|---|---|
| Fewer tools per session for older tokens | Access Control points out tokens still on All tools and moves them to Adaptive after a preview: about 12k tokens less of tool list in every session. |
| No search-results view for Codex and Claude Code | Installing for Codex or copying the Claude Code config turns the view off for that token, about 1k tokens less per search. |
show_file_in_obsidian never writes |
The read-only tool no longer creates a missing file. |
| Clients in Docker or Podman | The broker URL works from a container with host.docker.internal. See Clients in Docker or Podman. |
The full list is in the CHANGELOG.
What's new in 3.1.0 and 3.1.1
| Change | Why it matters |
|---|---|
| No more blank windows on Obsidian 1.14 | The plugin no longer uses AsyncLocalStorage inside Obsidian, and 3.1.1 stops a reload from keeping the previous instance in memory. On one Mac: a crash on the first reload with 3.0.3, one in 200 with 3.1.0-alpha.2, none in 420 with 3.1.1. See the note at the top. |
| Headless mode | obsidian-mcp-headless serves the vault tools from a folder without Obsidian running. See Headless mode. |
| Lighter plugin load | The semantic search engine loads the first time a search needs it, not at startup. |
| Smaller tool results | Each result carries its data once instead of twice. |
The full list is in the CHANGELOG.
What's new in 3.0.0
[!IMPORTANT] 3.0.0 is a major release, and it changes how every client connects. The shared broker now runs inside Obsidian on port 27200 and serves Claude Code, Claude Desktop, Codex, Cursor and the rest from one stable address. Existing Codex entries return
401until you reinstall them from the new Codex menu. Read Upgrading from 2.x before you update.
Every release is announced on the Obsidian forum thread, where questions and ideas are welcome too.
| Change | Why it matters |
|---|---|
| One broker for every client | Copy buttons and the Claude Desktop sync now give http://127.0.0.1:27200/v1/<route-id>/mcp. The address survives vault port changes and the port swaps caused by opening vaults in a different order. If the hosting vault closes, another open vault takes over after a short outage. Each client's own bearer token reaches the vault, so per-client tokens and tool profiles apply as on a direct port. |
| No separate process | The detached Node.js broker and its executable in application data are gone. The broker is plugin code in Obsidian's renderer, so there is nothing outside Obsidian to start, update or kill. |
| A Codex menu on every token row | Copy the config.toml snippet, copy a codex mcp add command, install into your Codex config, or install into a project. An install shows a preview first, then writes with a backup, a lock, an atomic write and a read-back. |
| Safe Codex installs | The installer refuses an entry that belongs to another vault, so two equally named vaults cannot overwrite each other. It migrates entries written by 2.11 and 2.12, and keeps your tool approvals and policy keys. |
| Register one project | Set Project path in Access Control. Claude Code copies a local-scope claude mcp add command for that project, and Codex installs into the project's .codex/config.toml. A project install never writes your token: it reads OBSIDIAN_MCP_TOKEN. |
| All tools offer for Codex | Codex does not refetch the tool list during a session, so an install on an Adaptive token offers to switch it to All tools. It is unticked by default and applied only after a successful install. |
| Clear errors from the broker | When the broker cannot reach a vault, Broker connection shows Refused with the cause and what to change, and the copy buttons hand out the vault's direct URL meanwhile. |
| Codex needs no Node.js | Node.js is still needed for the .mcpb export and the mcp-remote path. |
Upgrading from 2.x
- Update the plugin in every open vault. If another open vault runs a different plugin version, a Notice asks you to update it.
- Codex: reinstall once. Open Codex on the token row and choose Install into user Codex config…. The installer finds your old entry, shows the migration in a preview and rewrites it with the new address and your row token. A pasted snippet replaces it just as well.
- Other clients: copy the config again if it names a vault port from 27201 to 27205, because that port now addresses a vault, not the broker. Vault ports now run from 27201 to 27212, and 27200 can no longer be set as a fixed port. A plain direct config on
http://127.0.0.1:27200/mcpkeeps working. - Replacing a token secret now also breaks a Codex entry for that token, as for any client that holds a pasted token. Reinstall after you replace one.
- macOS and Linux: a vault registers its route only while its
pluginsfolder, plugin folder anddata.jsonbelong to you and are not writable by others. If they are not, Broker connection shows Refused and says what to change. - Optional: delete the
obsidian-mcp-connector/broker-v2folder in application data. Nothing uses it any more.
The full list is in the 3.0.0 changelog. The design is recorded in ADR-0027 and ADR-0028.
What's new in 2.8 to 2.12
Five releases followed a code and protocol audit (docs/audit-2026-10-02.md). The tool count went from 52 to 64, writes got safer, and search got shorter and more precise.
| Change | Why it matters |
|---|---|
| 12 new tools (2.8.0, 2.9.0) | get_workspace_state, list_tasks, set_task_status, get_note_properties, update_note_properties, rename_tag, update_canvas_node and delete_canvas_node in 2.8.0. get_file_info, list_attachments, ensure_block_id and search_files_by_name in 2.9.0. |
| Safer writes (2.8.0, 2.9.0) | update_active_file, delete_vault_file and delete_active_file take expectedContent. delete_vault_directory has dry_run and trash, rename_heading has dry_run. delete_vault_file refuses a folder, and show_file_in_obsidian never creates a missing file. |
| Search that fits a conversation (2.9.0 to 2.12.0) | search_vault_simple takes regex, caseSensitive and scope. search_vault_smart takes excerptLength and compact (2.10.0), and groupByFile (2.12.0), which keeps the best chunk of each note so limit counts notes. A full sentence ranks better than a list of keywords. |
| Rendered search view has an off switch (2.8.0) | Turn it off for the whole vault, or per token, for hosts that show the view fully expanded. |
| Client configs are named after the vault (2.10.0, 2.11.0) | Entries are obsidian_<vault>, with a hash for non-ASCII vault names. Claude Code gets a token-free .mcp.json entry and Codex can read the token from OBSIDIAN_MCP_TOKEN, so the secret stays out of committed files. |
| Copying a vault no longer shares credentials (2.10.0) | Make this copy independent and Replace all token secrets each change only what their label says. |
| Lighter and faster (2.8.0 to 2.11.0) | main.js went from 3.19 MB to 2.80 MB, settings are read once per request, and list_tasks pages with offset without reading every note. |
| Fixes worth knowing | The rendered view works in hosts that block blob: scripts (#538, @AS-prog). execute_template renders against the note it creates (#541). |
What's new in 2.0.x
2.0 is the release where this connector stopped waiting for the next MCP revision and started serving it. The protocol work is the substance, and the visible half is that search results now arrive as a list you can read instead of a wall of JSON.
| Change | Why it matters |
|---|---|
MCP revision 2026-07-28 is served, alongside the old one (2.0.0) |
Two protocol eras on one endpoint, one port, one token, classified per request. A client that speaks the new revision finds it by probing server/discover; a client that does not never sees it. Nothing you have configured needs to change. See Protocol status. |
| Search results render as a ranked list (2.0.0) | search_vault_smart and search_vault_simple publish an MCP Apps view: one row per hit with the path, the excerpt, and for the semantic search a similarity score and the heading. The text result is byte-identical to before, so clients without the extension see exactly what they saw. |
| Prompt-list changes are announced for real (2.0.0) | On the new revision, adding, deleting or renaming a note under Prompts/ tells listening clients to re-read the list. On the old revision the connector now says it cannot, which is the truthful answer. This retraction is what makes the number 2.0. |
| Per-token request counters (2.0.0) | The transport settings show how many requests each token served and on which revision, so a client that stopped working is a row whose count stopped moving. |
| A tool promoted by one client is announced to the others (2.0.0) | Promotion counters are vault-wide, so one client crossing the threshold widens every adaptive client's list. On the new revision the others are now told instead of serving a stale list. #419 |
| Windows bridge: no more mangled accents (2.0.1) | scripts/obsidian_mcp_bridge.py forces its stdio streams to UTF-8, so æ ø å ü and non-Latin scripts survive in both directions. Root-caused, with the fix, by @smollern. |
| Boolean arguments accept real booleans (2.0.0) | Six fields across five tools rejected a genuine JSON true, including delete_vault_directory.recursive. #444 |
search_vault_smart works under auto again (2.0.0) |
With Smart Connections installed it returned an empty result for every query, silently. #430 |
What 1.0.x brought (still current)
| Change | Why it matters |
|---|---|
| Per-client bearer tokens (1.0.0) | The vault holds up to 10 tokens, one per client. Claude Code can keep all 66 tools while claude.ai sees only the 13-tool Core set, from one vault and one server. |
| Per-token tool policy (1.0.0) | Profile, promoted tools and an optional hard allowlist all live on the token, not on the vault. |
| Rotation no longer restarts the transport (1.0.0) | Adding, renaming, regenerating or revoking a token takes effect on the next request. The port cannot drift and in-flight requests finish. |
.mcpb bundles are per token (1.0.0) |
Each bundle carries a token id and resolves that token's secret from the vault at connect time. Revoking the token fails the bundle closed instead of silently granting another client's access. |
| Note embeds in prompts (1.0.0) | ![[note]] in a prompt body is inlined before the prompt reaches the model, so no tool call per note. |
| Built-in-Node fix (1.0.1) | The Claude Desktop extension now works with Use Built-in Node.js for MCP left on. See #412. |
| Whole-request deadline in the shim (1.0.1) | A failing request answers inside 45 s with the reason instead of being cancelled at 60 s with nothing logged. |
| MCP SDK v2, error codes out of the reserved range (0.28.2, 1.0.1) | See Protocol status. |
Full history: CHANGELOG.md.
Quick start
- Install the plugin. Community store: Settings → Community plugins → Browse → MCP Connector. Or via BRAT with
istefox/obsidian-mcp-connector. - Open Settings → MCP Connector → Access control. A fresh vault already has one token, labelled Default.
- Wire your client from that token's row. Either .mcpb (Claude Desktop, drag and drop) or Copy config (everything else). Details in Connecting a client.
Ask the agent to call get_server_info to confirm the round trip. Requirements: Obsidian 1.7.2+, and Node.js only for the legacy mcp-remote path.
What it can do
66 tools: 63 vault tools plus 3 always-on meta-tools. All active by default.
| Family | Tools | Notes |
|---|---|---|
| Files | get_vault_file, get_vault_files, get_vault_file_partial, create_vault_file, create_vault_binary_file, append_to_vault_file, patch_vault_file, delete_vault_file, rename_vault_file, list_vault_files, list_vault_folders, get_vault_tree, get_file_info, list_attachments, create_vault_directory, delete_vault_directory |
get_file_info describes a file without reading it (kind, MIME, size, times, backlink and link counts, frontmatter/heading/tag/task counts for notes). list_vault_folders lists folders (optionally recursive, including empty ones); get_vault_tree returns the nested hierarchy with empty folders and optional direct file names, 200 folder nodes by default (up to 1000 with limit) and at most 2000 file names per response, with filesTruncated. list_attachments lists non-note files vault-wide, per folder or per note, with reference counts; unreferencedOnly finds orphaned attachments. get_vault_files reads up to 20 files per call. Text output is capped (default 100 KB) and truncation points at get_vault_file_partial. Renames go through fileManager.renameFile, so links survive. delete_vault_file takes an optional expectedContent precondition; delete_vault_directory takes dry_run (preview) and trash (recoverable delete). get_vault_file also returns an obsidian:// URI, see Linking out to Obsidian. |
| Active file | get_active_file, update_active_file, append_to_active_file, patch_active_file, delete_active_file, show_file_in_obsidian, get_workspace_state |
What the user is looking at right now. get_workspace_state lists every open tab (main area and pop-outs; sidebars on request) with its file, view type, editor mode, pin state and which one is active, plus the recently opened files. update_active_file and delete_active_file take an optional expectedContent precondition. show_file_in_obsidian only opens existing files: a missing one is an error, create it with create_vault_file. get_active_file also returns an obsidian:// URI, see Linking out to Obsidian. |
| Search | search_vault_smart, search_vault_simple, search_vault, search_files_by_name, execute_dataview_query |
Semantic, plain-text with context windows (literal or regex, caseSensitive, restricted to a scope of files and folders), quick-switcher fuzzy on names and aliases, DQL or JsonLogic. Hits carry a 0-indexed line. search_vault_smart and search_vault_simple also carry a file-level obsidian:// URI per row, see Linking out to Obsidian. search_vault_smart takes excerptLength to shorten excerpts and compact to return only paths and scores, and groupByFile to keep the best chunk of each note so limit counts notes. |
| Structure | get_vault_overview, get_note_outline, list_tags, get_files_by_tag, get_recent_files, get_outgoing_links, get_backlinks, list_bookmarks, ensure_block_id |
get_vault_overview replaces the 3 to 5 calls a session spends getting oriented. ensure_block_id returns or creates the ^id of a block (by line or under a heading) and hands back the [[note#^id]] link, placed where Obsidian expects it. |
| Tasks | list_tasks, set_task_status |
list_tasks reads - [ ] / - [x] / - [/] items from Obsidian's metadata cache, vault-wide, per folder or per file, with the 0-indexed line. set_task_status flips one box in place, keeps indentation and text byte for byte, accepts a custom marker (/, -, >) and an expectedText precondition. |
| Frontmatter | get_note_property, set_note_property, delete_note_property, get_note_properties, update_note_properties, list_property_values |
Atomic, through processFrontMatter. get_note_properties returns the whole block as one object; update_note_properties sets and removes several keys in one write. |
| Maintenance | find_broken_links, find_orphaned_notes, search_and_replace, rename_heading, rename_tag |
search_and_replace and rename_tag default to dry_run. rename_heading rewrites every reference pointing at it, and previews the plan with dry_run. rename_tag renames inline tags (located through the metadata cache, so code blocks and URLs are left alone) and the tags/tag properties, nested tags included. |
| Periodic notes | get_or_create_daily_note, get_or_create_periodic_note, append_to_periodic_note |
Daily through yearly. Works with core Daily Notes and with Periodic Notes. get_or_create_daily_note also returns an obsidian:// URI, see Linking out to Obsidian. |
| Canvas | get_canvas, add_canvas_node, connect_canvas_nodes, update_canvas_node, delete_canvas_node |
Writes preserve every existing field, so canvases round-trip with clean diffs. update_canvas_node changes content, color, position or size of one node; delete_canvas_node removes a node and every edge attached to it. |
| Execution | execute_template, list_obsidian_commands, execute_obsidian_command |
Templater templates as tool calls. Commands are opt-in, see Command execution. |
| Other | fetch, get_server_info |
fetch returns Markdown via Turndown, paginated. |
| Meta | tool_catalog, activate_tool, activate_tools |
Always reachable, see below. |
Every tool declares MCP annotations, such as readOnlyHint, destructiveHint, idempotentHint and openWorldHint, so a client can skip confirmation on reads and gate it on writes. List and scan tools take a limit (default 200, clamped to 1000) and report truncated with the real total.
On outputSchema, deliberately absent. Almost no tool here declares one, and that is a decision rather than an omission. Once a tool declares an output schema, SDK clients reject every response from it that lacks structuredContent. Several of these tools return genuinely different shapes depending on what they find, so declaring a schema for them broke get_vault_file for five releases (0.27.2 through 0.27.6) before the rule was written down. A tool whose result shape is polymorphic gets no schema.
Semantic search providers. Native MiniLM-L6-v2 (~25 MB, default), Gemma 300M (768d, best for non-Latin vaults), Multilingual-E5-Base (768d), or Smart Connections if you already use it. Providers swap live while the previous one keeps serving. The index is sharded into 16 segments by path, so editing one note rewrites one segment. While a build is running, search_vault_smart returns a structured index_building error with filesIndexed, filesTotal and an estimated retryAfterSeconds.
Linking out to Obsidian
get_vault_file, get_active_file, get_or_create_daily_note, search_vault_simple and
search_vault_smart return an obsidian://open URI alongside their result, so a note found
through MCP can be linked from outside Obsidian, Mail, Slack, Things, Jira, anywhere a URI
scheme link works. A raw-text result carries it as a trailing URI: obsidian://... line after
the content; a JSON-shaped result carries it as a sibling uri key. The two search tools add a
file-level uri to every row.
get_vault_file, get_active_file and get_or_create_daily_note also take an optional
heading argument: when it names a heading in the note, the URI navigates straight to it
(file=Note.md%23Heading, the heading percent-encoded inside the file parameter's value, per
Obsidian's own URI grammar, never a bare # fragment after the query string). A heading that
does not match returns a heading_not_found error naming the heading and the path, instead of
falling back to a plain file URI. Use get_note_outline to discover a note's headings before
targeting one. The two search tools do not support heading, a semantic search result's
heading field can be null or ambiguous by construction, so their URI is always file-level.
Rendered search results (MCP Apps)
Both search tools publish a small HTML view alongside their text result, using the
MCP Apps ui:// resource extension. In a client that supports
it, a search comes back as a ranked list you can read: one row per hit, carrying the note's path,
the matching excerpt, and, for the semantic search, a similarity score and the heading the passage
sits under. A zero-match query renders an explicit empty state naming the vault it searched.
Four things about how this is built, because they are the parts that usually go wrong:
- The text result did not change, byte for byte. A client that knows nothing about MCP Apps sees
exactly what it saw before, with no stray output and nothing to configure. The row data rides in
the result's own
_meta, on the success branch only; when a tool errors, that key is absent and the view falls back to the text. - The
resourcescapability serves the view and nothing else. No vault content is reachable throughresources/*. Listing notes there would need a permission model designed from scratch, since the per-token allowlist and the kill switch are tool-level concepts, so it is deliberately out of scope. Decisions in ADR-0018. - Clicking a row asks the client to open the note in Obsidian, and the client decides. Claude
Desktop currently declines to follow an
obsidian://link out of a tool result. When that happens the row reveals the note's vault-relative path instead, so the information is never lost. This is host policy and not something this plugin can change from its side. - The line number is shown, never used as a jump target.
obsidian://openhas no line parameter, and under Smart Connections the semantic provider resolves no line at all.
If your client renders the view fully expanded and it buries the conversation (reported for claude.ai), turn it off under Settings → MCP Connector → MCP Tools → Rendered search results (MCP Apps). The search tools then return the text result only, for every token. Each token can override that choice either way in its Tool Loading panel, so a desktop client can keep the view while a web client does without it.
Adaptive tool loading
Every advertised tool costs context tokens on every session: the client downloads each tool's full JSON schema before the model says a word. All 66 active is roughly 10K tokens or more per session. Adaptive loading cuts that without putting any tool out of reach.
Profiles
Set per token in Settings → MCP Connector → Tool Loading.
| Profile | Advertised | Use when |
|---|---|---|
| All (default) | 63 vault tools + 3 meta-tools | You want maximum capability and do not care about the schema cost. |
| Core | 13 core tools + 3 meta-tools + whatever you promoted | You want the smallest, most predictable surface. |
| Adaptive | The same, and it promotes tools you use often on its own | You want the surface to converge on how you actually work. |
Core is: get_server_info, get_active_file, update_active_file, append_to_active_file, get_vault_file, list_vault_files, create_vault_file, search_vault, search_vault_simple, list_tags, get_note_property, set_note_property, get_or_create_daily_note.
Promotions are honoured in both Core and Adaptive, so a tool you pinned stays pinned whatever the profile. Automatic promotion by call frequency is the one thing Core does not do.
Tool Loading, per token. The promoted list is editable by hand, activate_tool writes into it, and frequency promotion fills it in over time. Reset adaptive data clears counters and promotions without touching the profile.
The three meta-tools
tool_catalog(read-only, always active): the full inventory with each tool's status (active,inactive,promoted), call count and description. The model always knows what exists, whatever the profile.activate_tool: promotes one inactive tool by name, usable immediately, no reconnect.persist: truewrites it to that token's promoted list. Obsidian shows a notice each time, so a surface never widens silently.activate_tools: promotes several at once and refreshes the client's tool list only once.
In Adaptive mode the plugin counts calls per tool. At 3 calls a non-core tool is promoted and stays. Counters are vault-wide by design, because how often a tool is used describes the vault, not the client that happened to call it. The Tool Loading panel lists promoted tools, removes any of them, and resets counters without touching your profile.
Two independent off switches
A tool can be dark for two unrelated reasons, and the difference is deliberate:
userDisabled, you switched it off under Tools available. It is invisible to every token and no client can discover it or talk its way past it.- adaptive-inactive, the profile has not promoted it yet. Calling it returns a recoverable error naming the activation path, never "Unknown tool", so the model can fix its own problem in one step.
Does this violate the tools/list stability rule?
MCP revision 2026-07-28 says the advertised set must not vary per-connection or as a side effect of other requests on the connection, while it may vary by the authorization presented. Adaptive loading satisfies it, and the reasoning is written down in ADR-0015: registry state is process-global and token-scoped, never connection-scoped, so two clients presenting the same token get the same list, and a promotion is a vault state change (like a settings edit), not a property of one connection. notifications/tools/list_changed is what the clause points at for exactly this case.
Does a mid-session change cost prompt cache?
It can, depending on the client. Anthropic's prompt cache covers the tool definitions first, then the system prompt, then the messages. If a client keeps MCP tool schemas in that prefix and re-sends a changed list, everything after the change is written to the cache again instead of read from it.
Measured on 2026-10-08 with headless Claude Code 2.1.294 against a mock server that answers activate_tool and sends list_changed the way this plugin does:
| Client setup | Turn after the refresh |
|---|---|
| Tool search on (the Claude Code default) | The client re-listed and the cache stayed intact, with 100 to 300 tokens created per turn |
| Tool search off, schemas in the prefix | 42,779 tokens written and none read. The unchanged control wrote about 71 and read about 42K |
This is one run per setup, on Haiku, against a mock and not the plugin itself. Other clients are not measured.
What follows for you:
- Profile All never changes the list, so it never triggers this.
- Automatic promotion at 3 calls sends no notification on the 2025 protocol wire, so a running session keeps its list until the client re-lists. A client with a
subscriptions/listenstream on the 2026 revision is told. activate_toolandactivate_toolsnotify, and only when the model calls them. Preferactivate_toolswhen several tools are needed, because it refreshes once.- For a long session on a client that keeps tool schemas in the prefix, use All, or promote with
persist: trueand start a new conversation.