# CocoIndex Code

CocoIndex Code — an MCP server for Claude Code, Codex, Cursor and other platforms providing AST-based semantic code search.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 2987 repo stars
- Author: cocoindex-io
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/cocoindex-io/cocoindex-code
- Updated: 2026-10-22
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/cocoindex-code

## What it 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.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `COCOINDEX_CODE_ROOT_PATH` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env COCOINDEX_CODE_ROOT_PATH=<COCOINDEX_CODE_ROOT_PATH> --transport stdio cocoindex-code -- uvx cocoindex-code
```
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>

### Codex

**Platform CLI**
```bash
codex mcp add cocoindex-code --env COCOINDEX_CODE_ROOT_PATH=<COCOINDEX_CODE_ROOT_PATH> -- uvx cocoindex-code
```
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>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e COCOINDEX_CODE_ROOT_PATH=<COCOINDEX_CODE_ROOT_PATH> cocoindex-code uvx cocoindex-code
```
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>

## When to use it
- perform semantic code search over a repository
- find code chunks by meaning
- update index incrementally on file changes
- save agent context tokens

## Example prompts
- find how user sessions are managed
- search the codebase for authentication logic

## Similar
- [cocoindex](https://affpapa.org/en/nevibecode/skills/cocoindex.md) — skill · 61 installs
- [codeseeker](https://affpapa.org/en/nevibecode/mcp/codeseeker.md) — MCP server · ★ 22 repo stars
- [socraticode](https://affpapa.org/en/nevibecode/mcp/socraticode.md) — MCP server · ★ 3380 repo stars
- [vistoya](https://affpapa.org/en/nevibecode/mcp/vistoya.md) — MCP server · 436 installs
- [mongodb-search-and-ai](https://affpapa.org/en/nevibecode/skills/mongodb-search-and-ai.md) — skill · 6300 installs
- [memory-bridge](https://affpapa.org/en/nevibecode/skills/ruvnet-memory-bridge.md) — skill · 745 installs

From the same set: [cocoindex-io/cocoindex-code](https://affpapa.org/en/nevibecode/by/cocoindex-io/cocoindex-code.md) — 2 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
