cocoindex-code

by @cocoindex-io

Cocoindex Code MCP Server

Add AST-based semantic code search over local `stdio` (`ccc mcp`) for Claude Code, Codex, OpenCode, Kilo Code, and Grok via the CocoIndex Rust engine and embedded storage. Install `cocoindex-code[full]` for local embeddings without an API key, or use the slim LiteLLM variant for 100+ cloud providers.

Memory & Knowledge3,004pythonApache-2.0

Server facts

cocoindex-code MCP Server

GitHub stars

3,004

Last commit

Nov 25, 2026

Runtime

python

License

Apache-2.0

Project

License
Apache-2.0

Tech

Runtime
python
Transports
stdio
Remote access
No
Authentication
None for local [full] embeddings; provider API key for slim LiteLLM cloud models

Activity

GitHub stars
3,004
Last commit
Data as of

Tags

  • Code Search
  • Embeddings
  • Indexing
  • Semantic Search
  • Sqlite
  • cocoindex
  • codebase
  • developer tools
  • multi language

Overview

Developers searching for `cocoindex code mcp` get an embedded, incremental AST-aware code search engine built on the CocoIndex Rust transformation engine and licensed under Apache-2.0. Rather than standing up an external vector database, `cocoindex-code` runs a lightweight background daemon with embedded LMDB/SQLite storage and re-indexes only modified files across 28+ languages—including TypeScript, Python, Rust, Go, Java, C++, SQL, Ruby, Swift, Kotlin, and Vue. Install `uv tool install --upgrade 'cocoindex-code[full]'` (or via `pipx`) for batteries-included local SentenceTransformers embeddings (`Snowflake/snowflake-arctic-embed-xs` by default, or GPU-optimized `nomic-ai/CodeRankEmbed` with no API key required), or pick the slim package / 450 MB Docker image (`:latest`) to route embeddings through LiteLLM across 100+ providers such as OpenAI, Voyage, Gemini, Cohere, Bedrock, and Ollama.

Invoking `ccc mcp` launches a local `stdio` MCP server compatible with Claude Code, Codex, OpenCode, Kilo Code, Oh My Pi, and Grok (registering via CLI `add` commands or `.mcp.json`, alongside a bundled `ccc` agent skill and plugin marketplace). Its `search` tool accepts a natural-language query or snippet along with `limit` (1-100), `offset`, `refresh_index` (default true), `languages`, and glob `paths`, returning ranked chunks with file paths, line numbers, and similarity scores—cited by the README for 70% token savings and 1 min default setup. Standalone CLI commands add structural tree-sitter `ccc grep`, `ccc duplicates`, and `ccc doctor` diagnostics.

Install & configure

Requirements

  • Python with `uv` (`uv tool install --upgrade 'cocoindex-code[full]'`) or `pipx`, OR Docker (`cocoindex/cocoindex-code:latest` / `:full`)
  • No API key required for `[full]` local SentenceTransformers embeddings; cloud provider key (e.g., `OPENAI_API_KEY`, `VOYAGE_API_KEY`, `GEMINI_API_KEY`) for slim LiteLLM mode
  • macOS users hitting SQLite extension errors should install Homebrew `python3`; native install is preferred over Docker `:full` on Apple Silicon for Metal (MPS) GPU acceleration
Documented launch / install command
uv tool install --upgrade 'cocoindex-code[full]'

Install via `uv tool install --upgrade 'cocoindex-code[full]'` (local embeddings) or `cocoindex-code` (slim LiteLLM), then register `ccc mcp` in Claude Code (`claude mcp add cocoindex-code -- ccc mcp`), Codex, OpenCode, Kilo Code, or `.mcp.json`. Run `ccc doctor` to verify daemon and embedding health.

Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Use Settings → Developer → Edit Config when available. Do not assume a Linux configuration path; check the client documentation for your platform. Remote servers use the app’s connector flow when supported, not the local stdio file shown here. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Desktop configuration
{
  "mcpServers": {
    "cocoindex-code": {
      "command": "ccc",
      "args": [
        "mcp"
      ]
    }
  }
}

Read the Claude Desktop setup guide

Config file · Project: .cursor/mcp.json

User: ~/.cursor/mcp.json

The project path is relative to the workspace root. The tilde denotes your user home directory. Use Cursor’s MCP settings to confirm which configuration and scope your installed version is reading. Merge this example with existing settings; do not overwrite unrelated servers.

Cursor configuration
{
  "mcpServers": {
    "cocoindex-code": {
      "command": "ccc",
      "args": [
        "mcp"
      ]
    }
  }
}

Read the Cursor setup guide

Config file · Workspace: .vscode/mcp.json

For user scope, use the “MCP: Open User Configuration” command if available. Do not guess a user configuration path across operating systems, profiles, containers, or remote workspaces; check the client documentation. Merge this example with existing settings; do not overwrite unrelated servers.

VS Code configuration
{
  "servers": {
    "cocoindex-code": {
      "type": "stdio",
      "command": "ccc",
      "args": [
        "mcp"
      ]
    }
  }
}

Read the VS Code setup guide

Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json

Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json

Open the MCP configuration through Windsurf’s settings when possible to confirm the active file. Paths can differ in managed or future releases; check the client documentation if this location is not present. Merge this example with existing settings; do not overwrite unrelated servers.

Windsurf configuration
{
  "mcpServers": {
    "cocoindex-code": {
      "command": "ccc",
      "args": [
        "mcp"
      ]
    }
  }
}

Read the Windsurf setup guide

Config file · Project scope: .mcp.json at the repository root

The project file uses mcpServers. For user scope, use claude mcp add --scope user rather than assuming .mcp.json in your home directory is the user configuration. Check the client documentation for managed settings and storage details. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Code configuration
{
  "mcpServers": {
    "cocoindex-code": {
      "type": "stdio",
      "command": "ccc",
      "args": [
        "mcp"
      ]
    }
  }
}

Read the Claude Code setup guide

Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.

Tools

Source: repository README. Tool descriptions are a documented snapshot, not a live capability check.

ToolWhat it does
searchRun semantic similarity search across indexed AST code chunks with optional `limit` (1-100), `offset`, `refresh_index`, `languages`, and `paths` glob filters.

Use cases

  • Locate authentication flows, error handlers, or architecture patterns in unfamiliar repositories by natural-language description instead of brittle text grep.
  • Cut coding-agent token consumption by returning targeted AST code chunks with file paths and line numbers through the `search` MCP tool.
  • Run completely offline semantic code indexing on local hardware using `[full]` SentenceTransformers (`snowflake-arctic-embed-xs` or `CodeRankEmbed`) or Ollama.
  • Combine `ccc mcp` semantic search with CLI `ccc grep` structural tree-sitter matching and `ccc duplicates` similarity grouping during codebase refactors.

Strengths

  • Embedded Rust-backed incremental indexing across 28+ languages requires no external vector database and auto-manages its background daemon.
  • Flexible embedding stack supports no-API-key local SentenceTransformers (`[full]`), Apple Silicon MPS isolation, and 100+ LiteLLM cloud/local models (slim).
  • Works across MCP (`ccc mcp` over `stdio`), coding-agent skills (`npx skills add cocoindex-io/cocoindex-code`), Claude/Grok/Oh My Pi plugins, and persistent Docker containers.
  • Includes built-in diagnostics (`ccc doctor`), custom Python chunkers, per-project `max_file_size` and `.gitignore` respect, and asymmetric indexing/query parameters.

Limitations

  • The `[full]` local-embedding bundle pulls ~1 GB of PyTorch and transformers dependencies (or a 5 GB `:full` Docker image).
  • Docker `:full` on macOS runs local embedding inference on CPU only because Docker cannot access Apple Metal (MPS); native installation is recommended on Macs.
  • The default LMDB storage ceiling is 4 GiB, and mounted Docker volumes need `COCOINDEX_CODE_DB_PATH_MAPPING` to keep LMDB files on native container storage.

cocoindex-code setup notes

  • cocoindex-code's stdio example needs a client that launches local processes.

Frequently asked questions

Install the CLI with `uv tool install --upgrade 'cocoindex-code[full]'` (or `pipx install`), then register the `stdio` server using `claude mcp add cocoindex-code -- ccc mcp` for Claude Code or `codex mcp add cocoindex-code -- ccc mcp` for Codex. You can also install the `ccc` agent skill via `npx skills add cocoindex-io/cocoindex-code`.

Related MCP servers