Skip to content

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.
Cursor’s lite mode exposes six of these: brain_context, brain_search, brain_impact, brain_status, brain_guide, and detect_changes.

Run nestweaver setup to auto-configure your agent’s MCP connection. Supported agents:

  • Claude Code — writes to .mcp.json in the project root
  • Cursor — writes .cursor/mcp.json (lite mode, 6 tools)
  • VS Code and GitHub Copilot — write .vscode/mcp.json under the servers key
  • 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 mcp to 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.

CategoryToolsPurpose
Contextbrain_context, code_context, brain_search, project_context, get_summary, brain_status, brain_guide, brain_diffRetrieve ranked context from the knowledge graph
Code Navigationread_symbols, regex_search, count_patterns, flow_trace, investigate, investigate_expand, investigate_hydrateNavigate symbols, trace execution flows
Impact Analysisblast_radius, brain_impact, affected_tests, dead_code, detect_changes, hub_nodes, bridge_nodes, clusters, cross_repo_contracts, contract_driftAssess change impact and architectural risk
Vault & Notesnote_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_relatedQuery vaults, manage knowledge sources
Utilitystale_check, prune_stale, compact_embeddings, set_extension, unset_extension, query_extensionsGraph maintenance and custom metadata

Many tools share these filtering and output parameters:

ParameterTypeDescription
token_budgetintegerApproximate token cap for the response (chars / 4). Controls how much context is returned.
response_formatstring"concise" for compact rows that still carry each node’s UID and location; "detailed" adds scores and metadata. The default varies by tool.
reposstring[]Filter results to specific repository UIDs or names.
tagsstring[]Include only nodes tagged with any of these tags.
exclude_tagsstring[]Exclude nodes tagged with any of these tags.
path_prefixstringInclude only nodes whose file path starts with this prefix.
kindsstring[]Filter by node kind: Symbol, Note, Section, Tag, Heading. Case-insensitive prefix match.

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. |

These tools handle graph maintenance and custom metadata. They are not covered on a separate sub-page due to their small number.

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.

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.

Attach custom key-value metadata to any node in a JSON sidecar alongside the database.

ParameterTypeRequiredDescription
uidstringYesNode 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).
keystringYesProperty name (e.g. "team_owner", "deprecated"), at most 256 bytes, no control characters.
valueanyYesProperty 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 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).

ParameterTypeRequiredDescription
uidstringNoReturn all custom properties for this node. When provided, key and value are ignored.
keystringNoProperty name to filter by. Required when not using uid mode.
valueanyNoValue to match (exact match only). Required when key is provided.

Remove one custom property from one node.

ParameterTypeRequiredDescription
uidstringYesNode UID.
keystringYesProperty name to delete.

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.

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.