mcp-use-sentry-example
Monitors MCP tool callbacks and reports tool errors and exceptions to Sentry, providing tracing and issue tracking for tool executions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-use-sentry-exampleRun monitored_report with an exception to verify Sentry captures it"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 devIn 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 buildTests 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.
This server cannot be deployed
Maintenance
Related MCP Connectors
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Security & DLP proxy for MCP: tool-poisoning scans, PII redaction on tool args/results. Beta.
MCP server for AI access to SmartBear tools, including BugSnag, Reflect, Swagger, PactFlow, QTM4J.
Find, vet, and run MCP tools through a secure audited gateway with prompt-injection risk scoring
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceExposes FastAPI routes as MCP tools with auto-discovery, Pydantic schema extraction, and built-in observability.Apache 2.0
- FlicenseNot gradedqualityCmaintenanceEnables live tracing and observability of MCP tool calls, persisting execution traces to MongoDB and streaming them in real time to a dashboard.-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to trace Python code execution in real time via PEP 669, exposing call trees, variable deltas, and async context through MCP tools.1MIT
- AlicenseNot gradedqualityFmaintenanceEnables transparent security for any MCP server by intercepting tool calls, blocking prompt injection attempts, masking PII in responses, and writing immutable audit logs.302 npmMIT