a
Claude Code (bundled plugin — recommended)
Requires Claude Code. Install it first if you don't have it —
claude.com/code (or
npm i -g @anthropic-ai/claude-code), then confirm with claude --version.
The bundled plugin adds twelve slash commands, two skills, and a session hook, and installs fully offline. Run from your
install directory; restart Claude Code twice on first setup (it's a terminal app — "restart" means quit
with /exit and run claude again):
# 1) FROM your CodeNavi package dir (has setup.sh + plugins/claude/) — ./plugins/claude
# is relative to THIS dir, not your project. Then quit (/exit) and relaunch `claude`:
cd ~/codenavi-<version>-trial-base && claude plugin marketplace add ./plugins/claude
claude plugin install codenavi@codenavi
# 2) in the new session, wire the project config, approve the .mcp.json write,
# then quit and relaunch once more:
/codenavi:doctor
# 3) now it's connected — use it:
/codenavi:status # health, version, chunk/file counts
/codenavi:overview # entry points, key modules, frameworks
/codenavi:search how does payment processing work
/codenavi:chat where is the user login validated?
/codenavi:compliance asvs-core # OWASP gap report, file:line evidence
/codenavi:compliance cra-annex1 # EU Cyber Resilience Act Annex I gap report
Give Claude Code the token and port by deriving them from .env (never paste the
token) so they can't drift from the server. Run this once, from your install directory — it's idempotent and self-verifying:
ENV="$(pwd)/.env"
grep -q 'export CODENAVI_AUTH_TOKEN=' ~/.bashrc 2>/dev/null || \
echo "export CODENAVI_AUTH_TOKEN=\$(grep -E '^CODENAVI_AUTH_TOKEN=' '$ENV' | head -1 | cut -d= -f2-)" >> ~/.bashrc
grep -q 'export CODENAVI_PORT=' ~/.bashrc 2>/dev/null || \
echo "export CODENAVI_PORT=\$(grep -E '^CODENAVI_PORT=' '$ENV' | head -1 | cut -d= -f2-)" >> ~/.bashrc
source ~/.bashrc
[ -n "$CODENAVI_AUTH_TOKEN" ] && echo "token OK, port $CODENAVI_PORT" || echo "EMPTY — check the path: $ENV"
Running Claude Code on your laptop against a remote server? It talks to
http://localhost:<port>/mcp — the same server, port, and token as the UI — so either point it at the
server's IP, or keep the same ssh -L <port>:localhost:<port> tunnel from step 3 open, and run the export
above on the laptop too. Running claude on the server over SSH needs no tunnel. No plugin? Drop a
project .mcp.json pointing at http://localhost:<port>/mcp with header
Authorization: Bearer <token>.
Optional — statusline badge. Show how much of the current repo is indexed and whether CodeNavi
was used this turn, right in your Claude Code prompt — /codenavi:status-line enable (and
disable to restore). Needs python3 on PATH; purely cosmetic.
b
OpenAI Codex CLI (bundled connect script)
Only if you use OpenAI's Codex CLI (confirm with codex --version). Codex reads
~/.codex/config.toml (not Claude's .mcp.json) — the bundled connect script
wires it and verifies the endpoint:
PORT=$(grep -E '^CODENAVI_PORT=' .env | head -1 | cut -d= -f2-); PORT=${PORT:-8765}
cd plugins/codex # bundled in your package (two levels below .env)
./connect-codenavi.sh --env-file ../../.env --port "$PORT" # writes config.toml + verifies; never prints your token
codex plugin marketplace add . # then, inside Codex: /plugins install codenavi@codenavi
Three Codex gotchas the script handles: bearer_token_env_var is a variable name
not the token; use the unscoped /mcp (a single-repo install is named default); config goes
in config.toml, not .mcp.json.
c
Everything else — the Connect wizard
For every other editor or agent, the running server's Connect wizard
(http://<server-ip>:<port>/connect, step 4 above) writes copy-paste MCP config for
your exact client — the right config shape and the per-client gotcha handled for you, plus a
paste-ready CLAUDE.md / AGENTS.md guidance block so your agent
reaches for semantic_search instead of blind grep. It always matches your installed
version, so it's the source of truth for client setup.
No server running yet? Preview the config for any client (plus the plugin fast-paths)
at codenavi.com/connect-preview — the same picker, with placeholders you fill in
your browser. Once yours is up, the in-product /connect is better: it fills your real token and
can verify the connection live.