Codebase Context

v1.0.0Coding Agentsstable

📇 🏠 🍎 🪟 🐧 - Local MCP server that shows AI agents which patterns your team actuall

ai-agentsai-codingclaudecode-intelligencecontext-engineering
Share:
44
Stars
0
Downloads
0
Weekly
0/5

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

Show AI agents which coding patterns your team actually uses.
Improve code intelligence for Cursor and Copilot.
Enable context-aware code generation.
PatrickSys

Maintainer

LicenseElastic License 2.0
Languagetypescript
Versionv1.0.0
UpdatedMay 11, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx codebase-context

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 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
1

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-context
2

Index 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 map
3

Verify 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"
4

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-...
5

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.

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": { "codebase-context": { "command": "npx", "args": ["-y", "codebase-context"] } } }

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

Read the full setup guide →

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.

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