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 Go 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:
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
subgraph "Execution Flow"
INPUT[Tool Input]
VALIDATE[Validate Schema]
EXEC[Execute Handler]
RESULT[Tool Result]
end
INPUT --> VALIDATE
VALIDATE --> EXEC
EXEC --> RESULT
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
Claude AI Integration
sequenceDiagram
participant Tool as claude_conversation Tool
participant Service as Claude Service
participant SDK as anthropic-sdk-go
participant API as Anthropic API
Tool->>Service: CreateMessage Request
Note over Service: Build ClaudeRequest<br/>Model, Messages, Tools
Service->>SDK: client.Messages.New()
SDK->>API: POST /v1/messages
alt Success
API-->>SDK: Message Response
SDK-->>Service: *anthropic.Message
Service->>Service: Convert to Domain Response
Service-->>Tool: ClaudeResponse
else Rate Limited
API-->>SDK: 429 Error
SDK-->>Service: Error
Service->>Service: Retry with backoff
Service->>SDK: Retry request
else API Error
API-->>SDK: Error Response
SDK-->>Service: Error
Service-->>Tool: Error Result
end
Note over Tool: Return ToolResult
Loading
Supported Models
Model
ID
Use Case
Claude 4 Opus
claude-opus-4-20250514
Complex reasoning, analysis
Claude 4 Sonnet
claude-sonnet-4-20250514
Balanced performance (default)
Claude 3.7 Sonnet
claude-3-7-sonnet-20250219
Extended thinking
Claude 3.5 Sonnet
claude-3-5-sonnet-20241022
Fast, capable
Claude 3.5 Haiku
claude-3-5-haiku-20241022
Quick responses
Session Lifecycle
stateDiagram-v2
[*] --> Created: New Session
Created --> Initializing: Initialize Request
Initializing --> Ready: Initialized Notification
Ready --> Ready: Tool/Resource/Prompt Operations
Ready --> Closing: Shutdown Request
Closing --> Closed: Cleanup Complete
Closed --> [*]
note right of Created
Session aggregate created
Default capabilities set
end note
note right of Ready
Full MCP operations available
Tools, Resources, Prompts
end note
note right of Closed
All conversations closed
Resources released
end note
# Clone the repository
git clone https://github.com/telemetryflow/telemetryflow-go-mcp.git
cd telemetryflow/telemetryflow-go-mcp
# Download dependencies
make deps
# Build
make build
# Install to GOPATH/bin
make install
Using Go Install
go install github.com/telemetryflow/telemetryflow-go-mcp/cmd/mcp@latest
Docker
# Build image
docker build -t telemetryflow-go-mcp:1.1.2 .# Run container
docker run --rm -it \
-e ANTHROPIC_API_KEY="your-api-key" \
telemetryflow-go-mcp:1.1.2
# Run with default config
tfo-mcp
# Run with custom config
tfo-mcp --config /path/to/config.yaml
# Run in debug mode
tfo-mcp --debug
# Show version
tfo-mcp version
# Validate configuration
tfo-mcp validate
Integration with Claude Code
Add to your Claude Code MCP settings (~/.config/claude-code/mcp_settings.json):
# Development
make build # Build binary
make build-release # Build optimized release binary
make run # Build and run
make run-debug # Run in debug mode
make install # Install to GOPATH/bin
make clean # Clean build artifacts# Dependencies
make deps # Download dependencies
make deps-update # Update and tidy dependencies
make deps-refresh # Refresh all dependencies (clean + download)
make deps-vendor # Vendor dependencies
make deps-check # Check for vulnerabilities (requires govulncheck)
make deps-graph # Show dependency graph
make deps-why DEP=... # Explain why a dependency is needed# Code Quality
make fmt # Format code
make vet # Run go vet
make lint # Run golangci-lint
make lint-fix # Auto-fix lint issues# Testing
make test# Run tests
make test-cover # Tests with coverage
make test-bench # Run benchmarks
make test-short # Run short tests only
make test-all # Run all tests (unit, integration, e2e)# Cross-compilation
make build-all # Build for all platforms
make build-linux # Build for Linux
make build-darwin # Build for macOS
make build-windows # Build for Windows# Docker
make docker-build # Build Docker image
make docker-run # Run Docker container# CI/CD
make ci # Full CI pipeline
make ci-test # CI pipeline (format, vet, lint, test)
make release # Create release artifacts# CI-Specific (GitHub Actions)
make test-unit-ci # Unit tests with coverage output
make test-integration-ci # Integration tests with coverage
make test-e2e-ci # End-to-end tests
make ci-build # Cross-platform CI build
make deps-verify # Verify dependencies
make staticcheck # Run staticcheck
make govulncheck # Vulnerability scanning
make coverage-report # Generate merged coverage report
Testing
# Run all tests
make test# Run all test types (unit, integration, e2e)
make test-all
# Run tests with coverage
make test-cover
# View coverage report
open build/coverage.html
# Run benchmarks
make test-bench
# Run CI test pipeline (format + vet + lint + test)
make ci-test
OpenTelemetry Integration
graph LR
subgraph "TFO-GO-MCP"
APP[Application]
TRACER[Tracer Provider]
METER[Meter Provider]
end
subgraph "Export"
OTLP_EXP[OTLP Exporter]
end
subgraph "TelemetryFlow Stack"
COLLECTOR[TFO-Collector<br/>:4317 gRPC<br/>:4318 HTTP]
BACKEND[TelemetryFlow Backend]
end
APP --> TRACER
APP --> METER
TRACER --> OTLP_EXP
METER --> OTLP_EXP
OTLP_EXP --> COLLECTOR
COLLECTOR --> BACKEND
style COLLECTOR fill:#FFE0B2,stroke:#F57C00
style OTLP_EXP fill:#BBDEFB,stroke:#1976D2