You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enterprise-Grade Model Context Protocol Server with Claude AI Integration
A comprehensive MCP server implementation built using Python and following Domain-Driven Design (DDD) patterns, providing seamless integration between the Model Context Protocol and Anthropic's Claude AI.
This server works as the AI integration layer for the TelemetryFlow Platform, providing:
Claude 4 Opus, Claude 4 Sonnet, Claude 3.5 Sonnet/Haiku
Async Runtime
asyncio with async/await
System Architecture
graph TB
subgraph "Client Applications"
CC[Claude Code]
IDE[IDE Extensions]
CLI[CLI Tools]
CUSTOM[Custom MCP Clients]
end
subgraph "TFO-Python-MCP Server"
subgraph "Presentation Layer"
SERVER[MCP Server<br/>JSON-RPC 2.0]
TOOLS[Built-in Tools]
RESOURCES[Resources]
PROMPTS[Prompts]
end
subgraph "Application Layer - CQRS"
CMD[Commands]
QRY[Queries]
HANDLERS[Handlers]
end
subgraph "Domain Layer - DDD"
AGG[Aggregates<br/>Session, Conversation]
ENT[Entities<br/>Message, Tool, Resource]
VO[Value Objects<br/>IDs, Content, Types]
EVT[Domain Events]
SVC[Domain Services]
end
subgraph "Infrastructure Layer"
CLAUDE[Claude API Client]
CONFIG[Configuration<br/>Pydantic Settings]
REPO[Repositories]
LOG[Structured Logging<br/>structlog]
OTEL[TelemetryFlow SDK]
end
end
subgraph "External Services"
ANTHROPIC[Anthropic Claude API]
TFO[TelemetryFlow Platform]
end
CC --> SERVER
IDE --> SERVER
CLI --> SERVER
CUSTOM --> SERVER
SERVER --> CMD
SERVER --> QRY
TOOLS --> HANDLERS
RESOURCES --> HANDLERS
PROMPTS --> HANDLERS
HANDLERS --> AGG
HANDLERS --> SVC
AGG --> ENT
AGG --> VO
AGG --> EVT
SVC --> CLAUDE
HANDLERS --> REPO
CONFIG --> SERVER
LOG --> SERVER
OTEL --> TFO
CLAUDE --> ANTHROPIC
style SERVER fill:#3776AB,stroke:#FFD43B,stroke-width:2px
style CLAUDE fill:#FFCDD2,stroke:#C62828
style ANTHROPIC fill:#FFCDD2,stroke:#C62828
style AGG fill:#C8E6C9,stroke:#388E3C
style HANDLERS fill:#BBDEFB,stroke:#1976D2
style OTEL fill:#E1BEE7,stroke:#7B1FA2
Loading
Built-in Tools
graph TB
subgraph "Tool Registry"
REG[Tool Registry<br/>Manages all tools]
end
subgraph "AI Tools"
T1[claude_conversation<br/>AI-powered chat]
end
subgraph "File Tools"
T2[read_file<br/>Read file contents]
T3[write_file<br/>Write to files]
T4[list_directory<br/>List directory]
T5[search_files<br/>Search by pattern]
end
subgraph "System Tools"
T6[execute_command<br/>Run shell commands]
T7[system_info<br/>System information]
end
subgraph "Utility Tools"
T8[echo<br/>Testing utility]
end
REG --> T1
REG --> T2
REG --> T3
REG --> T4
REG --> T5
REG --> T6
REG --> T7
REG --> T8
style T1 fill:#E1BEE7,stroke:#7B1FA2,stroke-width:2px
style REG fill:#FFE0B2,stroke:#F57C00
Loading
Tool Reference
Tool
Category
Description
Key Parameters
claude_conversation
AI
Send messages to Claude AI
message, model, system_prompt
read_file
File
Read file contents
path, encoding
write_file
File
Write content to file
path, content, create_dirs
list_directory
File
List directory contents
path, recursive
search_files
File
Search files by pattern
path, pattern
execute_command
System
Execute shell commands
command, working_dir, timeout
system_info
System
Get system information
-
echo
Utility
Echo input (testing)
message
Built-in Resources
Resource
Description
config://server
Server configuration
status://health
Health status
file:///{path}
File access (template)
Built-in Prompts
Prompt
Description
code_review
Get thorough code review
explain_code
Get code explanation
debug_help
Get debugging assistance
Installation
Prerequisites
Python 3.11 or later
Anthropic API key
From Source
# Clone the repository
git clone https://github.com/telemetryflow/telemetryflow-python-mcp.git
cd telemetryflow-python-mcp
# Install package
pip install -e .# Or with all optional dependencies
pip install -e ".[all]"# Or with telemetry support only
pip install -e ".[telemetry]"
Using pip
pip install tfo-mcp
Docker
# Build image
docker build -t telemetryflow-python-mcp:1.1.2 .# Run container
docker run --rm -it \
-e ANTHROPIC_API_KEY="your-api-key" \
telemetryflow-python-mcp:1.1.2
# Run with default config
tfo-mcp serve
# Run with custom config
tfo-mcp serve --config /path/to/config.yaml
# Run in debug mode
tfo-mcp serve --debug
# Show version
tfo-mcp --version
# Validate configuration
tfo-mcp validate
# Show server info
tfo-mcp info
# Generate default config
tfo-mcp init-config
Integration with Claude Desktop
Add to your Claude Desktop configuration (claude_desktop_config.json):
# Development
make deps # Install dependencies
make dev # Install with dev dependencies
make setup # Full development setup# Code Quality
make fmt # Format code (black + ruff)
make lint # Run linters
make typecheck # Run mypy type checking# Testing
make test# Run all tests
make test-unit # Run unit tests
make test-integration # Run integration tests
make test-cov # Tests with coverage# CI/CD
make ci-test # Full CI test pipeline
make ci-lint # CI lint pipeline
make ci-security # Security scanning# Docker
make docker-build # Build Docker image
make docker-run # Run Docker container
Testing
# Run all tests
make test# Run with coverage
make test-cov
# Run specific test file
pytest tests/unit/test_config.py -v
# Run CI test pipeline
make ci-test