LocalTrace

Agents

MCP

Streamable HTTP at /mcp. Compact payloads, since_minutes, and a playbook in server instructions.

With the API running, agents talk Streamable HTTP at http://127.0.0.1:4318/mcp.

The server is agent-first: compact payloads, since_minutes, and a playbook in server instructions. Tools still call the same execute services as HTTP. Do not attach a raw SQLite MCP.

Cursor

.cursor/mcp.json:

{
  "mcpServers": {
    "localtrace": {
      "url": "http://127.0.0.1:4318/mcp"
    }
  }
}

Claude Code

.mcp.json in the project you are debugging:

{
  "mcpServers": {
    "localtrace": {
      "type": "http",
      "url": "http://127.0.0.1:4318/mcp"
    }
  }
}

Inspector

npx @modelcontextprotocol/inspector http://127.0.0.1:4318/mcp

Tools

ToolWhat the agent gets
list_facetsValid trace filter values
list_tracesRecent traces (paginated). Prefer since_minutes
get_traceOverview (default) or detail=full
get_spanOne span with attributes
get_trace_sqlDB queries in a trace, sorted by duration
get_trace_spansTyped payloads: sql / redis / mongo / prisma / http / express / s3 / openrouter / trpc / error
search_spansCross-trace search (name/attributes, type, service)
get_trace_logsLogs correlated to a trace_id
list_log_facetsServices and severity buckets for log filters
list_logsRecent logs (attributes omitted unless raw)
list_servicesServices that have ingested traces
list_metric_facetsMetric names and services
query_metricsRecent metric points

Prompts: investigate_trace, debug_errors, find_slow.

See the investigation playbook for how agents should call these tools.