Skip to main content
Codanna is a local code intelligence MCP server and CLI for AI coding agents. Persistent server mode runs continuously over stdio transport for AI assistants — Claude Code, Cursor, Codex, OpenCode, Goose, Gemini CLI.

Usage

The server runs continuously, communicating via stdin/stdout. Use --watch to auto-reload when the index changes.
The AI client spawns this server automatically based on your config. Do not start a separate codanna serve --watch process—this causes index lock conflicts.

Config Path

The --config .codanna/settings.toml argument uses a relative path. This works when:
  • Project-scoped configs (Claude Code, Cursor, OpenCode, Gemini CLI): The client sets the working directory to your project root
  • Global configs (Claude Desktop, Goose): You must run the client from your project directory, or use an absolute path
Run one persistent server per project. Multiple servers with --watch on the same .codanna/ directory will conflict when re-indexing.

Claude Code

Add to .mcp.json in your project root:
This file is project-scoped and can be checked into version control.

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Claude Desktop launches from a system path, not your project directory. The relative config path .codanna/settings.toml may not resolve correctly. Use an absolute path or launch Claude Desktop from your project directory via terminal.

Cursor

Add to .cursor/mcp.json in your project root:
Cursor sets the working directory to the workspace root, so relative paths resolve correctly.

Codex CLI

Add to ~/.codex/config.toml:
Use mcp_servers (snake_case), not mcpServers. The camelCase key is silently ignored.

OpenCode

Add to opencode.json in your project root:
OpenCode combines command and arguments into a single array under command.

Goose

Via CLI:
Or add to ~/.config/goose/config.yaml:

Gemini CLI

Via CLI:
Or add to your settings.json:

Options

Self-Test

Verify Codanna can spawn a server, access the index, and register tools:
This tests Codanna’s MCP capabilities, not the client configurations above.

When to Use