MCP Server for Grafana Tempo trace search, analysis, RED metrics, and cross-pillar correlation
161
An MCP server that gives AI assistants the power to search, analyze, summarize, and correlate distributed traces from Grafana Tempo — with TraceQL query construction, RED metrics analysis, cross-pillar pivots, service topology mapping, and operational diagnostics.
rate(), quantile_over_time(), count_over_time()) and pivot from aggregated metrics to concrete traces via exemplars.X-Scope-OrgID), cross-tenant queries, and tenant ID validation.This Docker image runs an MCP server that connects to your Grafana Tempo backend(s). AI assistants (Claude, Cline, Cursor, or any MCP client) connect to the server over HTTP, SSE, or stdio.
docker run --rm -it \
-p 8768:8768 \
-e TEMPO_BASE_URL=http://host.docker.internal:3200 \
-e MCP_TRANSPORT=http \
talkopsai/tempo-mcp-server:latest
The server is now listening on http://localhost:8768/mcp.
Then configure your MCP client to connect:
{
"mcpServers": {
"tempo": {
"url": "http://localhost:8768/mcp",
"description": "MCP Server for Grafana Tempo distributed tracing"
}
}
}
To enable auto-discovery of Tempo backends via Kubernetes service labels and Tempo Operator CRDs:
docker run --rm -it \
-p 8768:8768 \
-v ~/.kube:/app/.kube:ro \
-e TEMPO_BASE_URL=http://host.docker.internal:3200 \
-e K8S_KUBECONFIG=/app/.kube/config \
-e K8S_ENABLED=true \
-e MCP_TRANSPORT=http \
talkopsai/tempo-mcp-server:latest
Tip: Mount the full
~/.kubedirectory (not justconfig) so certificate paths referenced in your kubeconfig are available inside the container.
Connect to multiple Tempo backends simultaneously:
docker run --rm -it \
-p 8768:8768 \
-e MCP_TRANSPORT=http \
-e TEMPO_BACKENDS='[
{"id": "prod", "base_url": "https://tempo-prod.example.com", "type": "tempo", "multi_tenant": true, "default_tenant": "team-a"},
{"id": "staging", "base_url": "http://tempo-staging:3200", "type": "tempo"}
]' \
talkopsai/tempo-mcp-server:latest
To use this image over stdio transport directly inside Claude Desktop:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"tempo-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e", "TEMPO_BASE_URL=http://host.docker.internal:3200",
"-e", "MCP_TRANSPORT=stdio",
"-e", "MCP_LOG_LEVEL=INFO",
"talkopsai/tempo-mcp-server:latest"
]
}
}
}
For multi-tenant backends, add tenant environment variables:
{
"mcpServers": {
"tempo-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e", "TEMPO_BASE_URL=https://tempo.example.com",
"-e", "TEMPO_MULTI_TENANT=true",
"-e", "TEMPO_DEFAULT_TENANT=my-team",
"-e", "TEMPO_AUTH_HEADER=Bearer your-token",
"-e", "MCP_TRANSPORT=stdio",
"-e", "MCP_LOG_LEVEL=INFO",
"talkopsai/tempo-mcp-server:latest"
]
}
}
}
| Variable | Default | Description |
|---|---|---|
MCP_TRANSPORT | stdio | Transport protocol: http, sse, streamable-http, or stdio |
MCP_HOST | 0.0.0.0 | Host interface to bind to |
MCP_PORT | 8768 | Port for HTTP server |
MCP_PATH | /mcp | MCP endpoint path |
MCP_LOG_LEVEL | INFO | Log level: DEBUG, INFO, WARNING, ERROR |
MCP_LOG_FORMAT | json | Log format: json or text |
MCP_HTTP_TIMEOUT | 300 | HTTP server timeout (seconds) |
| Variable | Default | Description |
|---|---|---|
TEMPO_BASE_URL | http://localhost:3200 | Tempo HTTP API base URL |
TEMPO_BACKEND_ID | default | Backend identifier |
TEMPO_TYPE | tempo | Backend type: tempo, tempo-gateway, unknown |
TEMPO_DEPLOYMENT_MODE | unknown | Deployment mode: monolithic, microservices, unknown |
TEMPO_AUTH_HEADER | (empty) | Authorization header (e.g. Bearer <token>) |
TEMPO_VERIFY_SSL | true | Verify SSL certificates |
TEMPO_TIMEOUT | 30 | HTTP timeout per request (seconds) |
TEMPO_BACKENDS | (empty) | JSON array of backend configs for multi-backend mode |
| Variable | Default | Description |
|---|---|---|
TEMPO_MULTI_TENANT | false | Enable multi-tenant mode |
TEMPO_DEFAULT_TENANT | (empty) | Default tenant ID (required if multi-tenant) |
TEMPO_TENANT_HEADER | X-Scope-OrgID | HTTP header for tenant ID injection |
| Variable | Default | Description |
|---|---|---|
TEMPO_MAX_LOOKBACK | 168h | Maximum query lookback (7 days) |
TEMPO_DEFAULT_SEARCH_LIMIT | 20 | Default max traces per search |
TEMPO_MAX_SEARCH_LIMIT | 100 | Absolute max traces per search |
TEMPO_REQUIRE_TIME_RANGE | true | Require time range on searches |
TEMPO_REQUIRE_FILTER_OR_QUERY | true | Require at least one filter or TraceQL query |
TEMPO_MAX_METRICS_DURATION | 3h | Maximum metrics query time range |
| Variable | Default | Description |
|---|---|---|
TEMPO_LLM_FORMAT | true | Enable LLM-optimized trace format (Tempo 2.9+) |
| Variable | Default | Description |
|---|---|---|
K8S_ENABLED | false | Enable K8s-based Tempo backend discovery |
K8S_CONTEXT | (empty) | Specific kubeconfig context to use |
K8S_IN_CLUSTER | false | Set true when running inside a Kubernetes pod |
| Tool | Description |
|---|---|
tempo_list_backends | List all configured Tempo backends with health status |
tempo_get_backend | Get detailed backend profile: health, version, capabilities, tenant requirements |
tempo_get_query_policies | Get query guardrails and default search parameters |
| Tool | Description |
|---|---|
tempo_get_attribute_names | Discover trace attribute names by scope (resource, span, intrinsic, event, link) |
tempo_get_attribute_values | Get distinct values for a specific trace attribute |
tempo_get_k8s_attribute_map | Get canonical K8s-to-Tempo attribute mapping with optional live validation |
| Tool | Description |
|---|---|
tempo_traceql_search | HIGH-INTENT: Search using raw TraceQL or K8s-friendly filters with auto-translation |
tempo_get_trace | Retrieve a single trace by ID with LLM-optimized format |
tempo_query_a2ui | Retrieve a trace structured for A2UI rendering with DAG-aware pruning |
tempo_summarize_trace | HIGH-INTENT: Generate intelligent trace summary — critical path, root cause, next queries |
tempo_find_related_traces | HIGH-INTENT: Find related traces using correlation strategies |
| Tool | Description |
|---|---|
tempo_traceql_metrics_range | TraceQL metrics range query — Prometheus-compatible time series output |
tempo_traceql_metrics_instant | TraceQL metrics instant query — point-in-time vector output |
| Tool | Description |
|---|---|
tempo_get_exemplar_traces | Pivot from aggregated metrics to concrete traces via exemplars |
tempo_get_trace_from_log | Extract trace ID from a log line and retrieve the full trace |
| Tool | Description |
|---|---|
tempo_get_diagnostics | HIGH-INTENT: Comprehensive backend diagnostics with severity-ranked findings |
| Tool | Description |
|---|---|
tempo_get_service_dependencies | Map service dependencies with request rates per edge |
| Tool | Description |
|---|---|
tempo_list_operator_crs | List Tempo Operator custom resources across namespaces |
tempo_get_operator_cr | Get Tempo Operator CR with full spec, status, and storage config |
tempo_create_operator_cr | Create TempoStack or TempoMonolithic CR (dry_run by default) |
tempo_patch_operator_cr | Patch fields of an existing Tempo Operator CR (dry_run by default) |
| Tool | Description |
|---|---|
tempo_compare_traces | HIGH-INTENT: 5-dimensional diff of two traces |
| Tool | Description |
|---|---|
tempo_generate_alerting_expression | Generate PromQL alerting expressions from trace patterns |
| Resource | Description |
|---|---|
tempo://system/backends | All configured backends with health status — start here |
tempo://system/backends/{backend_id} | Detailed profile for a specific backend |
tempo://deployment/overview | Deployment topology: backends, modes, tenants, K8s status |
tempo://reference/traceql | TraceQL syntax reference and examples |
tempo://reference/traceql-metrics | TraceQL metrics functions reference |
tempo://reference/k8s-attributes | Canonical K8s-to-Tempo attribute mapping |
tempo://reference/query-policies | Query guardrails and safety guidelines |
tempo://runbooks/latency-spike | Runbook for investigating latency spikes |
tempo://runbooks/error-burst | Runbook for investigating error bursts |
tempo://runbooks/no-traces-found | Diagnostic runbook for "no traces found" |
tempo://examples/common-queries | Common TraceQL and metrics query examples |
:ro.TEMPO_AUTH_HEADER is included in every request — treat it as a secret.tempo_create_operator_cr and tempo_patch_operator_cr default to dry_run=True. Review output before applying with dry_run=False.services:
tempo-mcp-server:
image: talkopsai/tempo-mcp-server:latest
ports:
- "8768:8768"
environment:
- TEMPO_BASE_URL=http://tempo:3200
- MCP_TRANSPORT=http
- MCP_LOG_LEVEL=INFO
depends_on:
- tempo
tempo:
image: grafana/tempo:latest
ports:
- "3200:3200"
command: -config.file=/etc/tempo/tempo.yaml
volumes:
- ./tempo.yaml:/etc/tempo/tempo.yaml
If you find this MCP server useful, consider leaving a ⭐ on the GitHub repository!
Content type
Image
Digest
sha256:5880cb1a5…
Size
82.1 MB
Last updated
3 months ago
docker pull talkopsai/tempo-mcp-server