Skip to main content
Glama
mcp-use-sentry-example

mcp-use-sentry-example

by manufacts

Sentry tool monitoring

Trace mcp-use tool callbacks and report both returned tool errors and exceptions using existing MCP middleware. No SDK changes or additional application services are required.

Run

Requires Node.js 22.22.2 or newer. Clone this repository, then:

npm install
cp .env.example .env
# Set MCP_USE_SENTRY_DSN to your Sentry project DSN.
npm run dev

In Inspector, call monitored_report with outcome set to success, tool_error, or exception. Look for tools/call monitored_report in Sentry Traces and the failures in Issues. Without a DSN, tools still work but no telemetry is sent.

The example initializes Sentry once with automatic integrations disabled and every trace sampled. Arguments and returned content are not recorded. Exception messages and stacks are captured. Reuse an existing Sentry initialization when adapting this middleware, and check for duplicate capture from other instrumentation.

This monitors registered tool callbacks, not transport failures or validation rejected before callback dispatch. It targets a long-running Node process; serverless runtimes need lifecycle-aware flushing.

Related MCP server: mcp-tool-observability

Verify

npm run typecheck
npm run test
npm run build

Tests invoke the server over MCP and use real Sentry spans and error processing with a local transport. No Sentry account or network access is needed for the tests.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables live tracing and observability of MCP tool calls, persisting execution traces to MongoDB and streaming them in real time to a dashboard.
      -
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP tool calls with strict schema validation and stdio isolation, while providing a security gateway for tool-level authorization, streaming PII redaction, and model failover routing.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Pi to connect to Sentry's MCP endpoint, allowing an agent to search issues, events, and traces after OAuth sign-in.
      15 npm
      MIT