Back to MCP Servers

Opentelemetry Mcp Server.git

🐍🏠 - An MCP server for connecting to any OpenTelemetry backend (Datadog, Grafana, Dynatrace, Traceloop, etc.).

finance-fintech
By traceloop
19522Updated 2 weeks agoPythonApache-2.0

Installation

npx -y opentelemetry-mcp-server.git

Configuration

{
  "mcpServers": {
    "opentelemetry-mcp-server.git": {
      "command": "npx",
      "args": ["-y", "opentelemetry-mcp-server.git"]
    }
  }
}

How to use

  1. Run the installation command above (if needed)
  2. Open your Claude Code settings file (~/.claude/settings.json)
  3. Add the configuration to the mcpServers section
  4. Restart Claude Code to apply changes

OpenTelemetry MCP Server

Python 3.11+ PyPI License

Query and analyze LLM traces with AI assistance. Ask Claude to find expensive API calls, debug errors, compare model performance, or track token usageβ€”all from your IDE.

An MCP (Model Context Protocol) server that connects AI assistants to OpenTelemetry trace backends (Jaeger, Tempo, Traceloop), with specialized support for LLM observability through OpenLLMetry semantic conventions.

See it in action:

https://github.com/user-attachments/assets/e2106ef9-0a58-4ba0-8b2b-e114c0b8b4b9


Table of Contents


Quick Start

No installation required! Configure your client to run the server directly from PyPI:

// Add to claude_desktop_config.json:
{
  "mcpServers": {
    "opentelemetry-mcp": {
      "command": "pipx",
      "args": ["run", "opentelemetry-mcp"],
      "env": {
        "BACKEND_TYPE": "jaeger",
        "BACKEND_URL": "http://localhost:16686"
      }
    }
  }
}

Or use uvx (alternative):

{
  "mcpServers": {
    "opentelemetry-mcp": {
      "command": "uvx",
      "args": ["opentelemetry-mcp"],
      "env": {
        "BACKEND_TYPE": "jaeger",
        "BACKEND_URL": "http://localhost:16686"
      }
    }
  }
}

That's it! Ask Claude: "Show me traces with errors from the last hour"


Installation

For End Users (Recommended)

# Run without installing (recommended)
pipx run opentelemetry-mcp --backend jaeger --url http://localhost:16686

# Or with uvx
uvx opentelemetry-mcp --backend jaeger --url http://localhost:16686

This approach:

  • βœ… Always uses the latest version
  • βœ… No global installation needed
  • βœ… Isolated environment automatically
  • βœ… Works on all platforms

Per Client Integration

<details> <summary><b>Claude Desktop</b></summary>

Configure the MCP server in your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Using pipx (recommended):

{
  "mcpServers": {
    "opentelemetry-mcp": {
      "command": "pipx",
      "args": ["run", "opentelemetry-mcp"],
      "env": {
        "BACKEND_TYPE": "jaeger",
        "BACKEND_URL": "http://localhost:16686"
      }
    }
  }
}

Using uvx (alternative):

{
  "mcpServers": {
    "opentelemetry-mcp": {
      "command": "uvx",
      "args": ["opentelemetry-mcp"],
      "env": {
        "BACKEND_TYPE": "jaeger",
        "BACKEND_URL": "http://localhost:16686"
      }
    }
  }
}

For Traceloop backend:

{
  "mcpServers": {
    "opentelemetry-mcp": {
      "command": "pipx",
      "args": ["run", "opentelemetry-mcp"],
      "env": {
        "BACKEND_TYPE": "traceloop",
        "BACKEND_URL": "https://api.traceloop.com",
        "BACKEND_API_KEY": "your_traceloop_api_key_here"
      }
    }
  }
}
<details> <summary>Using the repository instead of pipx?</summary>

If you're developing locally with the cloned repository, use one of these configurations:

Option 1: Wrapper script (easy backend switching)

{
  "mcpServers": {
    "opentelemetry-mcp": {
      "command": "/absolute/path/to/opentelemetry-mcp-server/start_locally.sh"
    }
  }
}

Option 2: UV directly (for multiple backends)

{
  "mcpServers": {
    "opentelemetry-mcp-jaeger": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/opentelemetry-mcp-server",
        "run",
        "opentelemetry-mcp"
      ],
      "env": {
        "BACKEND_TYPE": "jaeger",
        "BACKEND_URL": "http://localhost:16686"
      }
    }
  }
}
</details> </details> <details> <summary><b>Claude Code</b></summary>

Claude Code works with MCP servers configured in your Claude Desktop config. Once configured above, you can use the server with Claude Code CLI:

# Verify the server is available
claude-code mcp list

# Use Claude Code with access to your OpenTelemetry traces
claude-code "Show me traces with errors from the last hour"
</details> <details> <summary><b>Codeium (Windsurf)</b></summary>
  1. Open Windsurf
  2. Navigate to Settings β†’ MCP Servers
  3. Click Add New MCP Server
  4. Add this configuration:

Using pipx (recommended):

{
  "opentelemetry-mcp": {
    "command": "pipx",
    "args": ["run", "opentelemetry-mcp"],
    "env": {
      "BACKEND_TYPE": "jaeger",
      "BACKEND_URL": "http://localhost:16686"
    }
  }
}

Using uvx (alternative):

{
  "opentelemetry-mcp": {
    "command": "uvx",
    "args": ["opentelemetry-mcp"],
    "env": {
      "BACKEND_TYPE": "jaeger",
      "BACKEND_URL": "http://localhost:16686"
    }
  }
}
<details> <summary>Using the repository instead?</summary>
{
  "opentelemetry-mcp": {
    "command": "uv",
    "args": [
      "--directory",
      "/absolute/path/to/opentelemetry-mcp-server",
      "run",
      "opentelemetry-mcp"
    ],
    "env": {
      "BACKEND_TYPE": "jaeger",
      "BACKEND_URL": "http://localhost:16686"
    }
  }
}
</details> </details> <details> <summary><b>Cursor</b></summary>
  1. Open Cursor
  2. Navigate to Settings β†’ MCP
  3. Click Add new MCP Server
  4. Add this configuration:

Using pipx (recommended):

{
  "opentelemetry-mcp": {
    "command": "pipx",
    "args": ["run", "opentelemetry-mcp"],
    "env": {
      "BACKEND_TYPE": "jaeger",
      "BACKEND_URL": "http://localhost:16686"
    }
  }
}

Using uvx (alternative):

{
  "opentelemetry-mcp": {
    "command": "uvx",
    "args": ["opentelemetry-mcp"],
    "env": {
      "BACKEND_TYPE": "jaeger",
      "BACKEND_URL": "http://localhost:16686"
    }
  }
}
<details> <summary>Using the repository instead of pipx?</summary>
{
  "opentelemetry-mcp": {
    "command": "uv",
    "args": [
      "--directory",
      "/absolute/path/to/opentelemetry-mcp-server",
      "run",
      "opentelemetry-mcp"
    ],
    "env": {
      "BACKEND_TYPE": "jaeger",
      "BACKEND_URL": "http://localhost:16686"
    }
  }
}
</details> </details> <details> <summary><b>Gemini CLI</b></summary>

Configure the MCP server in your Gemini CLI config file (~/.gemini/config.json):

Using pipx (recommended):

{
  "mcpServers": {
    "opentelemetry-mcp": {
      "command": "pipx",
      "args": ["run", "opentelemetry-mcp"],
      "env": {
        "BACKEND_TYPE": "jaeger",
        "BACKEND_URL": "http://localhost:16686"
      }
    }
  }
}

Using uvx (alternative):

{
  "mcpServers": {
    "opentelemetry-mcp": {
      "command": "uvx",
      "args": ["opentelemetry-mcp"],
      "env": {
        "BACKEND_TYPE": "jaeger",
        "BACKEND_URL": "http://localhost:16686"
      }
    }
  }
}

Then use Gemini CLI with your traces:

gemini "Analyze token usage for gpt-4 requests today"
<details> <parameter name="name">Using the repository instead?</summary>
{
  "mcpServers": {
    "opentelemetry-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/opentelemetry-mcp-server",
        "run",
        "opentelemetry-mcp"
      ],
      "env": {
        "BACKEND_TYPE": "jaeger",
        "BACKEND_URL": "http://localhost:16686"
      }
    }
  }
}
</details> </details>

Prerequisites:

  • Python 3.11 or higher
  • pipx or uv installed
<details> <summary><b>Optional: Install globally</b></summary>

If you prefer to install the command globally:

# Install with pipx
pipx install opentelemetry-mcp

# Verify
opentelemetry-mcp --help

# Upgrade
pipx upgrade opentelemetry-mcp

Or with pip:

pip install opentelemetry-mcp
</details>

Features

Core Capabilities

  • πŸ”Œ Multiple Backend Support - Connect to Jaeger, Grafana Tempo, or Traceloop
  • πŸ€– LLM-First Design - Specialized tools for analyzing AI application traces
  • πŸ” Advanced Filtering - Generic filter system with powerful operators
  • πŸ“Š Token Analytics - Track and aggregate LLM token usage across models and services
  • ⚑ Fast & Type-Safe - Built with async Python and Pydantic validation

Tools

ToolDescriptionUse Case
search_tracesSearch traces with advanced filtersFind specific requests or patterns
search_spansSearch individual spansAnalyze specific operations
get_traceGet complete trace detailsDeep-dive into a single trace
get_llm_usageAggregate token usage metricsTrack costs and usage trends
list_servicesList available servicesDiscover what's instrumented
find_errorsFind traces with errorsDebug failures quickly
list_llm_modelsDiscover models in useTrack model adoption
get_llm_model_statsGet model performance statsCompare model efficiency
get_llm_expensive_tracesFind highest token usageOptimize costs
get_llm_slow_tracesFind slowest operationsImprove performance

Backend Support Matrix

FeatureJaegerTempoTraceloop
Search tracesβœ“βœ“βœ“
Advanced filtersβœ“βœ“βœ“
Span searchβœ“*βœ“βœ“
Token trackingβœ“βœ“βœ“
Error tracesβœ“βœ“βœ“
LLM toolsβœ“βœ“βœ“

<sub>* Jaeger requires service_name parameter for span search</sub>

For Developers

If you're contributing to the project or want to make local modifications:

# Clone the repository
git clone https://github.com/traceloop/opentelemetry-mcp-server.git
cd opentelemetry-mcp-server

# Install dependencies with UV
uv sync

# Or install in development mode with editable install
uv pip install -e ".[dev]"

Configuration

Supported Backends

BackendTypeURL ExampleNotes
JaegerLocalhttp://localhost:16686Popular open-source option
TempoLocal/Cloudhttp://localhost:3200Grafana's trace backend
TraceloopCloudhttps://api.traceloop.comRequires API key

Quick Configuration

Option 1: Environment Variables (Create .env file - see .env.example)

BACKEND_TYPE=jaeger
BACKEND_URL=http://localhost:16686

Option 2: CLI Arguments (Override environment)

opentelemetry-mcp --backend jaeger --url http://localhost:16686
opentelemetry-mcp --backend traceloop --url https://api.traceloop.com --api-key YOUR_KEY

Configuration Precedence: CLI arguments > Environment variables > Defaults

<details> <summary><b>All Configuration

…

View source on GitHub