Code Context Provider MCP

by AB498

Integrations

  • Provides community support through Discord, with a server link for users to get help with the MCP integration.

  • Provides code symbol analysis for JavaScript files, extracting functions, variables, classes, imports, and exports to help AI assistants understand code structure.

  • Enables symbol extraction and analysis from Python files, providing AI assistants with contextual understanding of Python code structure.

コードコンテキストプロバイダー MCP

AIアシスタントにコードコンテキストと分析を提供するMCPサーバー。ネイティブ依存関係ゼロのWebAssembly Tree-sitterパーサーを使用して、ディレクトリ構造とコードシンボルを抽出します。


特徴

  • ディレクトリツリー構造を生成する
  • JavaScript/TypeScriptおよびPythonファイルを分析する
  • コードシンボル(関数、変数、クラス、インポート、エクスポート)を抽出します
  • MCPプロトコルと互換性があり、AIアシスタントとのシームレスな統合が可能

クイック使用方法(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

ライセンス

マサチューセッツ工科大学

詳細情報やヘルプ

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

ネイティブ依存関係のない WebAssembly Tree-sitter パーサーを使用してディレクトリ構造とコード シンボルを抽出することで、AI アシスタントにコード コンテキストと分析を提供します。

  1. AIアシスタントにコードコンテキストと分析を提供するMCPサーバー。ネイティブ依存関係ゼロのWebAssembly Tree-sitterパーサーを使用して、ディレクトリ構造とコードシンボルを抽出します。
    1. 特徴
      1. クイック使用方法(MCP セットアップ)
        1. Smithery経由でインストール
        2. ウィンドウズ
        3. macOS/Linux
      2. 利用可能なツール
        1. get_code_context
      3. ツール呼び出し時の出力テキストの例
        1. ファイルパターンの例
          1. 大規模プロジェクトの取り扱い
            1. サポートされている言語
              1. 発達
                1. 開発環境の設定
                2. インストール後
              2. ライセンス
                1. 詳細情報やヘルプ

                  Related MCP Servers

                  • A
                    security
                    A
                    license
                    A
                    quality
                    Analyzes source code dependencies across multiple programming languages in the specified directory to identify file relationships, assisting in dependency management and project structure understanding.
                    Last updated -
                    1
                    Python
                    MIT License
                  • -
                    security
                    A
                    license
                    -
                    quality
                    A Cursor-compatible toolkit that provides intelligent coding assistance through custom AI tools for code architecture planning, screenshot analysis, code review, and file reading capabilities.
                    Last updated -
                    1,261
                    2
                    TypeScript
                    MIT License
                  • A
                    security
                    A
                    license
                    A
                    quality
                    A TypeScript-based Model Context Protocol toolkit that enables AI to interact with code files, manage translations, build projects, and search for files and code content.
                    Last updated -
                    33
                    43
                    5
                    TypeScript
                    MIT License
                  • A
                    security
                    F
                    license
                    A
                    quality
                    AI-driven tool that helps developers create beautiful UI components instantly through natural language descriptions, integrating with popular IDEs like Cursor, Windsurf, and VSCode.
                    Last updated -
                    3
                    1

                  View all related MCP servers

                  ID: dxvglivv9l