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

# MCP Monitoring

> Monitor how your MCP server is being used by AI tools

If your application exposes an MCP server, Monocle provides a dedicated dashboard for tracking how AI tools interact with it. See which tools are called, by whom, and how they perform.

<Note>
  This page is about monitoring **your** MCP server. If you are looking for how
  to connect AI tools (Claude Code, Cursor, etc.) to **Monocle's** MCP server,
  see the [Monocle MCP Server](/features/mcp) page.
</Note>

## What Monocle tracks

* **Overview stats**: total tool calls, average and P95 latency, error rate, unique users and clients
* **Calls and duration charts**: time-series showing success/error distribution and latency trends
* **Clients table**: which MCP clients are making calls, with volume and timing data
* **Users table**: which users are using the MCP server
* **Tools table**: breakdown by tool with call count, latency percentiles, and error rate. Click any tool to see its detailed metrics and recent calls with links to full traces.

## Span attributes

Since there is no official OpenTelemetry semconv for MCP yet, attributes use the `mcp.*` namespace. All MCP instrumentations must emit these attributes for the dashboard to work correctly.

### Core attributes

| Attribute         | Description                          |
| ----------------- | ------------------------------------ |
| `mcp.method.name` | JSON-RPC method (e.g., `tools/call`) |
| `mcp.request.id`  | JSON-RPC request ID                  |
| `mcp.session.id`  | Transport session ID                 |
| `mcp.transport`   | Transport class name                 |

### Identity attributes

| Attribute              | Description                             |
| ---------------------- | --------------------------------------- |
| `mcp.server.name`      | Server name                             |
| `mcp.server.version`   | Server version                          |
| `mcp.client.name`      | Client name (from `initialize` request) |
| `mcp.client.version`   | Client version                          |
| `mcp.protocol.version` | Negotiated protocol version             |

### Target attributes

| Attribute          | When                   |
| ------------------ | ---------------------- |
| `mcp.tool.name`    | `tools/call` requests  |
| `mcp.resource.uri` | `resources/*` requests |
| `mcp.prompt.name`  | `prompts/get` requests |

### Monocle attributes

| Attribute                  | Dashboard Feature                          |
| -------------------------- | ------------------------------------------ |
| `mcp.tool.name`            | Tool breakdown table, per-tool detail page |
| `mcp.client.name`          | Clients table                              |
| `mcp.tool.result.is_error` | Error rate calculations                    |

### Error attributes

These follow the [RPC Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/rpc/json-rpc/):

| Attribute                   | Description            |
| --------------------------- | ---------------------- |
| `rpc.jsonrpc.error_code`    | JSON-RPC error code    |
| `rpc.jsonrpc.error_message` | JSON-RPC error message |

## Setup

<CardGroup cols={1}>
  <Card title="@modelcontextprotocol/sdk" icon="robot" href="/instrumentations/mcp-server">
    Install and configure @monocle.sh/instrumentation-mcp
  </Card>
</CardGroup>
