Architecture Overview
This document provides a comprehensive overview of the MCP ADR Analysis Server architecture, including system components, data flows, and design decisions.
System Architectureโ
The MCP ADR Analysis Server is built as a Model Context Protocol (MCP) server that provides AI-powered architectural analysis capabilities to MCP clients.
Core Componentsโ
Transport Layerโ
The server communicates with MCP clients via stdio transport using JSON-RPC 2.0 protocol.
// Message flow
Client โ [JSON-RPC Request] โ Server
Server โ [JSON-RPC Response] โ Client
Key Characteristics:
- Bidirectional communication over stdin/stdout
- Stateless request handling
- Support for tool calls, resource reads, and prompt operations
Tool Layerโ
The server exposes 73 tools organized by functionality:
| Category | Tools | Purpose |
|---|---|---|
| Core Analysis | analyze_project_ecosystem, get_architectural_context | Project understanding |
| ADR Management | suggest_adrs, generate_adr_from_decision | ADR lifecycle |
| Security | analyze_content_security, generate_content_masking | Content protection |
| Deployment | deployment_readiness, smart_git_push_v2 | Release validation |
| Research | perform_research, generate_research_questions | Information gathering |
| Workflow | tool_chain_orchestrator, troubleshoot_guided_workflow | Process automation |
Utility Layerโ
Shared utilities that tools depend on:
Data Flowโ
Analysis Request Flowโ
Knowledge Graph Flowโ
Directory Structureโ
src/
โโโ index.ts # MCP server entry point
โโโ tools/ # Tool implementations (73 tools)
โ โโโ adr-suggestion-tool.ts
โ โโโ smart-score-tool.ts
โ โโโ deployment-readiness-tool.ts
โ โโโ content-masking-tool.ts
โ โโโ ...
โโโ utils/ # Shared utilities
โ โโโ ai-executor.ts # OpenRouter integration
โ โโโ knowledge-graph-manager.ts
โ โโโ cache.ts # Multi-level caching