# Graph Indexer for Devin

> Add Graph Indexer to Devin Desktop and Devin CLI: init prints the MCP server entry, writes AGENTS.md and, with --hooks, the Claude Code hooks Devin runs.

Graph Indexer for Devin is a local MCP server that gives Devin Desktop and Devin CLI exact references, call graphs and change impact for your repository. Run `npx graph-indexer init --agents devin --hooks`: it writes `AGENTS.md` and the hooks Devin loads, and prints the server entry to add in Devin's MCP settings.

## How do I add Graph Indexer to Devin?

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

```bash
npx graph-indexer init --agents devin --hooks
```

`init` detects Devin from a `.devin` or `.windsurf` folder or a `.windsurfrules` file, so plain `npx graph-indexer init` also works in those projects. Add `--hooks` to install the hooks described below.

## What does `npx graph-indexer init` change for Devin?

Unlike most agents, Devin has no project MCP file that `init` writes. For Devin, `init` does this:

| Target | Content |
|---|---|
| `AGENTS.md` | A managed block with the lookup rules and when to call each tool |
| `.claude/settings.json` | The Claude Code hooks, only with `--hooks`, which Devin loads by default |
| Terminal output | The MCP server entry to add in Devin's MCP settings |
| `.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 Devin MCP server entry look like?

`init` prints the command and arguments, with your repository path filled in. In Devin's MCP settings, add a server named `graph-indexer` with these values:

```json
{
  "command": "npx",
  "args": ["-y", "graph-indexer@3", "serve", "--repo", "/path/to/repo"]
}
```

Replace `/path/to/repo` with the absolute path of your repository. The exact field layout of Devin's MCP settings screen is Devin's own; the command and args are what Graph Indexer requires.

## Which hooks does Devin run for Graph Indexer?

Devin Desktop and Devin CLI load the Claude Code hooks in `.claude/settings.json`, so `npx graph-indexer init --agents devin --hooks` writes three of them:

| Event | What it does |
|---|---|
| `PostToolUse` (Edit, Write, MultiEdit, Grep, Bash, Read) | After an edit, runs the edit check on that file; after a search that missed a definition, says where it is; once the agent is crawling, a read gets where its names are defined |
| `SessionStart` | Tells the session in one line that the index exists |
| `SubagentStart` | Gives subagents the lookup rules and the same one-line notice |

Otherwise the hooks stay silent, and they fail open under a deadline, so a slow answer never blocks the agent. They reach a resident Graph Indexer process over a local socket, never over the network. See [how it works](/how-it-works/).

## What does Devin gain from Graph Indexer?

Devin gets eight read-only tools. `find_references` lists every real use of a symbol with a confidence label and says whether the list is complete. `change_impact` returns dependents and the tests to run before a change, and `check_changes` verifies uncommitted edits without a build.

Against the TypeScript compiler on 400 nestjs symbols, `find_references` reached 99.7% precision and 96.2% recall; grep reached 12.8% precision ([benchmarks](/benchmarks/)). 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; Devin still sends what it reads to its model provider. See the [tools reference](/tools/) and the [other agents](/agents/).

## Frequently asked questions

### Why does init print the Devin server entry instead of writing it?

init does not write a Devin config file. It prints the command and args, with your repository path in --repo, and tells you to add the server in Devin's MCP settings, which you do once.

### Which Devin products does this cover?

init targets Devin Desktop, formerly Windsurf, and Devin CLI. It detects them from a .devin or .windsurf folder or a .windsurfrules file. Both read AGENTS.md and load the Claude Code hooks in .claude/settings.json.

### Do hooks work in Devin without the Claude Code agent?

Yes, that is the point of the shared format. The hooks live in .claude/settings.json and Devin loads them by default. They run the same graph-indexer hook command, which fails open under a deadline and stays silent otherwise.

### Are the hooks required?

No. The MCP tools work without them. The hooks add context after edits and searches, such as an edit check on the file you changed. They are written only when you pass --hooks.

---

Updated: 2026-10-08 · Graph Indexer 3.0.0 · https://graph-indexer.vercel.app/agents/devin/
