CocoIndex Code — Claude Code MCP server: what it does, how to install
CocoIndex Code — an MCP server for Claude Code, Codex, Cursor and other platforms providing AST-based semantic code search.
Apache-2.0 ★ 2,987 updated 2026-10-22
claude mcp add --env COCOINDEX_CODE_ROOT_PATH=<COCOINDEX_CODE_ROOT_PATH> --transport stdio cocoindex-code -- uvx cocoindex-codeWhat CocoIndex Code does
CocoIndex Code performs AST-based semantic search across a local repository to reduce token usage and keep indexes synchronized with edits. Setup requires Python with pipx or uv. The cocoindex-code[full] variant includes local embeddings out of the box without requiring external API keys, whereas the slim variant requires a cloud embedding provider.
Install it with pipx install 'cocoindex-code[full]' or uv tool install --upgrade 'cocoindex-code[full]'. The tool integrates via CLI, skill, and MCP server configuration. Without local transformer dependencies or a cloud API key, embeddings generation will fail.
What it helps with
- perform semantic code search over a repository
- find code chunks by meaning
- update index incrementally on file changes
- save agent context tokens
Example prompts for the agent
- find how user sessions are managed
- search the codebase for authentication logic
How to install CocoIndex Code
Platform CLI
claude mcp add --env COCOINDEX_CODE_ROOT_PATH=<COCOINDEX_CODE_ROOT_PATH> --transport stdio cocoindex-code -- uvx cocoindex-codeReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from cocoindex-code <command>
Platform CLI
codex mcp add cocoindex-code --env COCOINDEX_CODE_ROOT_PATH=<COCOINDEX_CODE_ROOT_PATH> -- uvx cocoindex-codeReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from cocoindex-code <command>
Config file
{
"mcpServers": {
"cocoindex-code": {
"command": "uvx",
"args": [
"cocoindex-code"
],
"env": {
"COCOINDEX_CODE_ROOT_PATH": "<COCOINDEX_CODE_ROOT_PATH>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from cocoindex-code <command>
Config file
{
"servers": {
"cocoindex-code": {
"type": "stdio",
"command": "uvx",
"args": [
"cocoindex-code"
],
"env": {
"COCOINDEX_CODE_ROOT_PATH": "<COCOINDEX_CODE_ROOT_PATH>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from cocoindex-code <command>
Platform CLI
gemini mcp add -e COCOINDEX_CODE_ROOT_PATH=<COCOINDEX_CODE_ROOT_PATH> cocoindex-code uvx cocoindex-codeReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from cocoindex-code <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about CocoIndex Code
How to install CocoIndex Code in Claude Code?
Run claude mcp add cocoindex-code -- uvx cocoindex-code or use claude mcp add --env COCOINDEX_CODE_ROOT_PATH=<COCOINDEX_CODE_ROOT_PATH> --transport stdio cocoindex-code -- uvx cocoindex-code.
What does CocoIndex Code do?
It indexes your local codebase using AST chunks and provides semantic search tools to coding agents, saving tokens during context retrieval.
What is needed to run CocoIndex Code?
You need Python, pipx or uv, plus local embedding dependencies in the full package or a cloud API key for the slim version.