Skip to content

Latest commit

 

History

History
193 lines (145 loc) · 6.96 KB

File metadata and controls

193 lines (145 loc) · 6.96 KB
TelemetryFlow Logo

TelemetryFlow Python MCP Server (TFO-Python-MCP)

Version License Python Version MCP Protocol Claude API OTEL SDK Architecture PostgreSQL ClickHouse


Changelog

All notable changes to TelemetryFlow Python MCP Server (TFO-Python-MCP) will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

1.1.2 - 2025-01-12

Added

Core Implementation

  • Initial Python implementation of TelemetryFlow Python MCP Server
  • Full MCP 2024-11-05 protocol support
  • JSON-RPC 2.0 over stdio transport
  • Domain-Driven Design (DDD) architecture
  • CQRS pattern for command/query separation

TelemetryFlow SDK Integration

  • TelemetryFlow Python SDK integration (telemetryflow>=1.1.0)

    • Native integration with TelemetryFlow observability platform
    • Automatic metrics, traces, and logs collection
    • MCP-specific telemetry with mcp.* prefixed metrics
  • MCPTelemetryClient wrapper (infrastructure/telemetry/client.py)

    • Thread-safe singleton pattern with _telemetry_lock
    • Graceful degradation when telemetry SDK not installed
    • MCP-specific convenience methods:
      • record_tool_call() - Tool execution metrics
      • record_resource_read() - Resource read metrics
      • record_prompt_get() - Prompt retrieval metrics
      • record_session_event() - Session lifecycle events
  • Metrics API

    • increment_counter() - Counter metrics with attributes
    • record_gauge() - Gauge metrics for point-in-time values
    • record_histogram() - Histogram metrics for distributions
  • Tracing API

    • span() context manager for distributed tracing
    • add_span_event() for span annotations
    • @traced decorator for automatic function tracing
  • Comprehensive telemetry configuration

    • API credentials (api_key_id, api_key_secret)
    • Connection settings (endpoint, protocol, timeout, compression)
    • Signal configuration (traces, metrics, logs, exemplars)
    • Batch settings (timeout, max size)
    • Retry settings (enabled, max retries, backoff)
    • Rate limiting support

Built-in Tools

Tool Description
echo Echo testing tool
read_file Read file contents with encoding support
write_file Write content to files with directory creation
list_directory List directory contents (recursive option)
search_files Search files by glob pattern
execute_command Execute shell commands with timeout
system_info Get system information
claude_conversation Chat with Claude AI

Built-in Resources

Resource URI Description
config://server Server configuration
status://health Health status
file:///{path} File access (template)

Built-in Prompts

Prompt Description
code_review Code review assistance
explain_code Code explanation
debug_help Debugging assistance

Infrastructure

  • Claude API client with retry logic (Anthropic SDK)
  • Pydantic-based configuration management
  • Structured logging with structlog
  • In-memory repositories for session, conversation, tool, resource, and prompt storage
  • Extended TelemetryConfig with 20+ configuration options
  • Telemetry lifecycle management (initialization, shutdown, flush)
  • Tool execution instrumentation with spans and metrics
  • Resource and prompt instrumentation

Developer Experience

  • CLI with Click (serve, validate, info, init-config commands)
  • Comprehensive test suite (260+ tests)
  • Docker and docker-compose support
  • Pre-commit hooks configuration
  • Full documentation (Architecture, Configuration, Development)
  • Comprehensive README.md with architecture diagrams
  • Environment variable reference in .env.example

Planned

  • SSE transport support
  • WebSocket transport support
  • PostgreSQL persistence
  • ClickHouse analytics integration
  • Redis caching
  • NATS JetStream message queue
  • Rate limiting
  • API key authentication

Version History Summary

Version Date Highlights
1.1.2 2025-01-12 Initial release with DDD, TelemetryFlow SDK, 8 tools

Migration Guide

Fresh Installation

# Using pip
pip install tfo-mcp[full]

# Using Poetry
poetry add tfo-mcp[full]

# Using uv
uv pip install tfo-mcp[full]

Enable Telemetry

# Install with telemetry support
pip install tfo-mcp[telemetry]

# Configure TelemetryFlow
export TELEMETRYFLOW_ENABLED=true
export TELEMETRYFLOW_API_KEY_ID=tfk_your_key_id
export TELEMETRYFLOW_API_KEY_SECRET=tfs_your_key_secret
export TELEMETRYFLOW_ENDPOINT=api.telemetryflow.id:4317

# Start server with telemetry
python -m tfo_mcp serve

Links