Overview

Integrate MCPcat with Sentry for error tracking and performance monitoring. Events are sent as logs, and optionally as transactions for performance analysis.

Prerequisites

  1. A Sentry project with a DSN (Data Source Name)
  2. DSN can be found in your Sentry project settings under “Client Keys (DSN)“

Configuration

mcpcat.track(server, null, {
  exporters: {
    sentry: {
      type: "sentry",
      dsn: "https://key@o123456.ingest.sentry.io/789",
      environment: "production",
      release: "1.0.0",
      enableTracing: true
    }
  }
})

Configuration Fields

FieldTypeRequiredDescription
dsnstringYesSentry Data Source Name from project settings
environmentstringNoEnvironment name (default: “production”)
releasestringNoRelease version for tracking deployments
enableTracing / enable_tracingbooleanNoEnable performance monitoring. When true, sends transaction events to Sentry’s Performance tab in addition to logs, allowing you to track duration and performance metrics.

Field Mapping

Trace and Event IDs

MCPcat FieldSentry FieldFormat
session_idtrace_idSHA256 hash (one trace per session)
event_idevent_idDouble SHA256 hash for uniqueness

Log Events

All events are sent as logs with the following structure:
FieldValueDescription
timestampEvent timestampUnix timestamp
level"error" or "info"Based on is_error flag
body"MCP {event_type}: {resource_name}"Formatted message

Transaction Events

Transaction events are only sent when enableTracing is set to true in the configuration.
FieldValueDescription
transaction"{event_type} - {resource_name}"Transaction name
start_timestampTimestamp - durationCalculated start time
end_timestampEvent timestampWhen the event completed
opEvent typeOperation type (e.g., “tools/call”)
status"internal_error" or "ok"Based on is_error flag

Tags

Events include the following tags for filtering and grouping:
MCPcat FieldTag NameCondition
Environment configenvironmentAlways included
Release configreleaseIf configured
event_typeevent_typeAlways included
resource_nameresourceIf available
server_nameserver_nameIf available
client_nameclient_nameIf available
identify_actor_given_idactor_idIf user identified

Extra Data

Additional context fields stored with events:
MCPcat FieldExtra FieldDescription
session_idsession_idSession identifier
project_idproject_idMCPcat project ID
user_intentuser_intentUser’s intent
durationduration_msDuration in milliseconds
identify_actor_nameactor_nameUser name
identify_actor_dataactor_dataUser metadata
client_versionclient_versionMCP client version
server_versionserver_versionMCP server version

Error Events

When is_error is true, Sentry receives:
  1. A log event (always sent)
  2. A transaction event (if enableTracing is true)
  3. A separate error event for the Issues tab
This ensures proper error tracking, alerting, and issue management in Sentry.