The package is a thin wrapper around the OpenTelemetry Node SDK plus a small HTTP client for safety checks. Everything runs in your process — no sidecar, no agent.Documentation Index
Fetch the complete documentation index at: https://sedataai.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Components
TelemetryManager
Owns the OpenTelemetry
NodeSDK, the trace exporter, the metric reader,
and the session id. Validates config on construction.McpServerInstrumentation
Patches
server.registerTool so every registered handler becomes
instrumented. Records spans, durations, counters, and safety attributes.safetyCheck wrapper
Decorates a tool handler. Calls
https://api.sedata-ai.tech/security/safety-check
with the chosen parameter, blocks if flagged, otherwise lets the handler run.ConfigValidator
Pure validation. Throws on missing
exporterEndpoint, out-of-range
samplingRate, malformed auth blocks, etc.Data flow
- The MCP client (Claude, an agent, an editor) issues
tools/call. - The MCP SDK invokes the registered handler — but the handler was replaced
at
registerTooltime with an instrumented version. - The instrumented handler opens an active span, increments a counter, and runs your original handler inside it.
- If the handler is wrapped by
safetyCheck, a network call toapi.sedata-ai.techhappens first. A flagged result short-circuits the handler with a safe blocked response. - The span ends with status + duration. The OTLP exporter batches spans and
metrics out to your
exporterEndpoint.
Where the SDK runs
Everything is in-process:- The
NodeSDKstarts oninstrumentServer(...)and stops when you calltelemetry.shutdown(). - Trace export uses OTLP/HTTP by default. Switch to console for local dev. See Console debugging.
- Metric export uses a
PeriodicExportingMetricReaderthat pushes everymetricExportIntervalMs(default 5000 ms).
The package never opens an inbound socket and never holds your tool calls
open waiting for telemetry to flush — exports are batched in the background.
What is instrumented today
| Surface | Status |
|---|---|
tools/call (every registerTool) | ✅ Auto-instrumented |
| Completions | 🚧 Planned |
| Logs | 🚧 Planned |
| Notifications | 🚧 Planned |
| Pings | 🚧 Planned |
| Prompts | 🚧 Planned |
| Resources | 🚧 Planned |
| Roots | 🚧 Planned |
| Sampling | 🚧 Planned |
Next
Tracing
What gets recorded on each span.
Telemetry pipeline
Exporters, samplers, and batching.