Agents

Graph Indexer for Zed

Add Graph Indexer to Zed with npx graph-indexer init: it writes a context_servers entry to .zed/settings.json so Zed's agent gets exact code references.

Updated Graph Indexer 3.0.0 View as Markdown

Graph Indexer for Zed is a local MCP server, registered as a Zed context server, that gives Zed’s agent exact references, call graphs and change impact for your project. Run npx graph-indexer init and it writes a graph-indexer entry under context_servers in .zed/settings.json.

How do I add Graph Indexer to Zed?

From the repository root, with Node.js 22.5 or later:

npx graph-indexer init

init configures Zed when it finds a .zed folder. If your project has none, force it with npx graph-indexer init --agents zed, or configure every supported agent at once with --all.

What does npx graph-indexer init change for Zed?

For Zed, init touches these files:

FileContent
.zed/settings.jsonA graph-indexer entry under context_servers, merged with existing ones
AGENTS.mdA managed block with the lookup rules and when to call each tool
.gitignore.graph-indexer/, where the local index lives

Use --dry-run to preview and --no-instructions to skip the AGENTS.md block.

What does the manual Zed configuration look like?

The entry init writes to .zed/settings.json is:

{
  "context_servers": {
    "graph-indexer": {
      "command": "npx",
      "args": ["-y", "graph-indexer@3", "serve"],
      "env": {}
    }
  }
}

Zed starts project context servers in the project root, so the entry has no --repo argument and Graph Indexer indexes the git repository it starts in. With init --local, the command points at your checkout’s bin/graph-indexer.mjs instead of npx.

What does Zed gain from Graph Indexer?

Zed’s agent gets eight read-only tools. Instead of reading whole files and grepping, it asks find_references for every real use of a symbol, call_graph for callers and callees, change_impact for dependents and the tests to run, and check_changes to verify uncommitted edits without a build. Replies are plain text, capped, best result first, typically 400 to 1,500 tokens.

Against the TypeScript compiler on 400 nestjs symbols, find_references reached 99.7% precision and 96.2% recall; grep reached 12.8% precision (benchmarks). The index re-syncs with the files on disk before every answer, so it stays current while Zed’s agent edits. Graph Indexer is not a type checker: generics, reflection and any are only partly visible.

Graph Indexer itself makes no network calls and sends no telemetry; Zed still sends what it reads to its model provider. See the tools reference, how it works and the other agents.

Frequently asked questions

Why does Zed use context_servers instead of mcpServers?

Zed names its MCP servers context servers and keeps them under the context_servers key in settings.json. init writes that key and adds an empty env object, so the entry matches Zed's format rather than the generic mcpServers one.

What if my .zed/settings.json has comments?

A Zed settings file can contain comments. init never rewrites a file whose comments a JSON round trip would drop; it leaves it as is and prints the exact entry to add under context_servers yourself.

Where are the lookup instructions for Zed?

init adds a managed block to AGENTS.md. Zed reads only the first of several rules files, including .rules, AGENTS.md and CLAUDE.md, so an existing .rules file may take precedence over AGENTS.md.

Does Zed run the Graph Indexer hooks?

Graph Indexer has no hook or plugin integration for Zed. Zed uses the eight MCP tools and the AGENTS.md block. The hooks from init --hooks target Claude Code, Devin, OpenCode and Kilo Code.

Try it on your repo.

npx graph-indexer init
Using Claude Code? Install the plugin