> ## 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.

# Console debugging

> Run @sedata-ai/mcp without a backend — see spans on stdout.

The console exporter is the fastest way to verify your instrumentation is
firing. No backend, no auth, no network — spans print straight to your
terminal.

## Switch the exporter type

```ts theme={null}
const config: TelemetryConfig = {
  serverName: 'my-server',
  serverVersion: '1.0.0',
  exporterType: 'console',
  // exporterEndpoint, exporterAuth, samplingRate — all optional / ignored
}

instrumentServer(server, config)
```

When `exporterType: 'console'`:

* Trace exporter is `ConsoleSpanExporter` from `@opentelemetry/sdk-trace-base`.
* **No metric reader** is attached — metrics are dropped silently. Use console
  for trace verification only.
* Auth and endpoint config are ignored.

## What you'll see

Each span prints as JSON when it ends:

```text theme={null}
{
  traceId: 'a3b...',
  parentId: undefined,
  name: 'tools/call calculate-bmi',
  id: '...',
  kind: 0,
  timestamp: 1747000000000000,
  duration: 1432,
  attributes: {
    'mcp.method.name': 'tools/call',
    'mcp.tool.name': 'calculate-bmi',
    'mcp.tool.title': 'BMI Calculator',
    'mcp.tool.description': 'Calculate Body Mass Index',
    'mcp.request.id': 'b9c...',
    'mcp.session.id': 'f3a...',
    'client.address': '127.0.0.1',
    'mcp.operation.success': true,
    'mcp.operation.duration': 1
  },
  status: { code: 1 },
  events: [],
  links: []
}
```

This is the same data the OTLP exporter would ship — just rendered locally.

## Use cases

<CardGroup cols={2}>
  <Card title="Verify a new tool" icon="badge-check">
    Confirm spans appear with the right attributes before pointing at prod.
  </Card>

  <Card title="Debug a custom span" icon="bug">
    See exactly what your `startActiveSpan` calls are emitting.
  </Card>

  <Card title="Test redaction" icon="user-shield">
    Run with `enableArgumentCollection: true` + your `dataProcessors` and
    inspect the printed attributes.
  </Card>

  <Card title="CI smoke test" icon="circle-check">
    Run a sample tool call in CI and grep for expected attributes.
  </Card>
</CardGroup>

## Sample CI assertion

```ts test/smoke.ts theme={null}
import { spawn } from 'node:child_process'

const proc = spawn('node', ['dist/server.js'], { stdio: 'pipe' })
let stderr = ''
proc.stderr.on('data', (d) => (stderr += d.toString()))

// drive a tool call via your MCP client of choice...

proc.kill('SIGTERM')
proc.on('exit', () => {
  if (!stderr.includes("'mcp.tool.name': 'calculate-bmi'")) {
    process.exit(1)
  }
})
```

## When you're ready for the real backend

Switch to `otlp-http` (or remove `exporterType` entirely — it's the default):

```diff theme={null}
- exporterType: 'console',
+ exporterEndpoint: 'https://otel.sedata-ai.tech/v1',
+ exporterAuth: { type: 'bearer', token: process.env.SEDATA_TOKEN! },
```

## Next

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/guides/authentication">
    Wire up the live exporter.
  </Card>

  <Card title="Troubleshooting" icon="wrench" href="/troubleshooting">
    Common issues and fixes.
  </Card>
</CardGroup>
