MCP server for OpenTelemetry trace analysis during development
Project description
OTEL MCP Server
An MCP (Model Context Protocol) server for Jaeger trace analysis during development. Query and analyze distributed traces with AI assistance for debugging and performance optimization.
Features
- Service Discovery: List services and operations in your Jaeger instance
- Trace Inspection: Search, filter, and inspect traces with full span details
- Performance Analysis: Find slow traces, get latency percentiles, error rates
- REST API: FastAPI endpoints with OpenAPI documentation at
/docs - Self-Telemetry: The server traces itself to Jaeger for debugging
Quick Start
1. Start Jaeger
docker-compose up -d
# Jaeger UI at http://localhost:16686
2. Install Dependencies
uv sync
3. Run the MCP Server
uv run otel-mcp
4. Or Run the REST API
uv run otel-mcp-api
# OpenAPI docs at http://localhost:8000/docs
Configuration
Create a .env file (see .env.example):
JAEGER_URL=http://localhost:16686
JAEGER_TIMEOUT=30
LOG_LEVEL=INFO
# Self-telemetry (optional)
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
OTEL_SERVICE_NAME=otel-mcp
# OTEL_SDK_DISABLED=true # Disable self-telemetry
MCP Tools
Service Discovery
| Tool | Description |
|---|---|
list_services |
List all services in Jaeger |
list_operations |
List operations for a service |
Trace Inspection
| Tool | Description |
|---|---|
search_traces |
Search traces with filters (service, operation, duration, errors) |
get_trace |
Get complete trace by ID with all spans |
find_errors |
Find traces containing errors |
Performance Analysis
| Tool | Description |
|---|---|
get_slow_traces |
Find slowest traces |
get_operation_stats |
Get latency percentiles (p50/p95/p99) and error rates |
REST API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/services |
GET | List services |
/services/{name}/operations |
GET | List operations |
/traces |
GET | Search traces |
/traces/{trace_id} |
GET | Get trace by ID |
/traces/errors |
GET | Find error traces |
/traces/slow |
GET | Find slow traces |
Development
Run Tests
uv run pytest tests/ -v
Run with Coverage
uv run pytest tests/ --cov=otel_mcp --cov-report=term-missing
Lint and Type Check
uv run ruff check src/
uv run mypy src/
Architecture
src/otel_mcp/
├── server.py # MCP server with tool definitions
├── api.py # FastAPI REST endpoints
├── config.py # Configuration management
├── models.py # Pydantic data models
├── telemetry.py # Self-instrumentation setup
└── backends/
├── base.py # Abstract backend interface
└── jaeger.py # Jaeger implementation
Adding a New Backend
- Create
backends/tempo.pyimplementingBaseBackend - Add backend type to
config.py - Update
_create_backend()inserver.pyandapi.py
License
Apache-2.0
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file otel_mcp-0.1.0.tar.gz.
File metadata
- Download URL: otel_mcp-0.1.0.tar.gz
- Upload date:
- Size: 128.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebe1db18fab181e458e47f6f3f572fc0ac83a38f98088e80c811017e823be6a8
|
|
| MD5 |
feb37fd3636ca35402f13cb847ee4aa5
|
|
| BLAKE2b-256 |
7031a97900ab0a8a7680242100287f22f2b5cd49396cd852e60eae46705dc3c9
|
Provenance
The following attestation bundles were made for otel_mcp-0.1.0.tar.gz:
Publisher:
ci.yml on krackenservices/otel-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
otel_mcp-0.1.0.tar.gz -
Subject digest:
ebe1db18fab181e458e47f6f3f572fc0ac83a38f98088e80c811017e823be6a8 - Sigstore transparency entry: 789685164
- Sigstore integration time:
-
Permalink:
krackenservices/otel-mcp@27171a27fe8a8dd1923fdc6f0f9f1555038ac6db -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/krackenservices
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@27171a27fe8a8dd1923fdc6f0f9f1555038ac6db -
Trigger Event:
push
-
Statement type:
File details
Details for the file otel_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: otel_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52672515ac113520adab3a8b55461dcb43f972b7d1b5a0595346e58e93885526
|
|
| MD5 |
bda50dbd833b8d710be0e2631363fb1c
|
|
| BLAKE2b-256 |
294560810eeb9e6a6a3ab6ecdfae29198b17dc630cf5692fe3cee06a932c1bf4
|
Provenance
The following attestation bundles were made for otel_mcp-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on krackenservices/otel-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
otel_mcp-0.1.0-py3-none-any.whl -
Subject digest:
52672515ac113520adab3a8b55461dcb43f972b7d1b5a0595346e58e93885526 - Sigstore transparency entry: 789685165
- Sigstore integration time:
-
Permalink:
krackenservices/otel-mcp@27171a27fe8a8dd1923fdc6f0f9f1555038ac6db -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/krackenservices
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@27171a27fe8a8dd1923fdc6f0f9f1555038ac6db -
Trigger Event:
push
-
Statement type: