Code Context MCP Server
Local git repository analysis and semantic search using Ollama embedding models.
Data last scanned today · Reviewed today
Overview
Code Context MCP Server enables AI agents to index and perform semantic searches on local git repositories. By cloning repositories and processing code into semantic chunks, the server allows for targeted queries against specific branches, files, and keywords using locally hosted Ollama embedding models. The server stores all repository metadata and processed code chunks within a local SQLite database. It provides granular control over the indexing process through glob-based file pattern filtering and optional keyword constraints, ensuring that only relevant code blocks are surfaced to the AI model during interactions.
Our verdict
With a security score of 29/100, this server is classified as high-risk. This rating is driven by its status as a community-maintained project that has not been editorially reviewed, and the fact that its last commit occurred 253 days ago, suggesting it may lack current maintenance. It is best suited for local, experimental use by developers comfortable managing dependencies and potential security gaps in unverified code.
- Uses local Git repositories for privacy
- Integrates with Ollama for semantic embeddings
- Includes glob-based file inclusion and exclusion
- Maintains data locally via SQLite
- Community-maintained with no official vendor support
- Not yet editorially reviewed for security
- Last commit was over eight months ago
- Low bus-factor with only two contributors
Setup
{
"mcpServers": {
"code-context-mcp": {
"args": [
"-y",
"@modelcontextprotocol/server-code-context"
],
"command": "npx"
}
}
}Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows), then restart Claude Desktop. Some servers require API keys or tokens as environment variables — check the project's README and add an "env" object if needed.
- No read-only mode — running this grants full read/write access.
- No built-in authentication — anyone with access to this config can invoke every tool it exposes.
Tools
| Tool | Description | Risk |
|---|---|---|
| queryRepo | Clones a repository, processes code, and performs semantic search. | medium |
Compatibility
| Client | Local | Docker | Remote | Read-only |
|---|---|---|---|---|
| ChatGPT | ||||
| Claude Desktop | ||||
| Cursor | ||||
| VS Code | ||||
| Windsurf |
Frequently asked questions
›What software do I need installed to use this server?
You must have Node.js (version 16 or higher), Git, and Ollama installed on your machine.
›How can I configure where the server stores its data and repositories?
You can customize the storage locations by setting the DATA_DIR environment variable for the SQLite database and REPO_CACHE_DIR for cloned repositories.
›Which embedding model is recommended for use with Ollama?
The server documentation recommends using the 'unclemusclez/jina-embeddings-v2-base-code' model for generating code embeddings.
›How do I filter search results to specific file types?
You can use the filePatterns and excludePatterns parameters with glob patterns to include or exclude specific files during the queryRepo process.
›What should I do if I encounter architecture errors with better-sqlite3 on a Mac M-series chip?
You should rebuild better-sqlite3 from source by setting the npm_config_arch and npm_config_target_arch variables to 'arm64' before running the install command.
Alternatives
Badge
Maintain this server? Add the live badge to your README.