Skip to content

MCP server

graft init also registers Graft’s MCP server with agents that support it, so these six tools appear natively, no shell required. Claude Code gets this too: graft init writes the server into the project’s .mcp.json (restart Claude Code to load it). Skip with --no-mcp; run it manually with graft mcp [dir].

Tool Takes What it’s for
graft_find_code a question Ranked nodes with file:line, source inlined — usually the full answer, no follow-up read needed.
graft_file_api a file path Every signature in that file, no bodies — the API surface for a tenth of the tokens.
graft_trace_calls a symbol Who depends on it, or what it depends on with direction: out, N levels deep for blast radius.
graft_find_all a regex Every hit, grouped by enclosing symbol, ranked by how coupled that symbol is.
graft_repo_map nothing A first look at an unfamiliar repo: directory clusters, hubs, hotspots.
graft_check_freshness nothing Whether the local graph has drifted from the code.

Register it by hand if your agent needs it explicit:

{ "mcpServers": { "graft": { "command": "npx", "args": ["-y", "@nanonets/graft", "mcp"] } } }

Where a CLI agent supports user-level hooks.json, init also installs Graft’s post-edit hook — blast-radius warnings and automatic $0 graph re-sync after edits (skip with --no-hooks).