Connecting CodeNavi to JetBrains IDEs¶
IntelliJ IDEA, PyCharm, PhpStorm, WebStorm, GoLand, Rider and the rest of the JetBrains family have three MCP clients, and all three talk to CodeNavi directly over HTTP. No plugin to install:
| Client | Where you add the server |
|---|---|
| AI Assistant (chat in the IDE) | Settings → Tools → AI Assistant → Model Context Protocol (MCP) |
| Junie in the IDE | Settings → Tools → Junie → MCP Settings |
| Junie CLI (terminal) | ~/.junie/mcp/mcp.json or .junie/mcp/mcp.json; /mcp in the CLI |
Junie in the IDE and Junie CLI read the same mcp.json, so one file covers
both. Each client gets CodeNavi's tools: semantic search, the call graph
(find_callers, impact_analysis, diff_impact), the overview and the index tools by
default, with grep, file reading and the rest one reveal_tools() call away
(config.md).
The endpoint¶
- URL:
http://localhost:8765/mcp(unscoped) or/mcp/<codebase>(scoped) - Header:
Authorization: Bearer <CODENAVI_AUTH_TOKEN> - Get the token from your install's
.env:grep '^CODENAVI_AUTH_TOKEN=' .env | cut -d= -f2-(run from your install directory)
The config block¶
All three clients take the same mcpServers shape:
{
"mcpServers": {
"codenavi": {
"url": "http://localhost:8765/mcp",
"headers": { "Authorization": "Bearer <PASTE_TOKEN>" }
}
}
}
If your server runs with auth turned off, drop the headers line.
Tested with Junie CLI only (26.11.3 on Linux, November 2026: connects and lists the tools). AI Assistant and Junie in the IDE are not tested. JetBrains documents the
headersline for Junie CLI only: its AI Assistant page shows a plainurl, and its Junie IDE page says Junie does not support security tokens in MCP configs. If AI Assistant or Junie in the IDE reports Failed or Authorization required with this block, use Junie CLI, and keep auth on.
Junie (IDE and CLI)¶
Write the block to one of:
~/.junie/mcp/mcp.json: every project.junie/mcp/mcp.jsonin the project root: this project only. Keep it out of version control (it holds the token), e.g. add it to.gitignore. Junie CLI loads it only after you trust the project when it asks.
Or add it from the UI: in the IDE, Settings → Tools → Junie → MCP
Settings → Add, which opens the same file; in Junie CLI, run /mcp and use
the add flow.
Verify: in Junie CLI, run /mcp; codenavi should show as Active
(use Reconnect if it shows Failed; Authorization required means the token is
missing or wrong). In the IDE, the MCP Servers list shows
the connection status and the tool list.
AI Assistant¶
- Open Settings → Tools → AI Assistant → Model Context Protocol (MCP)
(or type
/in the AI chat and pick Add Command). - Click Add, choose the HTTP connection type, and paste the block above.
- Choose global or project level, click OK, then Apply.
AI Assistant uses Streamable HTTP for a plain url, which is what CodeNavi
serves. Don't use a URL ending in /sse: JetBrains' example for the legacy SSE
transport uses one, and CodeNavi does not serve SSE.
Verify: the Status column shows the connection; click its icon to
list the tools. On failure, Help → Show Log and look in the mcp folder.
Then try, in either client:
"Use semantic_search to find where payment processing happens."
Tell the agent how to use it¶
Give the agent CodeNavi's usage rules (Rules for your agent)
by pasting them into the project's agent instructions: Junie's guidelines file
(.junie/AGENTS.md; older Junie versions read .junie/guidelines.md) or an AI
Assistant project rule. Without them the
agent still sees the tools, but tends to fall back on reading files one by
one.
The things that bite people¶
- Older guides say AI Assistant only does stdio. That was true of early
versions and is why some guides wrap the server in an
npx mcp-remotebridge. Current versions connect over HTTP directly; update the IDE rather than add a bridge. - Paste the literal token. Junie CLI does not expand
${VAR}inmcp.json, and the server answers 401. Keep the user-level file private (chmod 600 ~/.junie/mcp/mcp.json). - No
Authorizationheader and auth on = no tools. The client gets a 401 and the server shows as failed or "Authorization required". CodeNavi uses a static bearer token, not OAuth, so add the header rather than following an OAuth prompt. - Unscoped vs scoped
/mcp. Use unscoped/mcpunless you know the codebase name./mcp/<name>returnsUnknown codebase(404) for any<name>that isn't configured; a single-codebase install is usually nameddefault. Check withlist_codebases. - IDE on Windows, CodeNavi in WSL2.
localhostusually reaches the WSL2 server; if not, see Windows.
Not to be confused with JetBrains' own MCP server¶
JetBrains IDEs (2025.2+) can also be an MCP server, exposing the IDE to outside agents (Settings → Tools → MCP Server). That is the other direction and has nothing to do with this page. Running both is fine: an agent like Claude Code can use the IDE's server and CodeNavi side by side.
Privacy¶
AI Assistant and Junie send your prompts, and therefore the code chunks CodeNavi returns, to the model they are configured with (JetBrains AI cloud models, or a local model where your client supports one). Scope CodeNavi to codebases you're comfortable sharing with that model. The CodeNavi server itself sends code to no one.