Code Context MCP Server
@fkesheh
关于 Code Context MCP Server
A Model Context Protocol (MCP) server for providing code context from git repositories
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"code-context-mcp": {
"command": "node",
"args": [
"-p",
"process.arch"
]
}
}
}工具
未检测到工具
工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。
概览
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
FAQ from Code Context MCP Server
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).
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.
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.
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.
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.
开发工具 分类下的更多 MCP 服务器
MCP Framework
QuantGeekDevThe Typescript MCP Framework
Huoshan Test
volcengineMinecraft MCP Server
yuniko-softwareA Minecraft MCP Server powered by Mineflayer API. It allows to control a Minecraft character in real-time, allowing AI assistants to build structures, explore the world, and interact with the game environment through natural language instruction
Stakpak Agent CLI
stakpakShip your code, on autopilot. An open source agent that lives on your machines 24/7 and keeps your apps running. 🦀
Unity MCP (Server + Plugin)
IvanMurzakAI Skills, MCP Tools, and CLI for Unity Engine. Full AI develop and test loop. Use cli for quick setup. Efficient token usage, advanced tools. Any C# method may be turned into a tool by a single line. Works with Claude Code, Gemini, Copilot, Cursor and any other absolutely for fr
评论