Overview
Integrate MCPcat with Sentry for error tracking and performance monitoring. Events are sent as logs, and optionally as transactions for performance analysis.
Prerequisites
- A Sentry project with a DSN (Data Source Name)
- 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
Field | Type | Required | Description |
---|
dsn | string | Yes | Sentry Data Source Name from project settings |
environment | string | No | Environment name (default: “production”) |
release | string | No | Release version for tracking deployments |
enableTracing / enable_tracing | boolean | No | Enable 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 Field | Sentry Field | Format |
---|
session_id | trace_id | SHA256 hash (one trace per session) |
event_id | event_id | Double SHA256 hash for uniqueness |
Log Events
All events are sent as logs with the following structure:
Field | Value | Description |
---|
timestamp | Event timestamp | Unix 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.
Field | Value | Description |
---|
transaction | "{event_type} - {resource_name}" | Transaction name |
start_timestamp | Timestamp - duration | Calculated start time |
end_timestamp | Event timestamp | When the event completed |
op | Event type | Operation type (e.g., “tools/call”) |
status | "internal_error" or "ok" | Based on is_error flag |
Events include the following tags for filtering and grouping:
MCPcat Field | Tag Name | Condition |
---|
Environment config | environment | Always included |
Release config | release | If configured |
event_type | event_type | Always included |
resource_name | resource | If available |
server_name | server_name | If available |
client_name | client_name | If available |
identify_actor_given_id | actor_id | If user identified |
Additional context fields stored with events:
MCPcat Field | Extra Field | Description |
---|
session_id | session_id | Session identifier |
project_id | project_id | MCPcat project ID |
user_intent | user_intent | User’s intent |
duration | duration_ms | Duration in milliseconds |
identify_actor_name | actor_name | User name |
identify_actor_data | actor_data | User metadata |
client_version | client_version | MCP client version |
server_version | server_version | MCP server version |
Error Events
When is_error
is true
, Sentry receives:
- A log event (always sent)
- A transaction event (if
enableTracing
is true)
- A separate error event for the Issues tab
This ensures proper error tracking, alerting, and issue management in Sentry.