官方说明OpenTelemetry MCP Server 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.
配置模板(请按你的客户端调整)
claude mcp add opentelemetry-mcp-server -- npx -y opentelemetry-mcp-server
**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 - Installation - Features - Configuration - Tools Reference - Example Queries - Common Workflows - Troubleshooting - Development - Support --- Quick Start **No installation required!** Configure your client to run the server directly from PyPI: Or use uvx (alternative): **That's it!** Ask Claude: _"Show me traces with errors from the last hour"_ --- Installation For End Users (Recommended) This approach: - ✅ Always uses the latest version - ✅ No global installation needed - ✅ Isolated environment automatically - ✅ Works on all platforms Per Client Integration Claude Desktop 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):** **Using uvx (alternative):** **For Traceloop backend:** Using the repository instead of pipx? If you're developing locally with the cloned repository, use one of these configurations: **Option 1: Wrapper script (easy backend switching)** **Option 2: UV directly (for multiple backends)** Claude Code Claude Code works with MCP servers configured in your Claude Desktop config. Once configured above, you can use the server with Claude Code CLI: Codeium (Windsurf) 1. Open Windsurf 2. Navigate to **Settings → MCP Servers** 3. Click **Add New MCP Server** 4. Add this configuration: **Using pipx (recommended):** **Using uvx (alternative):** Using the repository instead? Cursor 1. Open Cursor 2. Navigate to **Settings → MCP** 3. Click **Add new MCP Server** 4. Add this configuration: **Using pipx (recommended):** **Using uvx (alternative):** Using the repository instead of pipx? Gemini CLI Configure the MCP server in your Gemini CLI config file (~/.gemini/config.json): **Using pipx (recommended):** **Using uvx (alternative):** Then use Gemini CLI with your traces: Using the repository instead? **_Prerequisites:_** - Python 3.11 or higher - pipx or uv installed Optional: Install globally If you prefer to install the command globally: Or with pip: 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 | Tool | Description | Use Case | | -------------------------- | ----------------------------------- | ---------------------------------- | | search_traces | Search traces with advanced filters | Find specific requests or patterns | | search_spans | Search individual spans | Analyze specific operations | | get_trace | Get complete trace details | Deep-dive into a single trace | | get_llm_usage | Aggregate token usage metrics | Track costs and usage trends | | list_services | List available services | Discover what's instrumented | | find_errors | Find traces with errors | Debug failures quickly | | list_llm_models | Discover models in use | Track model adoption | | get_llm_model_stats | Get model performance stats | Compare model efficiency | | get_llm_expensive_traces | Find highest token usage | Optimize costs |