otel-mcp
Provides tools for querying and analyzing OpenTelemetry traces, allowing AI agents to list recent traces, get span trees, search spans, and get service summaries.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@otel-mcpshow me recent traces with errors"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
otel-mcp
MCP server that gives AI agents access to your application's OpenTelemetry traces.
Agent calls: list_traces { has_errors: true }
Recent Traces (2 of 847)
TRACE ID SERVICE DURATION SPANS ERRORS ROOT
a]b7f2e9d4c8 checkout-api 2.34s 12 1 POST /checkout
f3e1a8b2c6d9 checkout-api 1.87s 8 1 POST /checkout
Agent calls: get_trace { trace_id: "a]b7f2e9d4c8" }
Trace ab7f2e9d4c8
Services: checkout-api, inventory-service, postgres
Duration: 2.34s
Spans: 12, 1 error
SPAN TREE
----------------------------------------------------------------
[2.34s] POST /checkout
[1.92s] OrderService.create
[1.87s] InventoryService.reserve ← HTTP 500
[45ms] POST inventory-service/reserve
[23ms] pg.query SELECT * FROM products...
[412ms] PaymentService.charge
[401ms] stripe.charges.createThe agent can query traces, find errors, identify slow operations - without you copying logs into chat.
Why This Exists
AI agents can read code, but they can't see how it executes. When debugging locally, you end up checking traces yourself and explaining what you found. That's the bottleneck.
otel-mcp removes that step by letting agents query execution data directly.
Read more:
How to Give AI Agents Access to Runtime Traces — practical guide
Why AI Development Tools Must Be Execution-Aware — the design principle
Related MCP server: trazabilidad-mcp
Architecture
flowchart LR
subgraph app["Your Application"]
OTel["OpenTelemetry SDK"]
end
subgraph otel-mcp
Receiver["OTLP Receiver\n/v1/traces"]
Store[("Trace Store\n(in-memory)")]
MCP["MCP Server\n(stdio)"]
HTTP["HTTP API\n/mcp/*"]
end
subgraph client["Client Mode"]
MCP2["MCP Server\n(stdio)"]
end
Agent["AI Agent\n(Claude, Cursor)"]
OTel -->|"OTLP/HTTP\n:4318"| Receiver
Receiver --> Store
Store --> MCP
Store --> HTTP
MCP <-->|"MCP protocol"| Agent
HTTP <-->|"HTTP proxy"| MCP2
MCP2 <-->|"MCP protocol"| AgentPrimary mode: First instance runs the OTLP receiver and MCP server. Traces are stored in memory with LRU eviction.
Client mode: Additional instances detect the primary via health check and proxy MCP tool calls over HTTP. Multiple AI agents can share the same trace data.
Quick Start
Prerequisites: Node.js 18+
1. Add to your MCP client
Go to Cursor Settings → MCP → Add new global MCP server and paste:
{
"mcpServers": {
"otel": { "command": "npx", "args": ["otel-mcp"] }
}
}Or add to ~/.cursor/mcp.json directly.
claude mcp add otel -- npx otel-mcpAdd to your MCP config:
{
"mcpServers": {
"otel": { "command": "npx", "args": ["otel-mcp"] }
}
}2. Try it out
Run the example app to generate test traces:
# Clone and run example
git clone https://github.com/moondef/otel-mcp.git
cd otel-mcp/examples/node-app
npm install && npm startThen ask your AI agent: "Show me recent traces" or "Are there any errors?"
3. Instrument your app
Point your OpenTelemetry exporter at http://localhost:4318/v1/traces:
import { NodeSDK } from '@opentelemetry/sdk-node';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
const sdk = new NodeSDK({
traceExporter: new OTLPTraceExporter({
url: 'http://localhost:4318/v1/traces',
}),
instrumentations: [getNodeAutoInstrumentations()],
});
sdk.start();from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
exporter = OTLPSpanExporter(endpoint="http://localhost:4318/v1/traces")OpenTelemetry is a standard for collecting traces from applications. A trace shows the path of a request through your system - which functions ran, how long each took, what failed.
Getting started: Node.js · Python · Go · Java
Tools
Tool | Description |
| List recent traces. Filter by |
| Get span tree for a trace ID (prefix match supported). |
| Search spans with |
| Service overview with trace counts and recent errors. |
| Clear all collected traces. |
Multiple sessions
Multiple MCP clients share the same traces. First instance runs the collector on port 4318, others connect to it. Filter by service to focus on specific apps.
Configuration
Variable | Default | Description |
| 4318 | Collector port |
| 1000 | Max traces to retain |
| 10000 | Max spans to retain |
License
MIT
Available Tools
5 toolsclear_tracesClear TracesA
Clear all collected traces from memory. Useful for starting fresh between test runs or debugging sessions. Returns count of cleared traces.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses that it destroys collected traces (destructive, consistent with readOnlyHint=false) and returns a count of cleared traces, adding value beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences, front-loaded with the primary action. Every word adds value with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a parameterless tool with no output schema, the description completely explains purpose, usage context, and return value. No gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist so schema coverage is 100%. The description doesn't need to add param info; however, it could be scored 4 as baseline for zero parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Clear all collected traces from memory'. The verb 'clear' and resource 'traces' are specific and distinct from sibling tools that get, list, or query traces.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit use cases: 'Useful for starting fresh between test runs or debugging sessions'. This directly tells when to use this tool versus the siblings which are for inspection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_summaryGet SummaryARead-only
Get an overview of all collected trace data. Shows total traces and spans, list of services, and recent errors. Good starting point to understand what data is available.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, so the description adds value by specifying the output content (traces, spans, services, errors). No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no waste. Front-loaded with purpose and list of outputs. Highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Sufficiently describes the return values without output schema. Covers key elements (traces, spans, services, errors). Could mention scope or limits but adequate for an overview tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There are zero parameters, so schema coverage is 100%. The description adds meaning by explaining what the tool returns, exceeding the baseline expectation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool provides an overview of trace data listing total traces/spans, services, and errors. It distinguishes from siblings by being the 'starting point' but does not explicitly name alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies use as a starting point to understand available data, but provides no explicit guidance on when not to use it or how it compares to siblings like list_traces or get_trace.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_traceGet Trace DetailsARead-only
Get the detailed span tree for a specific trace. Shows the hierarchy of operations, their timing, and optionally their attributes. Use this to understand the full request flow and identify where time is spent.
| Name | Required | Description | Default |
|---|---|---|---|
| trace_id | Yes | Full or prefix trace ID (min 6 chars) | |
| show_attributes | No | Include span attributes (default: false) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true. Description adds behavioral context by describing what the span tree includes (hierarchy, timing, attributes), which aids understanding beyond the annotation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with the main action, followed by usage guidance. No superfluous words; every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema, but description explains the output sufficiently (span tree, hierarchy, timing, optionally attributes). For a tool with two well-documented parameters and good annotations, this is nearly complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. Description hints at the 'show_attributes' parameter ('optionally their attributes') but does not add substantial meaning beyond the schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states it gets the detailed span tree for a specific trace, describing the output (hierarchy, timing, optionally attributes). Purpose is specific and distinct from siblings, though not explicitly contrasted.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides a use case ('understand the full request flow and identify where time is spent'), but lacks when-not-to-use guidance or explicit alternatives among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_tracesList TracesARead-only
List recent traces from the application. Use this to get an overview of recent requests, find errors, or identify slow operations. Returns a table of traces with their duration, span count, and error count.
| Name | Required | Description | Default |
|---|---|---|---|
| service | No | Filter by service name | |
| has_errors | No | Only traces with errors | |
| min_duration_ms | No | Minimum duration in milliseconds | |
| since_minutes | No | Only traces from last N minutes (default: 30) | |
| since | No | ISO timestamp - only traces after this time (overrides since_minutes) | |
| limit | No | Max results (default: 20, max: 100) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, so no contradiction. Description adds context about recent time range and output format (table with duration, span count, error count), but not deep behavioral details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences, no wasted words, front-loaded with the core action.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only list tool with well-documented parameters and no output schema, the description covers purpose, usage, and output format adequately. Could mention pagination or sorting but not required for basic completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for all 6 parameters. Description does not add extra meaning beyond schema; baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('List recent traces') and the resource ('traces'), and distinguishes from siblings like clear_traces, get_trace, and query_spans through different verbs and purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit guidance on when to use ('get an overview', 'find errors', 'identify slow operations'), but does not cover exclusions or alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
query_spansQuery SpansARead-only
Search for specific spans across all traces. Use this to find patterns like slow database queries, failed HTTP calls, or specific operations by name. More targeted than list_traces when looking for specific operation types.
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Span name contains (case-insensitive) | |
| service | No | Service name | |
| min_duration_ms | No | Minimum duration in milliseconds | |
| has_error | No | Only error spans | |
| attribute | No | Attribute filter: "key=value" or "key" (exists) | |
| where | No | Expression filter. Examples: "duration > 100", "status = error", "http.status_code >= 400", "duration > 50 AND status = error" | |
| since_minutes | No | Time filter (default: 30) | |
| limit | No | Max results (default: 50, max: 200) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, so the description's mention of 'search' is consistent but adds no behavioral context beyond that. No details on pagination, coverage, or edge cases.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with action and examples. Every word adds value, no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Adequate for a query tool with well-documented parameters, but lacks mention of output format or fields returned. Sibling tools provide context but description could be more complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so each parameter is already well-documented. The description does not add parameter-specific details beyond the schema, but it reinforces the intended use.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Specifically states the verb 'Search' and resource 'specific spans across all traces', with concrete examples (slow database queries, failed HTTP calls). Distinguishes from sibling tool list_traces by saying it is 'more targeted'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use this tool: 'to find patterns like slow database queries, failed HTTP calls, or specific operations by name'. Directly contrasts with sibling list_traces, providing clear guidance on which to choose.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a distinct purpose: clearing traces, getting summary, retrieving a specific trace, listing traces, and searching spans. No overlap or ambiguity.
All tool names follow a consistent verb_noun pattern in snake_case: clear_traces, get_summary, get_trace, list_traces, query_spans.
With 5 tools covering the main operations for trace data (list, get, query, clear, summary), the count is well-scoped for a focused OTEL tracing server.
Covers essential tasks like listing, retrieving, searching, clearing, and summarizing traces. Missing individual trace deletion or export, but minor gap given the server's scope.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP observability. Query live traffic, errors, duration, and alerts from your AI agent.
Cloud hosted Okahu MCP server that helps you manage genAI trace data
MCP server for building and testing AI agents with multi-model experimentation and insights.
Query application logs, traces, and metrics from your AI coding assistant via Foam's MCP server.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that instruments Cursor AI agent interactions with OpenTelemetry traces and logs to monitor agent turns and performance. It enables tracking of user queries, assistant responses, and tool usage through GenAI-compliant telemetry spans.MIT
- FlicenseNot gradedqualityBmaintenanceMCP server that exposes code tracing capabilities including journey flows, HTTP seams, and findings from indexed projects, allowing AI assistants to query software architecture.
- AlicenseNot gradedqualityBmaintenanceAn MCP server that enables AI assistants to query and explore your OpenObserve observability data. Provides read-only access to logs, metrics, and traces for analysis and troubleshooting.5MIT
- AlicenseAqualityBmaintenanceMCP server for AI agent observability, providing trace and span logging, search, latency/tokens/cost metrics, and anomaly detection using an in-memory buffer.638MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/moondef/otel-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server