Basic information
About Code Context MCP Server
A Model Context Protocol (MCP) server for providing code context from git repositories
Code Context MCP Server is a MCP server in the Developer Tools category listed in the AddMCP.net directory, published by fkesheh. Supported transport: stdio. Runtime: node. License: MIT. The repository has 25 GitHub stars. Source code is hosted on github.com.
Setup
{
"mcpServers": {
"code-context-mcp": {
"command": "node",
"args": [
"-p",
"process.arch"
]
}
}
}
{
"mcpServers": {
"code-context-mcp": {
"command": "node",
"args": [
"-p",
"process.arch"
]
}
}
}
{
"servers": {
"code-context-mcp": {
"command": "node",
"args": [
"-p",
"process.arch"
]
}
}
}
Code Context MCP Server config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"code-context-mcp": {
"command": "node",
"args": [
"-p",
"process.arch"
]
}
}
}
Code Context MCP Server tools
Tool list not available yet
This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is Code Context MCP Server?
A Model Context Protocol (MCP) server that provides code context from local git repositories. It clones repositories locally, processes branches and files, generates embeddings for code chunks using Ollama, and performs semantic search over code. Designed for developers who need to search and understand codebases offline.
How to use Code Context MCP Server?
Install Node.js v16+, Git, and Ollama with an embedding model. Clone the repository, install dependencies (npm install), and build (npm run build). Set DATA_DIR and REPO_CACHE_DIR environment variables. Configure with Claude Desktop by adding the server entry in claude_desktop_config.json. Use the queryRepo tool with parameters like repoUrl, branch, query, keywords, filePatterns, excludePatterns, and limit.
Key features of Code Context MCP Server
- Uses local git repositories instead of GitHub API
- Stores data in a SQLite database
- Splits code into semantic chunks
- Generates embeddings using Ollama
- Provides semantic search over code
- Supports optional keyword, file pattern, and exclusion filters
Use cases of Code Context MCP Server
- Search for specific code patterns or functions across a repository
- Quickly understand unfamiliar codebases without an internet connection
- Filter search results by file type or keywords for targeted queries
- Retrieve relevant code snippets for AI assistant context
Frequently asked questions
1 What are the prerequisites for Code Context MCP Server?
Node.js v16 or later, Git, and Ollama with an embedding model (recommended: unclemusclez/jina-embeddings-v2-base-code).
2 How do I resolve ARM architecture issues on Mac M-series chips?
If you encounter incompatible architecture errors with better-sqlite3, rebuild it from source: npm rebuild better-sqlite3 --build-from-source. Ensure your Node.js architecture (process.arch) matches the binary, and set npm_config_arch=arm64 and npm_config_target_arch=arm64 in your shell profile if needed.
3 How can I test that Ollama embeddings are working?
Use curl to send a test embed request: curl http://localhost:11434/api/embed -d '{"model":"unclemusclez/jina-embeddings-v2-base-code","input":"Llamas are members of the camelid family"}'. Try the localhost, 127.0.0.1, or IPv6 address if one fails.
4 What does the `branch` parameter default to if not provided?
The branch parameter is optional. If not provided, the tool automatically uses the repository's default branch.
5 Can I filter search results by keywords or file patterns?
Yes. The optional keywords parameter filters chunks that contain at least one of the specified keywords (case‑insensitive). The filePatterns and excludePatterns parameters accept glob patterns (e.g., **/*.ts) to include or exclude files.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In