Code Context MCP Server
コードコンテキストMCPサーバー
ローカルGitリポジトリからコードコンテキストを提供するためのモデルコンテキストプロトコル(MCP)サーバー。このサーバーでは以下のことが可能です。
Gitリポジトリをローカルにクローンする
プロセスブランチとファイル
コードチャンクの埋め込みを生成する
コード上でセマンティック検索を実行する
特徴
GitHub APIの代わりにローカルのgitリポジトリを使用する
SQLiteデータベースにデータを保存する
コードを意味のあるチャンクに分割する
Ollamaを使用してコードチャンクの埋め込みを生成する
コード上のセマンティック検索を提供
Related MCP server: repobase-mcp
前提条件
Node.js (v16+)
ギット
埋め込みモデルを備えたOllama
インストール
# Clone the repository
git clone <repository-url>
cd code-context-mcp
# Install dependencies
npm install
# Build the project
npm run build構成
次の環境変数を設定します。
DATA_DIR: SQLite データベースのディレクトリ (デフォルト: '~/.codeContextMcp/data')REPO_CACHE_DIR: クローンされたリポジトリのディレクトリ (デフォルト: '~/.codeContextMcp/repos')
Ollamaの使用
より高速で強力な埋め込みには、Ollama を使用できます。
# Install Ollama from https://ollama.ai/
# Pull an embedding model (unclemusclez/jina-embeddings-v2-base-code is recommended)
ollama pull unclemusclez/jina-embeddings-v2-base-code
使用法
Claude Desktopでの使用
Claude Desktop 構成ファイル ( claude_desktop_config.json ) に次の構成を追加します。
{
"mcpServers": {
"code-context-mcp": {
"command": "/path/to/your/node",
"args": ["/path/to/code-context-mcp/dist/index.js"]
}
}
}ツール
サーバーは次のツールを提供します。
クエリリポジトリ
リポジトリのクローンを作成し、コードを処理し、セマンティック検索を実行します。
{
"repoUrl": "https://github.com/username/repo.git",
"branch": "main", // Optional - defaults to repository's default branch
"query": "Your search query",
"keywords": ["keyword1", "keyword2"], // Optional - filter results by keywords
"filePatterns": ["**/*.ts", "src/*.js"], // Optional - filter files by glob patterns
"excludePatterns": ["**/node_modules/**"], // Optional - exclude files by glob patterns
"limit": 10 // Optional - number of results to return, default: 10
}branchパラメータはオプションです。指定されていない場合、ツールはリポジトリのデフォルトブランチを自動的に使用します。
keywordsパラメータはオプションです。指定した場合、結果は指定されたキーワードの少なくとも1つを含むチャンクのみにフィルタリングされます(大文字と小文字は区別されません)。
filePatternsおよびexcludePatternsパラメータはオプションです。これらを使用すると、処理および検索対象となるファイルを glob パターンでフィルタリングできます(例: すべての TypeScript ファイルの場合は**/*.ts )。
データベーススキーマ
サーバーは次のスキーマで SQLite を使用します。
repository:リポジトリに関する情報を保存しますbranch: ブランチに関する情報を保存しますfile: ファイルに関する情報を保存しますbranch_file_association: ファイルをブランチに関連付けるfile_chunk: コードチャンクとその埋め込みを保存する
ライセンス
マサチューセッツ工科大学
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceA semantic code search MCP server that enables natural language queries against your codebase, supporting features like related file discovery and context expansion, all running locally.2
- AlicenseNot gradedqualityDmaintenanceMCP server for indexing and searching Git repositories with AI. Enables tools like listing repos, semantic search, file globbing, and regex grep.2416MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables semantic search over local files or GitHub repositories by indexing content into a serverless vector database, allowing AI assistants to understand meaning rather than just keywords.24MIT
- AlicenseAqualityFmaintenanceMCP server for semantic code search that indexes your codebase and allows AI editors to search using natural language queries.911253MIT
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
A MCP server built for developers enabling Git based project management with project and personal…
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/fkesheh/code-context-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server