Axon.MCP.Server is a sophisticated AI-powered code intelligence platform built on a modern microservices architecture. It combines FastAPI (REST API), Model Context Protocol (AI integration), Celery (distributed processing), and a hybrid analysis engine (Tree-sitter + Roslyn) to transform codebases into queryable knowledge bases.
graph TB
subgraph "Client Layer"
A1[AI Assistants<br/>ChatGPT/Claude/Cursor]
A2[React Dashboard<br/>Port 80]
A3[REST Clients<br/>External Tools]
end
subgraph "API Layer"
B1[MCP Server<br/>:8001]
B2[REST API<br/>:8080]
end
subgraph "Processing Layer"
C1[Celery Worker<br/>Repository Sync]
C2[Enrichment Worker<br/>AI Analysis - 8 concurrency]
C3[Beat Scheduler<br/>Periodic Tasks]
end
subgraph "Analysis Layer"
D1[Tree-sitter Parsers<br/>Python, JS, TS, C#]
D2[Roslyn Analyzer<br/>C# Semantic Analysis]
D3[EF Core Analyzer<br/>Entity Detection]
D4[Knowledge Extractor<br/>Call Graph, Patterns]
end
subgraph "Data Layer"
E1[(PostgreSQL + pgvector<br/>:5432)]
E2[(Redis<br/>Cache/Queue :6379)]
end
subgraph "Monitoring"
F1[Prometheus<br/>:9090]
F2[Grafana<br/>:3000]
end
subgraph "Source Control"
G1[GitLab API]
G2[Azure DevOps API]
end
A1 --> B1
A2 --> B2
A3 --> B2
B1 --> E1
B2 --> E1
B2 --> E2
B2 --> C1
C1 --> D1
C1 --> D2
C1 --> D3
C1 --> D4
C2 --> E1
C1 --> E1
C1 --> E2
D2 --> E1
G1 --> C1
G2 --> C1
B2 --> F1
F1 --> F2
src/api)Purpose: REST API endpoints for UI and external integrations
Key Files:
routes/ - API endpoint handlersResponsibilities:
Authentication Flow:
sequenceDiagram
participant C as Client
participant A as API
participant D as Database
C->>A: POST /auth/login {username, password}
A->>D: Verify credentials
D-->>A: User data
A->>A: Generate JWT token
A-->>C: Set HTTP-only cookie + token
C->>A: GET /api/v1/repositories (with cookie)
A->>A: Validate JWT
A->>D: Query repositories
D-->>A: Repository list
A-->>C: JSON response
src/mcp_server)Purpose: Model Context Protocol server for AI assistant integration
Key Files:
tools/ - 12 MCP tools for AI assistantsresources/ - MCP resource handlers12 Available Tools:
search - Semantic + full-text code searchget_symbol_details - Detailed symbol informationget_call_graph - Function call relationshipsget_inheritance_hierarchy - Class inheritance treeget_module_summary - AI-generated code summariesget_file_symbols - List symbols in a fileget_repository_structure - Project/solution organizationget_api_endpoints - List REST API routesget_ef_entities - Entity Framework mappingsexplore_service - Navigate service architecturefind_implementations - Interface implementationsget_system_architecture_map - Architecture diagramsTransport Modes:
http://localhost:8001 - For remote AI clientssrc/workers)Purpose: Distributed background processing with Celery
Key Files:
Worker Types:
Queues:
repository_sync - Repository cloning and parsingfile_parsing - Individual file processingembeddings - Vector embedding generationai_enrichment - LLM-based enrichmentdefault - General taskssrc/parsers)Purpose: Fast syntactic parsing for multiple languages
Supported Languages:
Extracts:
roslyn_analyzer/)Purpose: Deep semantic analysis for C# code
Architecture: Persistent C# subprocess communicating via JSON over stdin/stdout
Capabilities:
var user → User class)Communication Protocol:
// Request
{"operation": "analyze", "filePath": "UserService.cs", "content": "..."}
// Response
{
"symbols": [...],
"relations": [
{"from": "UserController.Login", "to": "AuthService.Authenticate", "type": "calls"}
]
}
src/extractors)Purpose: Extract high-level patterns and relationships
Components:
Extracts:
src/analyzers)Purpose: Extract Entity Framework Core mappings
Extracts:
src/database)Models (models.py):
Session Management (session.py):
Uses:
src/embeddings)Purpose: Generate vector embeddings for semantic search
Components:
Providers:
Chunking Strategy:
The sync_repository task orchestrates the complete analysis pipeline:
graph LR
A[1. Clone<br/>Repository] --> B[2. Detect<br/>Solutions]
B --> C[3. Restore<br/>.NET Deps]
C --> D[4. Initialize<br/>Roslyn]
D --> E[5. Discover<br/>Files]
E --> F[6. Parse<br/>Tree-sitter]
F --> G[7. Analyze<br/>Roslyn C#]
G --> H[8. Extract<br/>APIs]
H --> I[9. Resolve<br/>Imports]
I --> J[10. Build<br/>Call Graph]
J --> K[11. Detect<br/>Services]
K --> L[12. Analyze<br/>EF Entities]
L --> M[13. Generate<br/>Embeddings]
M --> N[14. AI<br/>Enrichment]
.sln and .csproj filesdotnet restoreMemory Management:
session.expunge_all() every 50 files┌─────────────────────────────────────────────────────────────┐
│ Docker Network: axon-network │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ PostgreSQL │ │ Redis │ │ React UI │ │
│ │ + pgvector │ │ Cache/MQ │ │ (Nginx) │ │
│ │ :5432 │ │ :6379 │ │ :80 │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ REST API │ │ MCP Server │ │
│ │ (FastAPI) │ │ (HTTP) │ │
│ │ :8080 │ │ :8001 │ │
│ └──────────────┘ └──────────────┘ │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Worker │ │ Enrichment │ │ Beat │ │
│ │ (Sync - 1) │ │ Worker (8) │ │ Scheduler │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Prometheus │ │ Grafana │ │
│ │ :9090 │ │ :3000 │ │
│ └──────────────┘ └──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
Resource Allocation:
sequenceDiagram
participant C as Client
participant API as Search Service
participant PG as PostgreSQL
participant V as pgvector
participant R as Redis
C->>API: search(query="authentication")
API->>R: Check cache
alt Cache Hit
R-->>API: Cached results
API-->>C: Return results
else Cache Miss
API->>API: Generate query embedding
par Vector Search
API->>V: Cosine similarity search
V-->>API: Top 10 results
and Keyword Search
API->>PG: Full-text search
PG-->>API: Top 10 results
end
API->>API: Merge + re-rank results
API->>R: Cache results (TTL: 3600s)
API-->>C: Return ranked results
end
embedding <=> query_vectortsvector
graph LR
A[Client Request] --> B{Has Cookie?}
B -->|Yes| C[Validate JWT]
B -->|No| D{Has X-API-Key?}
D -->|Yes| E[Validate API Key]
D -->|No| F[401 Unauthorized]
C -->|Valid| G[Authorize Role]
C -->|Invalid| F
E -->|Valid| G
E -->|Invalid| F
G -->|Authorized| H[Process Request]
G -->|Forbidden| I[403 Forbidden]
Auth Mechanisms:
Secure Defaults:
Application Metrics → Prometheus → Grafana Dashboards
Logs (structlog) → Redis Pub/Sub → Dashboard
Celery Events → Flower (optional)
Key Metrics:
Pre-configured Dashboards:
Features:
Features:
API Endpoints:
POST /api/v1/repositories/discover - Scan source controlPOST /api/v1/repositories/sync/{id} - Trigger manual syncGET /api/v1/repositories - List all repositoriesask_codebase tool for conversational queries