Codebase Context
📇 🏠 🍎 🪟 🐧 - Local MCP server that shows AI agents which patterns your team actuall
What is Codebase Context?
Codebase Context is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 📇 🏠 🍎 🪟 🐧 - local mcp server that shows ai agents which patterns your team actuall
📇 🏠 🍎 🪟 🐧 - Local MCP server that shows AI agents which patterns your team actuall
This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MCP protocol support
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx codebase-contextConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Codebase Context
Codebase Context is a local MCP server that indexes your project's source code and exposes hybrid semantic and keyword search, team pattern detection, symbol reference lookup, and a persistent memory store so AI coding agents learn and respect your team's actual conventions. It supports full symbol extraction for TypeScript, JavaScript, Python, Java, Go, Rust, C/C++, Kotlin, C#, and 30+ additional languages, and works offline with a local embedding model by default so your code never leaves your machine.
Prerequisites
- Node.js 18 or higher (for npx execution)
- Git repository initialized in your project root (the server indexes from the repo root)
- An MCP-compatible client such as Claude Desktop, Cursor, or VS Code with an MCP extension
- Optional: An OpenAI API key if you prefer cloud embeddings over the bundled local model
Add the server to Claude Desktop via the MCP CLI
The quickest setup uses the claude mcp add command, which writes the configuration entry for you and downloads the package on first run via npx.
claude mcp add codebase-context -- npx -y codebase-contextIndex your codebase
Run the map command from your project root to build the initial semantic index. This may take a minute for large repos as it generates embeddings for every source file.
npx -y codebase-context mapVerify the index with a search
Test the index by running a keyword or semantic search from the CLI before connecting your AI client.
npx -y codebase-context search --query "authentication middleware"Configure optional environment variables
By default the server uses a local Transformers-based model (Xenova/bge-small-en-v1.5). Set EMBEDDING_PROVIDER=openai and provide OPENAI_API_KEY if you prefer OpenAI embeddings. Set CODEBASE_ROOT to a specific directory to override auto-detection.
export EMBEDDING_PROVIDER=openai
export OPENAI_API_KEY=sk-...Verify manual config in claude_desktop_config.json
If you prefer to configure manually instead of using the CLI, add the server entry below. Adjust CODEBASE_ROOT to point to your project if auto-detection is unreliable.
{
"mcpServers": {
"codebase-context": {
"command": "npx",
"args": ["-y", "codebase-context"],
"env": {
"CODEBASE_ROOT": "/path/to/your/project"
}
}
}
}Codebase Context Examples
Client configuration
Manual claude_desktop_config.json entry for Codebase Context using the local embedding model with an explicit project root.
{
"mcpServers": {
"codebase-context": {
"command": "npx",
"args": ["-y", "codebase-context"],
"env": {
"CODEBASE_ROOT": "/Users/you/projects/my-app",
"EMBEDDING_PROVIDER": "transformers"
}
}
}
}Prompts to try
Example prompts that leverage search, pattern detection, symbol lookup, and team memory tools.
- "Search the codebase for how we handle JWT token refresh"
- "What are the most common patterns my team uses for error handling?"
- "Find all references to the UserService class and show me the top call sites"
- "Remember that we always use Zod for runtime validation in this project"
- "Does this codebase have any circular dependency cycles between modules?"Troubleshooting Codebase Context
Indexing takes very long or runs out of memory on large repos
Use CODEBASE_ROOT to target a subdirectory rather than the entire monorepo. You can also run incremental re-indexing with the refresh_index tool to update only changed files after the initial map.
search_codebase returns no results after indexing
Confirm the index completed without errors by checking for CODEBASE_CONTEXT_DEBUG=1 output. Ensure CODEBASE_ROOT points to the correct directory and that the project contains files in supported languages. Re-run `npx -y codebase-context map` to rebuild.
EMBEDDING_PROVIDER=openai fails with an auth error
Double-check that OPENAI_API_KEY is set in the env block of your MCP config (not just as a shell variable) because the npx subprocess inherits environment from the config, not your interactive shell.
Frequently Asked Questions about Codebase Context
What is Codebase Context?
Codebase Context is a Model Context Protocol (MCP) server that 📇 🏠 🍎 🪟 🐧 - local mcp server that shows ai agents which patterns your team actuall It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Codebase Context?
Follow the installation instructions on the Codebase Context GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Codebase Context?
Codebase Context works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Codebase Context free to use?
Yes, Codebase Context is open source and available under the Elastic License 2.0 license. You can use it freely in both personal and commercial projects.
Codebase Context Alternatives — Similar Coding Agents Servers
Looking for alternatives to Codebase Context? 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 Codebase Context 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 Codebase Context?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.