Otel MCP Server

Official Fastify OpenTelemetry Instrumentation

Local serverstdio

What is the Otel MCP server?

Connect Otel to Claude, Cursor or any other MCP client and it stops being a tab you switch to. Official Fastify OpenTelemetry Instrumentation. The otel mcp server is what makes that connection.

What the server does

@fastify/otel works as a metric creator as well as application performance monitor for your Fastify application.

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • onRequest — preParsing
  • preValidation — preHandler
  • preSerialization — onSend
  • onResponse — onError
  • FastifyOtelRequestContext — The FastifyOtelRequestContext is a wrapper around the OpenTelemetry Context and Tracer APIs. It also provides a way to manage the context of a
  • FastifyOtelInstrumentationOptions — The FastifyOtelInstrumentationOptions tool exposed by this server
  • Examples — const fastifyOtelInstrumentation = new FastifyOtelInstrumentation({ registerOnInitialization: true, ignorePaths: (opts) => { // Ignore all paths that

Installation

@fastify/otel on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Credentials and setup notes

Configuration is passed through the environment: OTEL_SERVICE_NAME. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Where it fits

Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Otel's toolset — onRequest, preValidation, preSerialization and 4 more — is a fair guide to whether it matches your workflow. It is maintained by climba03003; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
onRequestpreParsing
preValidationpreHandler
preSerializationonSend
onResponseonError
FastifyOtelRequestContextThe FastifyOtelRequestContext is a wrapper around the OpenTelemetry Context and Tracer APIs. It also provides a way to manage the context of a request and its associated spans as well as some utilities to extract and inj
FastifyOtelInstrumentationOptionsThe FastifyOtelInstrumentationOptions tool exposed by this server.
Examplesconst fastifyOtelInstrumentation = new FastifyOtelInstrumentation({ registerOnInitialization: true, ignorePaths: (opts) => { // Ignore all paths that start with /ignore return opts.url.startsWith('/ignore'); }, });

How to install the Otel MCP server

{
  "mcpServers": {
    "otel": {
      "command": "npx",
      "args": ["-y", "@fastify/otel"],
      "env": {
        "OTEL_SERVICE_NAME": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
OTEL_SERVICE_NAMEConfiguration value read at startup.Optional

Example prompts to try

  • Use Otel to onRequest.
  • Use Otel to preValidation.
  • Use Otel to preSerialization.

Frequently asked questions

It connects Otel to MCP-compatible AI assistants such as Claude and Cursor, exposing 7 tools (onRequest, preValidation, preSerialization, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Otel directly.