Tempo MCP Server

by gigapipehq

Not rated
GitHub

About

An MCP server for querying distributed tracing data from Grafana Tempo.

Details

Author
gigapipehq
Categories
Developer Tools, Infrastructure, Other

Setup

Install Tempo MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/gigapipehq/gigapipe-traces-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

An MCP server for querying distributed tracing data from Grafana Tempo.

A Go-based server implementation for the Model Context Protocol (MCP) with Grafana Tempo integration.

This MCP server allows AI assistants to query and analyze distributed tracing data from Grafana Tempo. It follows the Model Context Protocol to provide tool definitions that can be used by compatible AI clients such as Claude Desktop.

- Go 1.21 or higher
- Docker and Docker Compose (for local testing)

# Build the server go build -o tempo-mcp-server ./cmd/server # Run the server ./tempo-mcp-server

The server now supports two modes of communication:
- Standard input/output (stdin/stdout) following the Model Context Protocol (MCP)
- HTTP Server with Server-Sent Events (SSE) endpoint for integration with tools like n8n

The default port for the HTTP server is 8080, but can be configured using theSSE_PORTenvironment variable.

When running in HTTP mode, the server exposes the following endpoints:

- SSE Endpoint:http://localhost:8080/sse- For real-time event streaming
- MCP Endpoint:http://localhost:8080/mcp- For MCP protocol messaging

You can build and run the MCP server using Docker:

# Build the Docker image docker build -t tempo-mcp-server . # Run the server docker run -p 8080:8080 --rm -i tempo-mcp-server

Alternatively, you can use Docker Compose for a complete test environment:

# Build and run with Docker Compose docker-compose up --build
. ├── cmd/ │ ├── server/ # MCP server implementation │ └── client/ # Client for testing the MCP server ├── internal/ │ └── handlers/ # Tool handlers ├── pkg/ │ └── utils/ # Utility functions and shared code └── go.mod # Go module definition

The Tempo MCP Server implements the Model Context Protocol (MCP) and provides the following tools:

Thetempo_querytool allows you to query Grafana Tempo trace data:

- Required parameters:

- query: Tempo query string (e.g.,{service.name="frontend"},{duration>1s})

- url: The Tempo server URL (default: from TEMPO_URL environment variable orhttp://localhost:3200)
- start: Start time for the query (default: 1h ago)
- end: End time for the query (default: now)
- limit: Maximum number of traces to return (default: 20)
- username: Username for basic authentication (optional)
- password: Password for basic authentication (optional)
- token: Bearer token for authentication (optional)

The Tempo query tool supports the following environment variables:

- TEMPO_URL: Default Tempo server URL to use if not specified in the request
- SSE_PORT: Port for the HTTP/SSE server (default: 8080)

./run-client.sh tempo_query "{resource.service.name=\\\"example-service\\\"}"

You can use this MCP server with Claude Desktop to add Tempo query tools. Follow these steps:
- Build the server or Docker image
- Configure Claude Desktop to use the server by adding it to your Claude Desktop configuration file

{ "mcpServers": { "temposerver": { "command": "path/to/tempo-mcp-server", "args": [], "env": { "TEMPO_URL": "http://localhost:3200" }, "disabled": false, "autoApprove": ["tempo_query"] } } }
{ "mcpServers": { "temposerver": { "command": "docker", "args": ["run", "--rm", "-i", "-e", "TEMPO_URL=http://host.docker.internal:3200", "tempo-mcp-server"], "disabled": false, "autoApprove": ["tempo_query"] } } }

The Claude Desktop configuration file is located at:

- On macOS:~/Library/Application Support/Claude/claude_desktop_config.json
- On Windows:%APPDATA%\Claude\claude_desktop_config.json
- On Linux:~/.config/Claude/claude_desktop_config.json

You can also integrate the Tempo MCP server with the Cursor editor. To do this, add the following configuration to your Cursor settings:

{ "mcpServers": { "tempo-mcp-server": { "command": "docker", "args": ["run", "--rm", "-i", "-e", "TEMPO_URL=http://host.docker.internal:3200", "tempo-mcp-server:latest"] } } }

To use the Tempo MCP server with n8n, you can connect to it using the MCP Client Tool node:
-

Add anMCP Client Toolnode to your n8n workflow

Configure the node with these parameters:

- SSE Endpoint:http://your-server-address:8080/sse(replace with your actual server address)
- Authentication: Choose appropriate authentication if needed
- Tools to Include: Choose which Tempo tools to expose to the AI Agent

Connect the MCP Client Tool node to an AI Agent node that will use the Tempo querying capabilities

Example workflow: Trigger → MCP Client Tool (Tempo server) → AI Agent (Claude)

Once configured, you can use the tools in Claude with queries like:

- "Query Tempo for traces with the query{duration>1s}"
- "Find traces from the frontend service in Tempo using query{service.name=\"frontend\"}"
- "Show me the most recent 50 traces from Tempo with{http.status_code=500}"

This project is licensed under the MIT License.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Access and manage Grafana resources, including dashboards, datasources, Prometheus, Loki, and alerting.

A server for querying Loki logs from Grafana.

An MCP server for log analysis using the LogAI framework, with optional Grafana and GitHub integrations.

A Go-based server to query Grafana Loki logs using the Model Context Protocol (MCP).

An MCP server for querying Loki logs via logcli.

Access Grafana resources like dashboards, datasources, Prometheus, Loki, and alerts.

MCP server for Grafana — manage dashboards, datasources, alerts, folders, and annotations over stdio

Search dashboards, investigate incidents and query datasources in your Grafana instance

Seamlessly bring real-time production context—logs, metrics, and traces—into your local environment to auto-fix code faster.

Provides access to OpenTelemetry traces and metrics through Logfire.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.