MCP Server Codebase Analyzer
MCP Server Codebase Analyzer
Ein produktionsreifer MCP-Server (Model Context Protocol), der TypeScript-Codebasen analysiert, Probleme mit der Code-Integrität erkennt, Systemvorfälle abruft und umsetzbare Sanierungspläne erstellt. Unterstützt dualen Transport (STDIO für lokale Entwicklung, SSE für Cloud-Bereitstellung). Erstellt mit ts-morph, Express und Zod-Validierung.
🚀 Funktionen
Drei Kern-Tools:
analyze_codebase_health— Scannt TypeScript-Repositories auf:Große Dateien (potenzielle Kandidaten für Refactoring)
Fehlende explizite Funktionstypen (schwache Typisierung)
Zirkuläre Abhängigkeiten (architektonische Probleme)
Verwendet
ts-morphfür die Analyse auf AST-Ebene
fetch_system_incidents— Gibt strukturierte Vorfalldaten zurück:Mock-Vorfalldaten (perfekt für Tests/Demos)
Konfigurierbare Verzögerungen und Fehlermodi
LLM-freundliche JSON-Antworten
generate_remediation_plan— Erstellt umsetzbare Korrekturpläne:Ursachenanalyse anhand von Stack-Traces
Schritt-für-Schritt-Sanierungsschritte
Code-Vorschläge und Best Practices
Risikobewertung
Alle Tools geben strukturierte Erfolgs-/Fehler-Umschläge zurück, die für die LLM-Verarbeitung konzipiert sind.
Related MCP server: ts-language-mcp
Architekturübersicht
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]Lokaler Betrieb (STDIO)
Abhängigkeiten installieren:
npm install
Server starten:
npm run dev:stdio
Der Server startet über stdin/stdout und ist bereit für lokale MCP-Clients.
Betrieb mit SSE (Express)
Umgebung festlegen:
TRANSPORT=sseoptional:
AUTH_TOKEN=your-secret-token
Server starten:
npm run dev:sse
Endpunkte:
GET /eventsfür SSE-StreamPOST /messages?sessionId=...für MCP JSON-RPC-Nachrichten
Verbindung von Cursor
Für die lokale Nutzung registrieren Sie Nexus-Core als stdio MCP-Server:
Befehl:
nodeArgumente:
dist/index.js(nach dem Build) odertsx src/index.ts(dev)Umgebung:
TRANSPORT=stdio
Für die gehostete Nutzung konfigurieren Sie Ihren MCP-Client für die Verwendung des SSE-Endpunkts:
Stream-URL:
https://<host>/eventsNachrichten-URL:
https://<host>/messages?sessionId=<session-id>Fügen Sie
Authorization: Bearer <AUTH_TOKEN>hinzu, falls Token-Authentifizierung aktiviert ist.
Beispiel-Prompts
"Analysiere mein Repo"
"Rufe Vorfälle ab"
"Behebe diesen Fehler"
Umgebungsvariablen
Siehe .env.example für alle unterstützten Einstellungen. Wichtige Kontrollen:
TRANSPORT:stdioodersseTOOL_TIMEOUT_MS: Hard-Timeout für jeden Tool-AufrufTS_MORPH_MAX_FILES,TS_MORPH_MAX_DEPTH: Analyse-LeitplankenINCIDENT_API_TIMEOUT_MS,INCIDENT_API_RETRIES: Kontrollen für externe AbhängigkeitenSSE_HEARTBEAT_MS,SSE_SESSION_TTL_MS: SSE-Sitzungslebenszyklus
Produktionsbereitstellung
Docker
Image bauen:
docker build -t nexus-core .Container ausführen:
docker run -e TRANSPORT=sse -e PORT=8080 -p 8080:8080 nexus-core
Cloud Run
Verwenden Sie deploy.sh:
PROJECT_ID=<gcp-project> REGION=<region> SERVICE=nexus-core ./deploy.shDieses Skript:
Baut das Container-Image
Pusht es zu GCR
Stellt es auf Cloud Run bereit
Zuverlässigkeit und Fehlermodell
Alle Tool-Anfragen werden mit Zod validiert.
Keine Tool-Ausführung gibt unbehandelte Ausnahmen zurück.
Fehler verwenden einen Standard-Umschlag mit:
codemessageretryablesuggestedActionmeta(requestId,toolName, Timing)
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.23 PyPIMIT