MCP Tools
NestWeaver exposes 43 tools via the Model Context Protocol (MCP), giving AI coding agents structured access to the knowledge graph. Every tool accepts JSON parameters and returns structured JSON responses.
- Context A ranked neighborhood for a name, file, or project.
- Navigation Read a symbol, trace calls, or follow a question.
- Impact What a change reaches, including tests and dead code.
- Vault Notes, backlinks, tags, and the sources you indexed.
- Utility Staleness, sidecars, and custom metadata.
Run nestweaver setup to auto-configure your agent’s MCP connection. Supported agents:
- Claude Code — writes to
.mcp.jsonin the project root - Cursor — writes
.cursor/mcp.json(lite mode, 6 tools) - VS Code and GitHub Copilot — write
.vscode/mcp.jsonunder theserverskey - Gemini CLI — configures via
.gemini/settings.json - Codex — writes
.codex/config.toml - Cline — prints the entry to add in Cline’s MCP Servers panel (Cline has no project-level file)
- Other MCP-compatible agents — use
nestweaver mcpto start the server manually
Aider has no MCP client, so setup registers nothing for it. See AI Tool Integrations for every tool’s config path.
Tool categories
Section titled “Tool categories”| Category | Tools | Purpose |
|---|---|---|
| Context | brain_context, code_context, brain_search, project_context, get_summary, brain_status, brain_guide, brain_diff | Retrieve ranked context from the knowledge graph |
| Code Navigation | read_symbols, regex_search, count_patterns, flow_trace, investigate, investigate_expand, investigate_hydrate | Navigate symbols, trace execution flows |
| Impact Analysis | blast_radius, brain_impact, affected_tests, dead_code, detect_changes, hub_nodes, bridge_nodes, clusters, cross_repo_contracts, contract_drift | Assess change impact and architectural risk |
| Vault & Notes | note_get, backlinks, brain_add_source, brain_remove_source, brain_broken_links, brain_orphan_documents, brain_topic_clusters, brain_tag_graph, brain_doc_stats, brain_memory_lint, brain_memory_consolidate, brain_memory_related | Query vaults, manage knowledge sources |
| Utility | stale_check, prune_stale, compact_embeddings, set_extension, unset_extension, query_extensions | Graph maintenance and custom metadata |
Common parameters
Section titled “Common parameters”Many tools share these filtering and output parameters:
| Parameter | Type | Description |
|---|---|---|
token_budget | integer | Approximate token cap for the response (chars / 4). Controls how much context is returned. |
response_format | string | "concise" for compact rows that still carry each node’s UID and location; "detailed" adds scores and metadata. The default varies by tool. |
repos | string[] | Filter results to specific repository UIDs or names. |
tags | string[] | Include only nodes tagged with any of these tags. |
exclude_tags | string[] | Exclude nodes tagged with any of these tags. |
path_prefix | string | Include only nodes whose file path starts with this prefix. |
kinds | string[] | Filter by node kind: Symbol, Note, Section, Tag, Heading. Case-insensitive prefix match. |
Input limits and errors
Section titled “Input limits and errors”Every list argument is capped and deduplicated, and each tool’s inputSchema states its limits (maxItems, maxLength, minimum, maximum): for example at most 256 context seeds, 32 kinds, 100 repos or tags, 1000 changed files, and 64 count_patterns patterns. A value outside the schema, an empty identifier, or two spellings of one argument with different values (changed_files and files) is refused as an invalid argument. Over stdio, a single JSON-RPC frame larger than 64 MiB is refused.
A lookup whose target does not exist returns isError: true with a JSON envelope (status: "not_found", message, and did_you_mean when there are suggestions). An ambiguous name lists candidates with their file paths. An unknown tool name is a JSON-RPC error (-32602).
| limit | integer | Maximum number of results to return. Total counts are always reported regardless of limit. |
Utility tools
Section titled “Utility tools”These tools handle graph maintenance and custom metadata. They are not covered on a separate sub-page due to their small number.
stale_check
Section titled “stale_check”Check whether the graph index is current. Compares each repo’s indexed git SHA with HEAD and checks that edges were built by the current resolver generation. A generation mismatch reports outdated_resolver.
No parameters required.
prune_stale
Section titled “prune_stale”Remove indexed repos and vaults whose source directories no longer exist on disk. Only a path that is not found is removed; a path that cannot be checked (for example, an unreadable parent directory) is kept and reported as a warning.
No parameters required.
set_extension
Section titled “set_extension”Attach custom key-value metadata to any node in a JSON sidecar alongside the database.
| Parameter | Type | Required | Description |
|---|---|---|---|
uid | string | Yes | Node UID to annotate: not blank, at most 1 KiB, no control characters and no invisible Unicode format or bidi characters (zero-width joiner and non-joiner are allowed). |
key | string | Yes | Property name (e.g. "team_owner", "deprecated"), at most 256 bytes, no control characters. |
value | any | Yes | Property value — any JSON value up to 64 KiB serialized and nested at most 64 levels deep. Overwrites existing. |
last_indexed_at is reserved for NestWeaver and cannot be set or unset. The sidecar is written as compact JSON (an older pretty-printed sidecar still loads) and holds at most 100,000 annotated nodes, 256 properties per node, and 32 MiB in total. A write that has to wait behind an index waits up to NESTWEAVER_METADATA_WRITE_WAIT_SECS (default 15 seconds), then returns write-busy without applying anything; retry it. A cancelled request is never applied, and a committed write is never reported as failed.
query_extensions
Section titled “query_extensions”Query custom metadata set via set_extension. Two modes: by uid (all properties for a node) or by key + value (find all nodes matching a property).
| Parameter | Type | Required | Description |
|---|---|---|---|
uid | string | No | Return all custom properties for this node. When provided, key and value are ignored. |
key | string | No | Property name to filter by. Required when not using uid mode. |
value | any | No | Value to match (exact match only). Required when key is provided. |
unset_extension
Section titled “unset_extension”Remove one custom property from one node.
| Parameter | Type | Required | Description |
|---|---|---|---|
uid | string | Yes | Node UID. |
key | string | Yes | Property name to delete. |
compact_embeddings
Section titled “compact_embeddings”Reclaim embedding vectors left behind by deleted graph nodes. This does not re-embed the graph.
code_context is the code-only PageRank walk. File paths are seeds there. brain_context takes note titles, tags, symbol names, and UIDs.
Verify after setup or an upgrade
Section titled “Verify after setup or an upgrade”Use the same absolute --db for indexing, setup and queries. Preserve the usual
--config binding on commands that accept it; setup accepts --db but no
--config option. Reconnect the client and inspect tool discovery (43 full tools, six in
lite mode, or your explicit allowlist), then query brain_status, a known symbol
with brain_search and its caller with brain_impact. A written config or a
successful CLI command alone does not prove MCP activation. See the
verification walkthrough and
12.2.8 upgrade procedure.
The package’s mcpName and server.json prepare official MCP Registry identity;
installation does not create a registry listing. See the separate
registry checklist.