# Graph Indexer for Junie

> Add Graph Indexer to JetBrains Junie with npx graph-indexer init: it writes .junie/mcp/mcp.json so Junie gets exact references and call graphs locally.

Graph Indexer for Junie is a local MCP server that gives JetBrains Junie exact references, call graphs and change impact for your project. Run `npx graph-indexer init` and it writes a `graph-indexer` entry to `.junie/mcp/mcp.json` and a short instructions block to `AGENTS.md`.

## How do I add Graph Indexer to Junie?

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

```bash
npx graph-indexer init
```

`init` configures Junie when it finds a `.junie` folder. If you have none yet, force it with `npx graph-indexer init --agents junie`, or configure every supported agent with `--all`. Without any detected agent, `init` falls back to Claude Code only.

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

For Junie, `init` touches these files:

| File | Content |
|---|---|
| `.junie/mcp/mcp.json` | A `graph-indexer` entry under `mcpServers`, merged with existing servers |
| `AGENTS.md` | A 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. If `.junie/mcp/mcp.json` contains comments or is not plain JSON, `init` leaves it alone and prints the entry for you to add.

## What does the manual Junie configuration look like?

The entry `init` writes to `.junie/mcp/mcp.json` is the standard stdio form:

```json
{
  "mcpServers": {
    "graph-indexer": {
      "command": "npx",
      "args": ["-y", "graph-indexer@3", "serve"]
    }
  }
}
```

There is no `--repo` argument: Graph Indexer indexes the git repository of the directory it starts in. If you need another path, add `"--repo", "/path/to/repo"` to `args`, or set `GRAPH_INDEXER_REPO`.

## What does Junie gain from Graph Indexer?

Junie's agent gets eight read-only tools over stdio, each reply typically 400 to 1,500 tokens:

- `find_references` lists every real use of a symbol, bound through scopes, imports and receiver types, and says whether the list is complete.
- `call_graph` shows callers and callees across files with confidence per edge.
- `change_impact` returns dependents by distance, the tests to run and a risk level.
- `check_changes` flags syntax errors, calls that no longer fit and removed names still in use, 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/)). The index covers 16 tree-sitter grammars ([languages](/languages/)). 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; Junie still sends what it reads to its model provider. See the [tools reference](/tools/) and the [other agents](/agents/).

## Frequently asked questions

### Does Junie support the Graph Indexer hooks?

Graph Indexer has no hook or plugin integration for Junie. Junie uses the eight MCP tools and the managed instructions block in AGENTS.md. The hooks that init --hooks writes target Claude Code, Devin, OpenCode and Kilo Code.

### Where does init put the lookup instructions for Junie?

In a managed block in AGENTS.md at the repository root, between graph-indexer:start and graph-indexer:end markers. Re-running init updates the block in place; --no-instructions skips it.

### Do I need a JetBrains plugin to use Graph Indexer?

No. Graph Indexer is a Node.js MCP server that Junie starts over stdio through the configuration in .junie/mcp/mcp.json. It needs Node.js 22.5 or later on the machine, and nothing is installed into the IDE.

### How is this different from the IDE's own find usages?

The IDE's find usages is for you in the editor. Graph Indexer gives Junie's agent the same kind of answer as a tool call: a capped plain-text list of real references with confidence labels and a note on whether the list is complete.

---

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