@sedata-ai/mcp is a drop-in instrumentation package for Model Context Protocol
servers. It captures every tool call as an OpenTelemetry
span, ships it to a backend you control, and runs an inline safety check on tool
inputs — all in one wrapper.
What you get
Zero-config tracing
Every
registerTool call is auto-wrapped with OpenTelemetry spans, durations, and counters.Inline safety checks
safetyCheck() blocks malicious or sensitive content before your handler runs.OTLP-native
Ship to Sedata Cloud, your own collector, or any OTLP/HTTP backend.
Custom instrumentation
Drop into the underlying tracer and meter for your own spans, histograms, and counters.
How it fits
1
You wrap your MCP server
One call to
instrumentServer(server, config) patches registerTool so every
tool invocation runs inside an OTel span.2
Tool calls produce spans + metrics
Each call records duration, status, request id, session id, client address,
tool metadata, and (optionally) safety-check verdicts.
3
Data ships to your backend
OTLP/HTTP exporters batch traces and metrics out to the endpoint you configure.
Use Sedata Cloud, an OTel collector, or a console exporter for local dev.
Two pieces, one package
instrumentServer()
The single entry point. Returns an
ObservabilityInstance with helpers for
custom spans, histograms, counters, and graceful shutdown.safetyCheck()
A handler wrapper that runs your tool input through Sedata’s safety API
before the handler is called.
Quick links
Quickstart
Get a server emitting traces in five minutes.
API reference
Every function, class, and type exported from the package.
Examples
Working servers you can run end-to-end.
The Python and Go packages mirror the TypeScript SDK. This documentation covers
the TypeScript surface; tracking issues for the other runtimes live on
GitHub.