Skip to content

Connecting CodeNavi to VS Code

VS Code now has native MCP support (built into agent mode, GA since mid-2026), and several AI agent extensions add their own. They all talk to CodeNavi over the same Streamable-HTTP endpoint, what changes is where the config goes and the exact key shape, which differs more than people expect. There is no CodeNavi-specific VS Code extension yet (see Native extension status); pick a path below and you get the full 35-tool surface (43 with the crawler). By default the server lists semantic search, the call graph (find_callers, impact_analysis, diff_impact), the codebase overview and the index tools, and runs the rest, including grep_search and read_file, on demand: reveal_tools() lists the hidden groups, reveal_tools(call="<tool>", args='{…}') reveals and runs one in a single step.

The universal endpoint

  • URL: http://localhost:8765/mcp (unscoped) or /mcp/<codebase> (scoped), localhost only if the client runs on the server's machine; otherwise the server's host:port (remote-access.md)
  • 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)

What changes per client: the top-level key (servers vs mcpServers), the type string (http vs streamableHttp vs streamable-http), the field name (url vs serverUrl), and whether the token is literal vs env-var. A block copied from one client into another usually fails silently. The exact shapes:

VS Code (native MCP)

Built in: no extension needed. Config lives in .vscode/mcp.json (workspace) or your user mcp.json (Command Palette → MCP: Open User Configuration). The top-level key is servers (NOT mcpServers) and the type is http:

{
  "servers": {
    "codenavi": {
      "type": "http",
      "url": "http://localhost:8765/mcp",
      "headers": { "Authorization": "Bearer <PASTE_TOKEN>" }
    }
  }
}

Or add it from a macOS/Linux shell in one line. code --add-mcp writes the entry to your user profile (the /connect page on your server copies this command for you, with your address and token filled in):

code --add-mcp '{"name":"codenavi","type":"http","url":"http://localhost:8765/mcp","headers":{"Authorization":"Bearer <PASTE_TOKEN>"}}'

Verify with MCP: List Servers. A literal Bearer <token> works; VS Code also supports ${input:...} secret prompting (pair it with an inputs array) if you'd rather not store the token in the file.

Air-gap note: the MCP link to CodeNavi works offline, but native agent mode against a fully-local model is newer and version-dependent (VS Code 1.122+, the "Local" agent provider, a tool-calling-capable local model); the default Copilot model needs cloud sign-in. For a guaranteed-offline VS Code setup, use Cline / Roo / Continue with a local model (below).

Claude Code plugin in VS Code

VS Code's Copilot chat can also run the CodeNavi Claude Code plugin: the using-codenavi skill and the grep hook. Command Palette → Install Plugin from Source, then give it http://<server>:8765/plugins/claude.git. The /plugin chat command doesn't work in Copilot chat; use the Command Palette.

  • The grep hook covers VS Code's own grep_search and terminal tools, and the rg tool that VS Code 1.145 sometimes offers. With CODENAVI_HOOK_GREP=block set where VS Code starts, a search of the indexed tree with them is denied and the agent is pointed at CodeNavi's grep_search, which VS Code lists as mcp_codenavi_grep_search (Plugins → Grep hook). Checked on VS Code 1.144 and 1.145 on Windows.
  • The session-start hook tells the agent that CodeNavi is active, or that the token is missing or the licence has expired. VS Code 1.148 on macOS did not show that text to the agent: asked to quote it, the agent said it had none, while the grep hint below did arrive. The hook script itself prints the right text. The hooks need python3 on the PATH; on Windows the grep hook needs it too. For the hooks, set CODENAVI_AUTH_TOKEN where VS Code starts: on Windows as a user environment variable (then sign out and back in), on Linux and macOS with an export in your shell profile.
  • VS Code updates its built-in tools often. A search tool it adds later isn't covered until the plugin learns its name.

Cline

Open the Cline panel → MCP Servers → Configure, or edit cline_mcp_settings.json directly. Cline's remote type is streamableHttp (camelCase):

{
  "mcpServers": {
    "codenavi": {
      "type": "streamableHttp",
      "url": "http://localhost:8765/mcp",
      "headers": { "Authorization": "Bearer <PASTE_TOKEN>" },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Save → Cline auto-reconnects. Cline runs fully air-gapped pointed at a local model (Ollama / LM Studio / any OpenAI-compatible endpoint).

Roo Code

A Cline fork, but the shape differs, the type is streamable-http (hyphenated) and the auto-approve key is alwaysAllow (not autoApprove). Config is .roo/mcp.json (project) or the global mcp_settings.json:

{
  "mcpServers": {
    "codenavi": {
      "type": "streamable-http",
      "url": "http://localhost:8765/mcp",
      "headers": { "Authorization": "Bearer <PASTE_TOKEN>" },
      "alwaysAllow": []
    }
  }
}

Also fully air-gappable with a local Ollama model.

Continue

Continue's config is YAML, not JSON, mcpServers is a list, and headers go under requestOptions. Put it in .continue/mcpServers/codenavi.yaml (or the mcpServers block of config.yaml):

mcpServers:
  - name: codenavi
    type: streamable-http
    url: "http://localhost:8765/mcp"
    requestOptions:
      headers:
        Authorization: "Bearer <PASTE_TOKEN>"

Reload Continue and pick a tool-use-capable model. Fully air-gappable with Ollama.

Cursor

Cursor is now called Grok Build. The editor's download page and the app (3.32 on macOS) carry the new name. It keeps the cursor command and reads the same ~/.cursor folders, so everything on this page applies unchanged. Checked on macOS 27 with Grok Build 3.32.24.

.cursor/mcp.json (project-scoped) or ~/.cursor/mcp.json (global). Field name is url, no type needed:

{
  "mcpServers": {
    "codenavi": {
      "url": "http://localhost:8765/mcp",
      "headers": { "Authorization": "Bearer <PASTE_TOKEN>" }
    }
  }
}

Restart Cursor (or Cmd/Ctrl-Shift-P → Cursor: Reload MCP).

One click: open /connect on your server, pick Cursor, enter the token, and click Add to Cursor. Cursor opens and asks you to confirm the server. The link carries your token, so don't share it.

If Cursor shows SSE error: Non-200 status code (404), ignore the 404. CodeNavi has no SSE endpoint; Cursor only fell back to SSE because its POST failed. The real cause is in the POST, not a wrong URL, almost always a missing/incorrect Authorization: Bearer token, or a scoped /mcp/<codebase> naming a codebase that doesn't exist (check list_codebases; a single-codebase install is usually default). Open MCP user-codenavi.log (Output → MCP) and read the first WARNING line, it carries the true error (e.g. Unauthorized); the surfaced error is the meaningless SSE 404.

Remote-SSH window? Cursor reads the remote host's mcp.json, not yours. In a Remote-SSH window, Cursor runs its MCP client on the remote host. It reads ~/.cursor/mcp.json on that host (and .cursor/mcp.json in the remote folder). Your local file does not apply, so a correct local token can still give 401 Unauthorized. Put the CodeNavi block in the remote host's file. If CodeNavi runs on that host, use http://localhost:8765/mcp there. See remote windows below.

Cursor plugin

Your CodeNavi server serves a Cursor plugin. It adds the MCP server, the using-codenavi and compliance-check skills, a session-start hook, a grep hook that answers from the index, and slash commands (/codenavi-search, /codenavi-status, /codenavi-doctor and eight more; the plugin's README.md lists them). Install it instead of the mcp.json block above:

git clone http://<server>:8765/plugins/cursor.git ~/.cursor/plugins/local/codenavi

On Windows the folder is %USERPROFILE%\.cursor\plugins\local\codenavi. No git on the client? curl -O http://<server>:8765/plugins/cursor.zip unpacks to codenavi-plugin-cursor/; rename it to that folder. Every package also ships it as plugins/cursor/.

  • The plugin's mcp.json reads the token from CODENAVI_AUTH_TOKEN. Set it where Cursor starts (setx CODENAVI_AUTH_TOKEN <token> on Windows), or replace ${env:CODENAVI_AUTH_TOKEN} in the installed mcp.json with the token.
  • It points at localhost:8765, which is also where an SSH tunnel to a remote server lands (macOS, Windows). A server reached by another address? Change it in the installed mcp.json before Cursor starts for the first time: Cursor keeps the copy it saw first and ignores later edits to that file. To change it afterwards, delete the plugin folder, clone it again, edit, then start Cursor.
  • Remove any codenavi block from your own mcp.json, or the agent sees the tools twice.
  • The hooks need python3 on the PATH. Without it Cursor skips them; the MCP tools and the skills still work. On a Mac, install the Xcode Command Line Tools first (xcode-select --install): until then python3 is a macOS placeholder, and each hook run opens an install dialog.
  • Cursor also runs the hooks of the CodeNavi Claude Code plugin when that plugin is installed for Claude Code on the same machine. On Windows this used to open a Git Bash window (or the hook script in an editor) at every session start and every search. From the next release those hooks do nothing under Cursor on Windows; the Cursor plugin's own hooks do the work.

Restart Cursor. The plugin's README.md covers updates and the grep hook modes (Plugins → Grep hook).

Grep hook in Grok Build (Cursor 3.32). Only hint mode works there: the app reports the search pattern after the search has run, so there is nothing to deny beforehand and block mode cannot act. With hint, the result of the grep carries the CodeNavi hit. Cursor plugin versions up to and including 0.2.23 read the pattern only from the call itself and showed no hint in Grok Build. Get the fix with the next package, or clone the plugin again once your server serves it.

Cursor CLI (headless)

The Cursor CLI (agent) reads the same mcp.json. The header can take the token from the environment instead of a literal: "Authorization": "Bearer ${env:CODENAVI_AUTH_TOKEN}".

In print mode, --approve-mcps approves the server. Current CLI versions (2026.10 and later) then run the CodeNavi tools without more setup. Older versions rejected each tool call until you allowed the CodeNavi tools in ~/.cursor/cli-config.json, and the entry is still harmless to keep:

{
  "permissions": {
    "allow": ["Mcp(codenavi:*)"]
  }
}

Add the entry to the existing permissions.allow list; keep the other keys. With the Cursor plugin, the server is named plugin-codenavi-codenavi, so the entry is "Mcp(plugin-codenavi-codenavi:*)". Then:

export CODENAVI_AUTH_TOKEN=<PASTE_TOKEN>
agent -p --approve-mcps --trust "Use semantic_search to find where routes are registered."

This needs no --force, so the agent cannot run shell commands or write files.

Windsurf (Cognition/Devin)

~/.codeium/windsurf/mcp_config.json. Field name is serverUrl (same as Antigravity, opposite of Cursor):

{
  "mcpServers": {
    "codenavi": {
      "serverUrl": "http://localhost:8765/mcp",
      "headers": { "Authorization": "Bearer <PASTE_TOKEN>" }
    }
  }
}

Restart Windsurf, check Cascade's tool list. Cascade's model is cloud-hosted: your code leaves the machine.

Any other VS Code MCP client

The pattern is constant: an HTTP MCP block with a URL field (url or serverUrl) and a Bearer header. If a client can't send headers, run mcp-remote as a local stdio bridge. Client on another machine than the server? No bridge needed for the clients above, swap localhost:8765 for the server's address and keep the bearer token; see remote-access.md, including its warning about tunnelling onto port 8765 of a Windows box that port-proxies a WSL2 CodeNavi.

The things that bite people

  1. Top-level key varies. VS Code native uses servers; everyone else uses mcpServers. A mcpServers block dropped into .vscode/mcp.json does nothing.
  2. type string varies. http (VS Code), streamableHttp (Cline, camelCase), streamable-http (Roo, Continue, hyphen). Cursor needs no type.
  3. Field name varies. url (VS Code, Cursor, Cline, Roo) vs serverUrl (Windsurf, Antigravity).
  4. Token form varies. Most take a literal Bearer string (no ${VAR}); VS Code native additionally supports ${input:...} prompting.
  5. Scoped vs unscoped /mcp. Use unscoped /mcp unless you know the codebase name; /mcp/<name> returns Unknown codebase (404) for an unconfigured name. Get the names from /health, ./codenavi codebases, or the Web UI System tab. A bare trailing slash (/mcp/) is treated as unscoped1, it no longer 404s on an empty codebase name.
  6. Agents cache MCP server lists. After editing a config file, fully restart the host, reloading the window isn't always enough.
  7. Remote windows read the remote host's config. In a Remote-SSH, WSL or dev container window, the agent runs on the remote side and reads its MCP config there. Cursor reads the remote ~/.cursor/mcp.json. VS Code keeps a separate remote file (MCP: Open Remote User Configuration). Extensions such as Cline, Roo Code, Continue, Claude Code and Codex run on the remote host by default, so they read that host's config files. A correct local config can then still fail with 401 Unauthorized. Configure CodeNavi on each host you connect to, and update every copy when the token changes. To find the caller, look for auth failed (mcp) in the CodeNavi log: it names the source address.

Privacy & air-gap

What the agent's model sees, it sends to wherever that model runs. Cursor → Anthropic/OpenAI, Windsurf → Cognition cloud, native Copilot → GitHub/OpenAI, all cloud. Cline, Roo Code, and Continue can run on a local model (Ollama / LM Studio / vLLM, CodeNavi's own on-box LLM providers), which makes the whole loop air-gappable: the localhost MCP link needs no internet and the model stays on the box. The CodeNavi server itself never phones home. (This is the split the /connect wizard shows as "local-model capable" vs "cloud-model agents".)

Native CodeNavi extension status

"VS Code native MCP" (above) is built into VS Code. A dedicated CodeNavi for VS Code extension (sidebar search panel, status-bar item, raw /ui/api/* calls, no AI agent in the loop) is a separate thing, on the roadmap but not shipped. Until then the agent paths above give the identical 35-tool surface (43 with the crawler). File an issue if a native panel would unlock your workflow.

Other MCP clients

JetBrains IDEs (AI Assistant, Junie, Junie CLI) have their own guide, docs/connecting-jetbrains.md. Neovim AI extensions (e.g. avante.nvim): same http://localhost:8765/mcp endpoint + bearer token; config lives wherever the extension's docs say. Zed has its own guide, docs/connecting-zed.md (it uses a context_servers block).


  1. Vendor change reference CN-350. ↩