Skip to main content

MCP Client Integration

ZeroMTTR exposes its observability, code inspection, and notification capabilities via the open Model Context Protocol (MCP) over Streamable HTTP.

You can connect Claude Code, Claude Desktop, Cursor, or MCP Inspector directly to investigate incidents using the same tools used by the orchestrator.

Quick Setup (.mcp.json)​

The repository root includes a ready-to-use .mcp.json configuration:

{
"mcpServers": {
"zeromttr-aiops": {
"type": "http",
"url": "http://localhost:8000/mcp",
"headers": {
"Authorization": "Bearer ${MCP_AUTH_TOKEN}"
}
}
}
}

Because .env is not automatically loaded into the MCP client's process environment, export MCP_AUTH_TOKEN in your shell before launching Claude Code (or another compatible client) so ${MCP_AUTH_TOKEN} expands in the request header:

export MCP_AUTH_TOKEN="${MCP_AUTH_TOKEN:-$(node --env-file-if-exists=.env -p "process.env.MCP_AUTH_TOKEN ?? ''")}"
claude

If your .env uses Docker Compose variable interpolation (${...}) or inline comments, export the resolved token directly with export MCP_AUTH_TOKEN='<your-token>' before running the commands.

Cursor users

Cursor reads project MCP configs from .cursor/mcp.json and uses ${env:MCP_AUTH_TOKEN} syntax for environment variable interpolation. Export MCP_AUTH_TOKEN in your shell before launching the client.

Testing with MCP Inspector​

With the local stack running:

export MCP_AUTH_TOKEN="${MCP_AUTH_TOKEN:-$(node --env-file-if-exists=.env -p "process.env.MCP_AUTH_TOKEN ?? ''")}"
npx @modelcontextprotocol/inspector

In the Inspector, connect via Streamable HTTP to http://localhost:8000/mcp with header Authorization: Bearer <MCP_AUTH_TOKEN>.

Available Tools (8)​

CategoryToolPurpose
Metricsexecute_promql_rangeRuns PromQL queries on Prometheus with deterministic summarization and exemplar extraction.
Tracesanalyze_otel_traceInspects a distributed span tree in Tempo and isolates the critical error span.
Tracessearch_traces_by_traceqlSearches recent error traces in Tempo filtered by service.
Logsquery_loki_logsQueries edge-redacted logs in Loki with policy truncation (FinOps).
Codeinspect_git_deploy_diffInspects the real GitHub diff between healthy and degraded releases.
Remediationcreate_remediation_prCreates a hotfix/* branch and opens a Pull Request against the release branch.
Notificationsend_post_mortem_resendSends the post-mortem email with signed decision links.
Observabilityannotate_grafana_incidentPosts incident lifecycle annotations directly onto Grafana graphs.