Documentation

Monocle Studio

Studio MCP

Let Claude Code, Cursor, or any MCP client query your local traces, logs, and queries

Monocle Studio includes a built-in MCP server. This lets AI coding assistants like Claude Code, Cursor, or Codex query your local telemetry data directly — find errors, inspect traces, and debug performance issues without leaving your editor.

Studio MCP only sees your local development data. To query production telemetry, connect the cloud Monocle MCP server.

Setup

The MCP server is available at http://localhost:4200/mcp when Monocle Studio is running.

If you also want your agents to know about Monocle Studio and how to use it, run:

Terminal
monocle studio install-agents
Terminal
pnpm dlx add-mcp http://localhost:4200/mcp -n monocle-studio -a claude-code

Available tools

ToolDescription
list_tracesList recent traces with entry point, duration, and status. Supports filtering by trace ID.
get_traceGet the complete span waterfall for a trace — parent/child relationships, durations, attributes.
list_logsList logs filtered by severity, search text, or trace ID.
list_errorsList exceptions with type, message, stacktrace, and trace context.
list_queriesList database queries with SQL statement, duration, and system. Filter by database type.
clear_dataClear all collected telemetry for a fresh debugging session.

Examples

Once connected, you can ask your AI assistant things like:

  • "What errors happened in the last few requests?"
  • "Show me the trace for the slow /api/users endpoint"
  • "Find all database queries slower than 200ms"
  • "What's the overall health of my app right now?"
  • "Clear all data and start a fresh debugging session"

The assistant will call the appropriate MCP tools, query Monocle Studio, and give you the answer in context.

Search documentation

Search pages and sections of the Monocle documentation