> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sedata-ai.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Developer-first observability and inline safety for MCP servers.

<Frame>
  <img src="https://mintcdn.com/sedataai/wSLL-vktaiea1WMS/images/hero.svg?fit=max&auto=format&n=wSLL-vktaiea1WMS&q=85&s=10f2b7284db4959e853033868492ce6a" alt="Sedata.AI for MCP" width="1200" height="480" data-path="images/hero.svg" />
</Frame>

`@sedata-ai/mcp` is a drop-in instrumentation package for [Model Context Protocol](https://modelcontextprotocol.io)
servers. It captures every tool call as an [OpenTelemetry](https://opentelemetry.io)
span, ships it to a backend you control, and runs an inline safety check on tool
inputs — all in one wrapper.

```ts theme={null}
import { instrumentServer, safetyCheck } from '@sedata-ai/mcp'

const telemetry = instrumentServer(server, {
  serverName: 'weather-mcp',
  serverVersion: '1.0.0',
  exporterEndpoint: 'https://otel.sedata-ai.tech/v1',
  exporterAuth: { type: 'bearer', token: process.env.SEDATA_TOKEN! },
})
```

## What you get

<CardGroup cols={2}>
  <Card title="Zero-config tracing" icon="route" href="/concepts/tracing">
    Every `registerTool` call is auto-wrapped with OpenTelemetry spans, durations, and counters.
  </Card>

  <Card title="Inline safety checks" icon="shield-halved" href="/concepts/safety-checks">
    `safetyCheck()` blocks malicious or sensitive content before your handler runs.
  </Card>

  <Card title="OTLP-native" icon="signal-stream" href="/concepts/telemetry-pipeline">
    Ship to Sedata Cloud, your own collector, or any OTLP/HTTP backend.
  </Card>

  <Card title="Custom instrumentation" icon="code" href="/metrics-and-traces/custom-instrumentation">
    Drop into the underlying tracer and meter for your own spans, histograms, and counters.
  </Card>
</CardGroup>

## How it fits

<Steps>
  <Step title="You wrap your MCP server">
    One call to `instrumentServer(server, config)` patches `registerTool` so every
    tool invocation runs inside an OTel span.
  </Step>

  <Step title="Tool calls produce spans + metrics">
    Each call records duration, status, request id, session id, client address,
    tool metadata, and (optionally) safety-check verdicts.
  </Step>

  <Step title="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.
  </Step>
</Steps>

## Two pieces, one package

<CardGroup cols={2}>
  <Card title="instrumentServer()" icon="plug" href="/api-reference/instrument-server">
    The single entry point. Returns an `ObservabilityInstance` with helpers for
    custom spans, histograms, counters, and graceful shutdown.
  </Card>

  <Card title="safetyCheck()" icon="shield-check" href="/api-reference/safety-check">
    A handler wrapper that runs your tool input through Sedata's safety API
    before the handler is called.
  </Card>
</CardGroup>

## Quick links

<CardGroup cols={3}>
  <Card title="Quickstart" icon="bolt" href="/quickstart">
    Get a server emitting traces in five minutes.
  </Card>

  <Card title="API reference" icon="book" href="/api-reference/instrument-server">
    Every function, class, and type exported from the package.
  </Card>

  <Card title="Examples" icon="code-branch" href="/examples/weather-server">
    Working servers you can run end-to-end.
  </Card>
</CardGroup>

<Note>
  The Python and Go packages mirror the TypeScript SDK. This documentation covers
  the TypeScript surface; tracking issues for the other runtimes live on
  [GitHub](https://github.com/sedata-ai/sedata-ai-packages).
</Note>
