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.
「開発者ツール」の他のコンテンツ
JetBrains MCP Proxy Server
JetBrainsA model context protocol server to work with JetBrains IDEs: IntelliJ, PyCharm, WebStorm, etc. Also, works with Android Studio
MCP Inspector
modelcontextprotocolVisual testing tool for MCP servers
mcp-excalidraw
yctimlinMCP server and Claude Code skill for Excalidraw — programmatic canvas toolkit to create, edit, and export diagrams via AI agents with real-time canvas sync.
nuxt-mcp / vite-plugin-mcp
antfuMCP server helping models to understand your Vite/Nuxt app better.
Hello World MCP Server (Reference Extension)
anthropicsDesktop Extensions: One-click local MCP server installation in desktop apps
コメント