コード解説者MCP
コード解説のためのMCP(Model Context Protocol)サーバーとして機能するCloudflare Worker。コードの構造と機能を包括的に分析・解説します。
特徴
アーキテクチャ ダイアグラム: 全体的な構造、コンポーネント間の関係、およびデータ フローを示す ASCII ダイアグラムを生成します。
コア機能分析: パターン認識に基づいてコードの主な目的を識別し、説明します。
コンポーネントの内訳: すべての主要なクラスと関数を、その役割の簡単な説明とともに一覧表示します。
多言語サポート: JavaScript、TypeScript、Python、Java、C# など、さまざまなプログラミング言語のコードを分析します。
JSDoc/Docstring 認識: コード内の既存のドキュメントを抽出して利用します。
セキュア API : エンドポイントを保護するためのベアラー トークン認証。
仕組み
Code Explainer は、次のような技術を組み合わせてソース コードを分析します。
パターン認識: コード構造と共通パターンを識別します
関係分析: コンポーネント間の依存関係をマッピングします
ドキュメント抽出: 既存のドキュメントコメントを優先します
アーキテクチャの視覚化: コード構造のASCIIダイアグラムを作成します
コンポーネントの説明: 関数とクラスの意味的な説明を提供します
すべての処理は外部依存なしに Cloudflare Worker 内で行われます。
インストール
前提条件
設定
このリポジトリをクローンします:
git clone https://github.com/BillDuke13/code-explainer-mcp.git cd code-explainer-mcp依存関係をインストールします:
npm install秘密鍵を設定します:
wrangler.jsonc
を編集し、YOUR_SECRET_KEY_HERE
を選択した秘密鍵に置き換えるか、Cloudflare シークレットを使用する (本番環境では推奨):
wrangler secret put SHARED_SECRET
Cloudflare Workers にデプロイする:
npm run deploy
使用法
APIエンドポイント
次の JSON 本文を含む POST リクエストをワーカー URL に送信します。
秘密キーを含む Authorization ヘッダーを追加します。
応答フォーマット
応答は、コード分析を含むresult
フィールドを持つ JSON オブジェクトになります。
使用例
JavaScript(ブラウザ)
Python(リクエスト)
Node.js(アクシオス)
地域開発
リポジトリをクローンし、依存関係をインストールします。
git clone https://github.com/BillDuke13/code-explainer-mcp.git cd code-explainer-mcp npm install開発サーバーを実行します。
wrangler devエンドポイントをローカルでテストします。
curl -X POST http://localhost:8787 \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_SECRET_KEY_HERE" \ -d '{"method":"explainCode","params":["function hello() { return \"Hello World\"; }","javascript"]}'
開発ガイドライン
TypeScriptのベストプラクティスに従う
複雑なロジックにコメントを追加する
公開APIの変更に関するドキュメントの更新
新機能のテストを追加する
安全
APIはベアラートークン認証で保護されています
本番環境で共有シークレットを保存するには環境シークレットを使用します
実際の秘密鍵をバージョン管理にコミットしないでください
本番環境での導入にはレート制限が推奨されます
ライセンス
このプロジェクトは、Apache License 2.0 に基づいてライセンスされています。詳細については、 LICENSEファイルを参照してください。
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
ソースコードを分析して、アーキテクチャ図、コア機能分析、複数のプログラミング言語にわたるコンポーネントの内訳などの包括的な説明を提供する Cloudflare Worker。
Related Resources
Related MCP Servers
- -securityFlicense-qualityAnalyzes codebases to generate dependency graphs and architectural insights across multiple programming languages, helping developers understand code structure and validate against architectural rules.Last updated -62214
- -securityFlicense-qualityAn authless Cloudflare Workers server that provides tools to scrape, analyze, and answer questions about websites using Cloudflare's Browser Rendering and AI capabilities.Last updated -6
PostCrawl MCP Serverofficial
-securityAlicense-qualityA Cloudflare Workers-based server that provides AI assistants with access to search and extract content from social media platforms, particularly Reddit, through the PostCrawl API.Last updated -MIT License- -securityFlicense-qualityA Cloudflare Workers-based service that enables intelligent searching, automatic code snippet recording, and statistical analysis of programming knowledge stored in Notion databases.Last updated -
Appeared in Searches
- A server for creating cloud architecture diagrams
- A server for reviewing code and programming practices
- How to summarize an email thread from Outlook and add it to a JIRA ticket
- A guide to understanding and implementing SEO
- Generating a module in an iOS Xcode project using MVP with Coordinator architecture