Tempo MCP server
The Tempo MCP Server is a Model Context Protocol server for distributed tracing and microservice root-cause analysis with Grafana Tempo. It exposes 16 tools, 11 tempo:// resources, and 5 guided tracing prompts supporting TraceQL search, critical-path waterfall summarization (application/vnd.grafana.llm), TraceQL RED metrics, service dependency graphs, and log-to-trace / metric-to-trace cross-pillar pivots.
Search traces by TraceQL or Kubernetes filters, extract critical paths, diff traces across 5 dimensions, and query TraceQL RED metrics.
Inspect Tempo backends (tempo://system/backends), TraceQL syntax references, and canonical K8s-to-OTel attribute mappings.
Step-by-step runbooks for P99 latency investigation, microservice error triage, and trace-driven alerting rule synthesis.
Configure single or multi-backend Tempo endpoints, X-Scope-OrgID tenancy headers, and search lookback guardrails.
Core capabilities
| Capability Domain | What the Server Provides |
|---|---|
| TraceQL Search & K8s Mapping | Translates Kubernetes metadata (namespace, service, deployment, pod) into canonical OpenTelemetry TraceQL attributes with enforced time bounds and result limits. |
| Critical-Path Summarization | Negotiates Tempo 2.9+ LLM format (application/vnd.grafana.llm), extracts the synchronous critical path, isolates root-cause error spans, and performs time-gap analysis. |
| TraceQL RED Metrics | Executes instant and range TraceQL metric queries (rate(), count_over_time(), quantile_over_time()) to evaluate request rate, error rate, and P95/P99 latency trends before fetching individual traces. |
| Cross-Pillar Correlation | Pivots directly from Loki log lines containing trace IDs (tempo_get_trace_from_log) or extracts exemplar trace IDs from metric spikes (tempo_get_exemplar_traces). |
| Service Topology & Diagnostics | Maps live service dependency graphs from Tempo metrics-generator series and inspects Tempo ring members, ingesters, and compactors. |
Position in the TalkOps observability stack
Architecture
Tool summary
| Tool | Category | Description |
|---|---|---|
tempo_traceql_search | Search | Search traces using raw TraceQL or structured Kubernetes service/duration/status filters |
tempo_get_trace | Retrieval | Retrieve a single trace by ID in LLM-optimized waterfall format |
tempo_summarize_trace | Analysis | Extract critical path latency breakdown, root-cause error spans, and unexplained time gaps |
tempo_compare_traces | Analysis | Compare baseline vs. degraded traces across span count, duration, errors, attributes, and critical path |
tempo_find_related_traces | Correlation | Find correlated traces via same_service_errors, same_endpoint, or temporal_neighbors |
tempo_traceql_metrics_range | Metrics | Execute TraceQL metric range queries for RED trends and SLO evaluation |
tempo_traceql_metrics_instant | Metrics | Execute instant TraceQL metric snapshots |
tempo_get_exemplar_traces | Pivots | Extract exemplar trace IDs from TraceQL metric spikes |
tempo_get_trace_from_log | Pivots | Parse a trace ID from a log message and return the summarized trace |
tempo_get_service_dependencies | Topology | Map live service dependency graphs with per-edge call rates and error percentages |
tempo_get_attribute_names | Schema | Discover indexed attribute names across resource, span, and intrinsic scopes |
tempo_get_attribute_values | Schema | Enumerate distinct values for a trace attribute |
tempo_get_k8s_attribute_map | Schema | Return canonical mapping between Kubernetes labels and OTel trace attributes |
tempo_list_backends | Diagnostics | List configured Tempo backends with health status |
tempo_get_diagnostics | Diagnostics | Inspect Tempo backend build info, ring status, and component health |
tempo_generate_alerting_expression | Alerting | Generate PromQL alerting rules from observed trace latency or error patterns |
Quickstart
Point TEMPO_BASE_URL to your Grafana Tempo query-frontend or distributor endpoint:
docker run --rm -it \
-p 8768:8768 \
-e MCP_TRANSPORT=http \
-e TEMPO_BASE_URL=http://tempo.monitoring:3200 \
talkopsai/tempo-mcp-server:latest
Register the HTTP endpoint or launch via uvx over stdio:
{
"mcpServers": {
"tempo": {
"url": "http://localhost:8768/mcp",
"description": "TalkOps Tempo MCP Server for Distributed Tracing"
}
}
}
Security and payload guardrails
- LLM context protection: Enforces
TEMPO_MAX_SEARCH_LIMIT=100and compresses multi-megabyte OTLP span trees into concise critical-path summaries so raw traces never overflow the agent's context window. - Multi-tenant isolation: Configure
TEMPO_MULTI_TENANT=trueandTEMPO_DEFAULT_TENANTto scope all queries withX-Scope-OrgID.