Cocoindex Code

v1.0.0Coding Agentsstable

A super light-weight embedded code search engine CLI (AST based) that just works - saves 70% token and improves speed for coding agent 🌟 Star if you like it!

agentsastcocoindexcode-searchcoding-agent
Share:
1,712
Stars
0
Downloads
0
Weekly
0/5

What is Cocoindex Code?

Cocoindex Code is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to super light-weight embedded code search engine cli (ast based) that just works - saves 70% token and improves speed for coding agent 🌟 star if you like it!

A super light-weight embedded code search engine CLI (AST based) that just works - saves 70% token and improves speed for coding agent 🌟 Star if you like it!

This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A super light-weight embedded code search engine CLI (AST ba

Use Cases

Search code using lightweight AST-based indexing.
Save 70% token consumption for coding agents.
Improve agent speed with context engineering.
cocoindex-io

Maintainer

LicenseApache-2.0
Languagepython
Versionv1.0.0
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y cocoindex-code

Manual Installation

npx -y cocoindex-code

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Cocoindex Code

CocoIndex Code is a lightweight, embedded code search engine that builds an AST-based semantic index of your codebase and exposes it as a single `search` MCP tool for coding agents. By indexing symbol-level structure using tree-sitter across 28+ programming languages, it lets AI assistants find relevant code snippets with precise natural-language queries instead of reading whole files — cutting context token usage by up to 70%. The Rust-powered indexer supports incremental updates, so the index stays fresh without full re-scans after every edit.

Prerequisites

  • Python 3.9+ with pipx or uv installed for tool isolation
  • A PostgreSQL database with the pgvector extension for vector storage (or use the Docker Compose setup)
  • An MCP-compatible client such as Claude Code, Codex, or OpenCode
  • Optional: an embedding provider API key (OPENAI_API_KEY, VOYAGE_API_KEY, etc.) — local sentence-transformers work with no key
1

Install CocoIndex Code

Install via pipx or uv. The [full] extra includes local embedding support via sentence-transformers so you don't need an external API.

pipx install 'cocoindex-code[full]'
# or with uv:
uv tool install 'cocoindex-code[full]'
2

Start the database (Docker)

CocoIndex uses PostgreSQL with pgvector for vector storage. The easiest way to get started is the provided Docker Compose file.

docker compose -f <(curl -L https://raw.githubusercontent.com/cocoindex-io/cocoindex-code/refs/heads/main/docker/docker-compose.yml) up -d
3

Initialize a project

Run ccc init in your project root to create the settings files and add .cocoindex_code/ to .gitignore.

cd /path/to/your/project
ccc init
4

Build the search index

Index the codebase by running ccc index. Subsequent runs are incremental — only changed files are re-indexed.

ccc index
5

Add as MCP server in Claude Code

Register cocoindex-code as an MCP server. The `ccc mcp` command starts the server in stdio mode.

claude mcp add cocoindex-code -- ccc mcp
6

Configure Claude Desktop

Alternatively, add the server block to your Claude Desktop config file manually.

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

Cocoindex Code Examples

Client configuration

Claude Desktop config that starts CocoIndex Code MCP server in stdio mode.

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

Prompts to try

Example prompts using CocoIndex Code's semantic search tool to find relevant code.

- "Search the codebase for authentication logic"
- "Find the database connection pooling code"
- "Search for error handling patterns in the Python files under src/utils/"
- "Find all functions that deal with JWT token validation"
- "Search for rate limiting middleware implementation"

Troubleshooting Cocoindex Code

ccc index fails with a database connection error

Ensure the PostgreSQL container is running (`docker ps`) and that the pgvector extension is installed. Check the connection settings in ~/.cocoindex_code/global_settings.yml.

Search returns irrelevant results

Run `ccc index` again to refresh the index after recent code changes, or pass `refresh_index: true` in the search tool call. Also try narrowing results with the `languages` or `paths` filter parameters.

'ccc' command not found after installation

Ensure the pipx or uv tool bin directory is on your PATH. Run `pipx ensurepath` or check `~/.local/bin` for the ccc binary. Restart your terminal after installation.

Frequently Asked Questions about Cocoindex Code

What is Cocoindex Code?

Cocoindex Code is a Model Context Protocol (MCP) server that super light-weight embedded code search engine cli (ast based) that just works - saves 70% token and improves speed for coding agent 🌟 star if you like it! It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Cocoindex Code?

Install via npm with the command: npx -y cocoindex-code. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with Cocoindex Code?

Cocoindex Code works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Cocoindex Code free to use?

Yes, Cocoindex Code is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.

Browse More Coding Agents MCP Servers

Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "cocoindex-code": { "command": "npx", "args": ["-y", "cocoindex-code"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Cocoindex Code?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides