Code Context Provider MCP
コードコンテキストプロバイダー MCP
AIアシスタントにコードコンテキストと分析を提供するMCPサーバー。ネイティブ依存関係ゼロのWebAssembly Tree-sitterパーサーを使用して、ディレクトリ構造とコードシンボルを抽出します。
特徴
ディレクトリツリー構造を生成する
JavaScript/TypeScriptおよびPythonファイルを分析する
コードシンボル(関数、変数、クラス、インポート、エクスポート)を抽出します
MCPプロトコルと互換性があり、AIアシスタントとのシームレスな統合が可能
Related MCP server: syntax-map-mcp
クイック使用方法(MCP セットアップ)
Smithery経由でインストール
Smithery経由で Claude Desktop のコード コンテキスト プロバイダーを自動的にインストールするには:
npx -y @smithery/cli install @AB498/code-context-provider-mcp --client claudeウィンドウズ
{
"mcpServers": {
"code-context-provider-mcp": {
"command": "cmd.exe",
"args": [
"/c",
"npx",
"-y",
"code-context-provider-mcp@latest"
]
}
}
}macOS/Linux
{
"mcpServers": {
"code-context-provider-mcp": {
"command": "npx",
"args": [
"-y",
"code-context-provider-mcp@latest"
]
}
}
}またはnpmを使用してグローバルにインストールします。
npm install -g code-context-provider-mcp次に、次のコマンドを実行して使用します。
code-context-provider-mcp # if you're not using @latest, you may want to clear the cache for latest version using `Remove-Item -Path "$env:LOCALAPPDATA\npm-cache\_npx" -Recurse -Force` for windows and `rm -rf ~/.npm/_npx` for linux/macos利用可能なツール
get_code_context
ディレクトリを分析し、その構造とコード シンボル (オプション) を返します。
パラメータ:
absolutePath(文字列、必須): 分析するディレクトリへの絶対パスanalyzeJs(ブール値、オプション): JavaScript/TypeScript および Python ファイルを分析するかどうか (デフォルト: false)includeSymbols(ブール値、オプション):レスポンスにコードシンボルを含めるかどうか(デフォルト:false)symbolType(列挙型、オプション): includeSymbols が true の場合に含めるシンボルの種類 (オプション: 'functions'、'variables'、'classes'、'imports'、'exports'、'all'、デフォルト: 'all')filePatterns(文字列の配列、オプション): 分析するファイルパターン (例: [' .js', ' .py', 'config.*'])maxDepth(数値、オプション): 分析するディレクトリの最大深度 (デフォルト: 5 レベル)
注: 匿名関数は結果から自動的に除外されます。
ツール呼び出し時の出力テキストの例
Directory structure for: C:\Users\Admin\Desktop\mcp\context-provider-mcp
Code Analysis Summary:
- Files analyzed: 3
- Total functions: 29
- Total variables: 162
- Total classes: 0
Note: Symbol analysis is supported for JavaScript/TypeScript (.js, .jsx, .ts, .tsx) and Python (.py) files only.
Code analysis limited to a maximum depth of 5 directory levels (default).
├── index.js (39 KB)
│ └── [Analyzed: 22 functions, 150 variables, 0 classes]
│ Functions:
│ - initializeTreeSitter [39:0]
│ - getLanguageFromExtension [107:0]
│ - getPosition [138:24]ファイルパターンの例
filePatternsパラメータを使用して、分析するファイルを指定できます。これは、複数の言語や特定のファイルを扱う複雑なプロジェクトに役立ちます。
例:
["*.js", "*.py"]- すべてのJavaScriptおよびPythonファイルを分析します["config.*"]- 拡張子に関係なくすべての設定ファイルを分析します["package.json", "*.config.js"]- package.jsonとJavaScript設定ファイルを解析します[".ts", ".tsx", ".py"]- TypeScript および Python ファイルを解析します (拡張子形式を使用)
ファイル パターン マッチングでは以下がサポートされます。
ワイルドカード (*) を使用した単純な glob パターン
直接ファイル拡張子(ドットの有無にかかわらず)
正確なファイル名
大規模プロジェクトの取り扱い
非常に大規模なプロジェクトの場合、 maxDepthパラメータを使用して、ツールがディレクトリを走査する深さを制限できます。
maxDepth: 2- ルートディレクトリと1階層下のサブディレクトリのみ解析するmaxDepth: 3- ルートと2階層のサブディレクトリを解析しますmaxDepth: 0- ルートディレクトリ内のファイルのみを解析する
これは特に次の場合に役立ちます:
大規模なモノレポジトリでの作業
多くの依存関係を持つプロジェクトの分析
メインのソースコードのみに焦点を当て、サードパーティのライブラリには焦点を当てない
サポートされている言語
コード シンボル分析は以下に対してサポートされています:
JavaScript (.js)
JSX (.jsx)
タイプスクリプト (.ts)
TSX (.tsx)
Python (.py)
filePatternsパラメータを使用すると、ディレクトリ構造に他のファイル タイプを含めることができますが、シンボリック分析は制限される可能性があります。
発達
開発環境の設定
# Clone the repository
git clone https://github.com/your-username/code-context-provider-mcp.git
cd code-context-provider-mcp
# Install dependencies
npm install
# Set up WASM parsers
npm run setupインストール後
インストール後、パッケージのprepareスクリプトが自動的に実行され、WASMパーサーがダウンロードされます。何らかの理由でダウンロードに失敗した場合は、手動でセットアップを実行できます。
npx code-context-provider-mcp-setupライセンス
マサチューセッツ工科大学
詳細情報やヘルプ
Available Tools
1 toolget_code_contextA
Returns Complete Context of a given project directory, including directory tree, and code symbols. Useful for getting a quick overview of a project. Use this tool when you need to get a comprehensive overview of a project's codebase. Useful at the start of a new task.
Inputs: absolutePath (required), analyzeJs, includeSymbols, maxDepth, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool has a clear and distinct purpose focused on providing project context.
The naming follows a consistent verb_noun pattern (get_code_context), and with only one tool, there is no inconsistency to evaluate. The naming is clear and descriptive.
A single tool is generally too few for most MCP server purposes, as it limits functionality and can feel thin. For a 'Code Context Provider', one tool may not cover all potential needs like updating or filtering context, making it borderline inadequate.
The tool set is severely incomplete for the implied domain of code context provision. While it offers a comprehensive overview, there are obvious gaps such as tools for updating context, filtering by file type, or handling specific symbols, which could lead to agent workarounds or failures.
Maintenance
Related MCP Connectors
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Deterministic context layer for your codebase: change impact, blast radius, answers with receipts.
Ask a codebase what calls what: search, blast radius, paths between symbols, and diffs.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI assistants to understand and navigate codebases through structural analysis. Provides code mapping, symbol search, and impact analysis using ast-grep for accurate parsing of Python, JavaScript, TypeScript, and Go projects.452MIT
- AlicenseCqualityDmaintenanceEnables code analysis of JavaScript, TypeScript, TSX, Python, and Rust files using Tree-sitter, providing symbol listing, definition/reference lookup, AST queries, LSP-style features, and SQLite indexing for efficient cross-file searches.218 npmMIT
- AlicenseNot gradedqualityDmaintenanceProvides a semantic understanding of your codebase by parsing with tree-sitter and building a graph of symbols and dependencies. Enables AI assistants to navigate code, analyze changes, and discover architecture using 18 tools with minimal context overhead.38 npm1MIT
- AlicenseAqualityFmaintenanceA deterministic structural code map server for AI agents, giving them the shape of a codebase (imports, exports, classes, functions, signatures, comments, TODO-markers) without reading whole files into context. Powered by tree-sitter WASM grammars, it runs anywhere Node 18+ works.712 npm1AGPL 3.0