Cocoindex Code
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!
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
Maintainer
Works with
Installation
NPM
npx -y cocoindex-codeManual Installation
npx -y cocoindex-codeConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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]'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 -dInitialize 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 initBuild the search index
Index the codebase by running ccc index. Subsequent runs are incremental — only changed files are re-indexed.
ccc indexAdd 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 mcpConfigure 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.
Cocoindex Code Alternatives — Similar Coding Agents Servers
Looking for alternatives to Cocoindex Code? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
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.
Set Up Cocoindex Code in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.