MCP Server Codebase Analyzer
MCPサーバー・コードベース・アナライザー
TypeScriptコードベースを分析し、コードの健全性の問題を検出し、システムインシデントを取得し、実行可能な修復計画を生成するプロダクショングレードのMCP(Model Context Protocol)サーバーです。デュアルトランスポート(ローカル開発用のSTDIO、クラウドデプロイ用のSSE)をサポートしています。ts-morph、Express、Zodバリデーションを使用して構築されています。
🚀 機能
3つのコアツール:
analyze_codebase_health— TypeScriptリポジトリをスキャンして以下を検出します:大きなファイル(リファクタリング候補)
明示的な関数型の欠如(弱い型付け)
循環依存関係(アーキテクチャ上の問題)
ASTレベルの分析に
ts-morphを使用
fetch_system_incidents— 構造化されたインシデントデータを返します:モックインシデントデータ(テストやデモに最適)
設定可能な遅延と障害モード
LLMフレンドリーなJSONレスポンス
generate_remediation_plan— 実行可能な修正計画を作成します:スタックトレースからの根本原因分析
ステップバイステップの修復手順
コードの提案とベストプラクティス
リスクレベル評価
すべてのツールは、LLMでの利用を想定した構造化された成功/エラーエンベロープを返します。
Related MCP server: ts-language-mcp
アーキテクチャの概要
flowchart LR
Client[McpClient] --> Runtime[RuntimeSelector]
Runtime -->|stdio| Stdio[StdioTransportAdapter]
Runtime -->|sse| Sse[SseTransportAdapter]
Stdio --> Server[McpServer]
Sse --> Server
Server --> Registry[ToolRegistry]
Registry --> ToolA[analyze_codebase_health]
Registry --> ToolB[fetch_system_incidents]
Registry --> ToolC[generate_remediation_plan]ローカル実行 (STDIO)
依存関係のインストール:
npm install
サーバーの起動:
npm run dev:stdio
サーバーがstdin/stdout経由で起動し、ローカルのMCPクライアントの準備が整います。
SSEでの実行 (Express)
環境変数の設定:
TRANSPORT=sseオプション:
AUTH_TOKEN=your-secret-token
サーバーの起動:
npm run dev:sse
エンドポイント:
SSEストリーム用の
GET /eventsMCP JSON-RPCメッセージ用の
POST /messages?sessionId=...
Cursorからの接続
ローカルで使用する場合、Nexus-Coreをstdio MCPサーバーとして登録します:
command:
nodeargs:
dist/index.js(ビルド後) またはtsx src/index.ts(開発時)env:
TRANSPORT=stdio
ホスト環境で使用する場合、MCPクライアントがSSEエンドポイントを使用するように設定します:
stream URL:
https://<host>/eventsmessage URL:
https://<host>/messages?sessionId=<session-id>トークン認証が有効な場合は
Authorization: Bearer <AUTH_TOKEN>を追加してください。
プロンプトの例
"Analyze my repo" (リポジトリを分析して)
"Fetch incidents" (インシデントを取得して)
"Fix this error" (このエラーを修正して)
環境変数
サポートされているすべての設定については .env.example を参照してください。重要な制御項目:
TRANSPORT:stdioまたはsseTOOL_TIMEOUT_MS: 各ツール呼び出しのハードタイムアウトTS_MORPH_MAX_FILES,TS_MORPH_MAX_DEPTH: 分析のガードレールINCIDENT_API_TIMEOUT_MS,INCIDENT_API_RETRIES: 外部依存関係の制御SSE_HEARTBEAT_MS,SSE_SESSION_TTL_MS: SSEセッションのライフサイクル
本番環境へのデプロイ
Docker
イメージのビルド:
docker build -t nexus-core .コンテナの実行:
docker run -e TRANSPORT=sse -e PORT=8080 -p 8080:8080 nexus-core
Cloud Run
deploy.sh を使用します:
PROJECT_ID=<gcp-project> REGION=<region> SERVICE=nexus-core ./deploy.shこのスクリプトは以下の処理を行います:
コンテナイメージのビルド
GCRへのプッシュ
Cloud Runへのデプロイ
信頼性とエラーモデル
すべてのツールリクエストはZodで検証されます。
ツール実行で未処理の例外が返されることはありません。
エラーは以下の項目を含む標準エンベロープを使用します:
codemessageretryablesuggestedActionmeta(requestId,toolName, タイミング)
This server cannot be deployed
Maintenance
Related MCP Connectors
Manage uptime monitors and incidents and search logs, metrics and traces from an AI assistant.
Triage failing GitHub Actions jobs and see what self-heal repaired, in natural language.
Ship production-ready TypeScript code in half the time, at half the cost.
Coding agents in multi-service codebases routinely rebuild existing helpers, trust stale type definitions, and modify API contracts without knowing who consumes them. Carrick solves this by indexing your entire TypeScript ecosystem across service and repository boundaries. By integrating deeply with the TypeScript compiler, Carrick traces every route, type, and cross-service call while recording function behaviour so agents search by intent rather than name. Delivered via MCP for AI agents and LSP for IDEs, Carrick ensures models see existing endpoints and utilities before generating new code. The scanner is source-available and runs from your CLI or CI pipeline.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides real-time TypeScript diagnostics with intelligent caching for AI agents, enabling instant queries instead of running tsc repeatedly.98 npm3MIT
- AlicenseAqualityCmaintenanceEnables AI coding agents to interact with TypeScript projects through compiler-level code intelligence, providing tools for navigation, type information, diagnostics, refactoring, and semantic search.29214 npm4Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to analyze code health in TypeScript/JavaScript projects, providing tools to run analysis, start a dashboard, and get summaries.6 npm3MIT
- AlicenseNot gradedqualityCmaintenanceAnalyzes codebases to produce structured quality health reports with risk-scored modules based on git churn, test coverage, and test-to-source mapping, acting as an MCP server for AI coding agents and a standalone CLI.MIT