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

# MCP for Monitoring

> How the Model Context Protocol enables AI agents to manage monitoring infrastructure

The Model Context Protocol (MCP) provides a standardized way for AI agents to discover and use tools exposed by external services. For monitoring platforms, this means agents can create monitors, investigate incidents, and manage configurations through a well-defined interface.

## What is MCP?

MCP is an open protocol that connects AI applications (clients) to tool providers (servers):

```
AI Agent (Client) ←→ MCP Protocol ←→ MCP Server ←→ Monitoring API
```

The server advertises a catalog of tools with typed parameters. The client (your AI agent) browses the catalog, selects a tool, provides arguments, and receives structured results.

## Why MCP for monitoring?

### Standardized tool discovery

Without MCP, each monitoring API is different — different endpoints, auth schemes, and parameter names. MCP normalizes this into a consistent interface:

```
Tool: create_monitor
Parameters:
  - name: string (required)
  - type: "HTTP" | "DNS" | "TCP" | ...
  - url: string
  - frequency: integer (30-86400)
```

The agent doesn't need to know REST endpoints or HTTP methods. It just calls the tool.

### Type safety

MCP tool parameters are typed and validated. The server rejects invalid inputs before they reach the API, giving the agent clear error messages to self-correct.

### Authentication handled once

Configure API credentials when setting up the MCP server. Every tool call inherits that authentication — the agent never sees or handles tokens directly.

## MCP transport modes

### stdio (standard I/O)

The AI client spawns the MCP server as a subprocess. Communication happens through stdin/stdout:

```json theme={null}
{
  "mcpServers": {
    "devhelm": {
      "command": "uvx",
      "args": ["devhelm-mcp-server"],
      "env": {
        "DEVHELM_API_TOKEN": "your-token",
        "DEVHELM_ORG_ID": "1"
      }
    }
  }
}
```

Best for: local development with Cursor, Claude Desktop, or Windsurf.

### HTTP (Streamable HTTP)

The MCP server runs as a standalone HTTP service. Clients connect over the network:

```
http://localhost:8000/mcp
```

Best for: shared team servers, CI/CD pipelines, or remote access.

## What monitoring agents can do

| Category           | Example tools                                        |
| ------------------ | ---------------------------------------------------- |
| **Monitors**       | Create, update, delete, pause, resume, test          |
| **Incidents**      | List active, get details, resolve                    |
| **Alert channels** | Create Slack/PagerDuty/email channels, test delivery |
| **Results**        | Get recent check results, response times             |
| **Config**         | Validate YAML, plan changes, deploy                  |
| **Status Data**    | Check dependency health, list tracked services       |

## Example agent interaction

```
User: "Is anything down right now?"

Agent: [calls list_incidents()]

Agent: "There are 2 active incidents:
  1. API Health Monitor — DOWN since 14:02 UTC (2 regions confirming)
  2. Stripe Status — DEGRADED since 13:45 UTC (upstream dependency)

  The Stripe degradation started 17 minutes before the API issue.
  Want me to check if they're related?"
```

## Security considerations

* **Scope API tokens** — use organization-scoped tokens with minimum required permissions
* **Audit tool calls** — MCP servers can log every tool invocation for compliance
* **Review before deploy** — agents should validate and plan before applying changes
* **Network isolation** — run MCP servers behind your firewall, not on the public internet

## DevHelm MCP Server

<CardGroup cols={2}>
  <Card title="MCP Server setup" icon="server" href="/sdk/mcp/overview">
    Install and configure the DevHelm MCP server.
  </Card>

  <Card title="Tools reference" icon="list" href="/sdk/mcp/tools-reference">
    Complete catalog of 120 available tools.
  </Card>
</CardGroup>
