Skip to content

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 headers line for Junie CLI only: its AI Assistant page shows a plain url, 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.json in 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

  1. Open Settings → Tools → AI Assistant → Model Context Protocol (MCP) (or type / in the AI chat and pick Add Command).
  2. Click Add, choose the HTTP connection type, and paste the block above.
  3. 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

  1. 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-remote bridge. Current versions connect over HTTP directly; update the IDE rather than add a bridge.
  2. Paste the literal token. Junie CLI does not expand ${VAR} in mcp.json, and the server answers 401. Keep the user-level file private (chmod 600 ~/.junie/mcp/mcp.json).
  3. No Authorization header 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.
  4. Unscoped vs scoped /mcp. Use unscoped /mcp unless you know the codebase name. /mcp/<name> returns Unknown codebase (404) for any <name> that isn't configured; a single-codebase install is usually named default. Check with list_codebases.
  5. IDE on Windows, CodeNavi in WSL2. localhost usually 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.