Skip to main content
Monocle supports the Model Context Protocol (MCP), enabling AI assistants like Claude Code, Cursor, and others to interact directly with your observability data. Let your AI tools help you debug issues, analyze traces, and explore your application’s telemetry.

Authentication

Monocle uses OAuth 2.1 to authenticate MCP connections. Your MCP client handles the full authorization flow — you just approve access in your browser. OAuth users are not tied to a single application. You can navigate between organizations, applications, and environments using the list_apps and list_environments tools.

Getting Started

npx add-mcp https://api.monocle.sh/mcp
This works with any MCP client that supports OAuth (Claude Code, Claude Desktop, Cursor, etc.).

Start Asking Questions

Once connected, you can ask your AI assistant questions about your application:
  • “What exceptions occurred in the last hour?”
  • “Show me the slowest API endpoints”
  • “Find traces with errors from the checkout service”
  • “What’s the P95 latency for the /api/users endpoint?”

Available Tools

Your AI assistant has access to the following tools:
ToolDescription
whoamiGet current authentication context (org, app, environment)
list_appsList applications in your organization
list_environmentsList available environments for your application

Traces

ToolDescription
list_tracesList distributed traces with filters (time range, status, service, search)
get_traceGet all spans for a specific trace by ID

Logs

ToolDescription
list_logsList application logs with filtering (severity, service, time range, trace ID)
search_logsFull-text search across log messages

Exceptions

ToolDescription
list_exceptionsList exception groups with occurrence counts and affected users
get_exceptionGet detailed info about an exception group (stacktrace, timeline, affected routes)
analyze_exceptionAI-powered root cause analysis via Holmes
archive_exceptionArchive an exception group to hide it from the default list (duration: 1h, 1d, 1w, 30d, or forever)
create_issueCreate an issue to track one or more exceptions with priority and assignees
update_issueUpdate an issue’s status (open, resolved, ignored), priority, or assignees

Metrics

ToolDescription
list_instancesList service instances (pods/replicas) reporting metrics
list_metricsDiscover all available metrics (gauges, sums, histograms, summaries) with their types and units
get_metricQuery time-series data for any metric with aggregation (avg, sum, min, max, p50–p99), filtering, and grouping
get_metric_attributesDiscover attribute keys and values for a metric to use as filters or groupBy in get_metric

Endpoints

ToolDescription
list_endpointsList HTTP endpoint patterns with request count, avg/p95 duration, and error rate. Supports sorting, search, and method filtering
get_endpoint_statsGet detailed stats for a specific endpoint: latency percentiles, error rates, throughput, and time-series data

Database Queries

ToolDescription
list_db_queriesList database query patterns with execution count, avg/p95/max duration, error count, and slow query detection
get_db_query_detailGet details for a specific query pattern: recent executions with trace IDs and related HTTP routes

Background Jobs

ToolDescription
list_jobsList background job executions with published/processed counts, error rate, and avg/p95 processing time
get_job_detailGet details for a specific job: recent executions with duration, queue time, status, and error messages

Cache

ToolDescription
list_cache_statsList cache keys with hit/miss rates, operation counts, and avg/p95 latency
get_cache_key_detailGet detailed metrics for a specific cache key: hit/miss time series, duration, and operation breakdown

External Calls

ToolDescription
list_external_callsList third-party API domains with request count, avg/p95 latency, error rate, and status code breakdown
get_external_call_detailGet details for a specific domain: URL patterns, recent requests with trace IDs, and performance metrics

Custom Dashboards

Build and manage custom dashboards with metric widgets directly from your AI assistant. Dashboards use a 12-column grid layout.
ToolDescription
list_dashboardsList all custom dashboards with widget counts
get_dashboardGet a dashboard with all its widgets (data sources, display config, layout)
create_dashboardCreate a new empty dashboard
update_dashboardUpdate a dashboard’s name, description, or icon
delete_dashboardPermanently delete a dashboard and all its widgets
add_widgetAdd a widget to a dashboard (chart, stat, table, sparkline, pie, or bar-gauge)
update_widgetUpdate a widget’s metric, aggregation, display, or layout
remove_widgetRemove a widget from a dashboard
Dashboard tools that create or modify data (create_dashboard, update_dashboard, delete_dashboard, add_widget, update_widget, remove_widget) require the mcp:write scope.

Example Queries

  • What exceptions occurred in the last hour?
  • What’s the P95 latency for POST /api/orders?
  • Search logs for “payment failed”
  • Which database queries are the slowest?
  • Create an issue for the recurring TypeError in checkout
  • Create a dashboard with charts for request latency and error rate