Overview

Integrate MCPcat with any OpenTelemetry Protocol (OTLP) compatible platform like Jaeger, Grafana Tempo, New Relic, or AWS X-Ray. Learn more about OpenTelemetry at opentelemetry.io.

Configuration

mcpcat.track(server, null, {
  exporters: {
    otlp: {
      type: "otlp",
      endpoint: "http://localhost:4318/v1/traces",
      protocol: "http/protobuf",
      headers: {
        "api-key": "your-api-key"
      },
      compression: "gzip"
    }
  }
})

Configuration Fields

FieldTypeRequiredDescription
endpointstringYesOTLP endpoint URL
protocolstringNoProtocol format: "http/protobuf" or "grpc" (default: "http/protobuf")
headersobjectNoAdditional headers to send with requests
compressionstringNoCompression method: "gzip" or "none" (default: "none")

Field Mapping

MCPcat events are mapped to OTLP spans with the following structure:

Trace and Span IDs

MCPcat FieldOTLP FieldFormat
session_idtraceId32-character hex (SHA256 hash, one per session)
event_idspanId16-character hex (SHA256 hash, unique per event)

Resource Attributes

MCPcat FieldOTLP AttributeDescription
server_nameservice.nameMCP server name
server_versionservice.versionMCP server version
SDK typetelemetry.sdk.name"mcpcat-python" or "mcpcat-typescript"
SDK versiontelemetry.sdk.versionMCPcat SDK version

Span Attributes

MCPcat FieldOTLP AttributeDescription
event_typemcp.event_typeEvent type (e.g., “tools/call”)
session_idmcp.session_idSession identifier
project_idmcp.project_idMCPcat project ID (if provided)
resource_namemcp.resource_nameTool/prompt/resource name
user_intentmcp.user_intentUser’s intent (if captured)
identify_actor_given_idmcp.actor_idUser identifier (if identified)
identify_actor_namemcp.actor_nameUser name (if identified)
client_namemcp.client_nameMCP client name
client_versionmcp.client_versionMCP client version

Span Properties

PropertyValueDescription
nameEvent type or "mcp.event"Span display name
kind2 (SPAN_KIND_SERVER)Indicates server-side span
startTimeUnixNanoEvent timestampIn nanoseconds
endTimeUnixNanoStart + durationIn nanoseconds (if duration available)
status.code1 (OK) or 2 (ERROR)Based on is_error flag