Otel

by studiomeyer-io

236 downloads
Not rated
GitHub Website

About

W3C Trace Context bridge for the Model Context Protocol — propagate traces through MCP _meta (SEP-414) and emit OpenTelemetry spans so Host → MCP server → tool → downstream shows up as one trace.

Details

Author
studiomeyer-io
Downloads
236

- reads traceparent / tracestate / baggage from the caller's _meta
- starts a SERVER span named tools/call <toolName> as a child of the caller's span
- runs your handler with that span active (via the OTel context)
- ends the span with OK / ERROR status and records thrown exceptions
- host.chat-turn [INTERNAL]

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Otel
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Follow the repository README to install the server and add its MCP configuration to your client.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "otel": {
            "mcp-otel": {
                "command": "docker",
                "args": [
                    "run",
                    "-d",
                    "--name",
                    "jaeger",
                    "\\"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-otel": {
        "command": "docker",
        "args": [
            "run",
            "-d",
            "--name",
            "jaeger",
            "\\"
        ]
    }
}

mcp-otel

W3C Trace Context bridge for the Model Context Protocol. It propagates trace context through MCP's _meta field and emits OpenTelemetry spans, so a request flowing Host → MCP server → tool → downstream HTTP shows up as one connected trace in Jaeger, Tempo, Honeycomb, or Datadog.

npm
CI
OpenSSF Scorecard
License: MIT

---

Why this exists

The MCP release candidate of 2026-07-28 nailed down distributed tracing for MCP:

- SEP-414 reserves the unprefixed _meta keys traceparent, tracestate, and baggage for W3C Trace Context and W3C Baggage. These keys ride along in params._meta of every request, and MCP transports must pass them through untouched.
- SEP-2577 deprecated MCP's logging capability and pointed at OpenTelemetry as the observability path going forward.

Spec post: <https://blog.modelcontextprotocol.io/posts/2026-07-28-release-candidate/>

So the protocol now says where the trace context lives and which telemetry system to use — but there was no small library that does the actual plumbing: read the caller's context out of _meta, start a correctly-parented OpenTelemetry span for the tool call, and let your downstream calls hang off it. That's all mcp-otel is.

It is deliberately thin. It does not configure OpenTelemetry for you, ship an exporter, or hide your tracer. You keep full control of sampling, resources, and exporters; mcp-otel only bridges _meta ↔ spans.

Install

```bash
npm install mcp-otel @opentelemetry/api

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.