> ## 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 Server Monitor Configuration

> Configure DevHelm MCP server monitors — command, arguments, environment, and connection assertions

MCP server monitors launch an MCP server process and verify connectivity. Configuration specifies the server command and its environment.

<Tip>
  **Define this in code.** [YAML format](/mac/yaml/monitors) · [Terraform](/mac/terraform/monitors)
</Tip>

## Config fields

| Field            | Type            | Required | Default | Description                                  |
| ---------------- | --------------- | -------- | ------- | -------------------------------------------- |
| `config.command` | string          | Yes      | —       | Command to start the MCP server              |
| `config.args`    | array of string | No       | `[]`    | Command-line arguments                       |
| `config.env`     | object          | No       | `{}`    | Environment variables to set for the process |

## Assertions

| Assertion                | Required fields | Description                                                   |
| ------------------------ | --------------- | ------------------------------------------------------------- |
| `mcp_connects`           | *(none)*        | Passes if the MCP server starts and accepts connections       |
| `mcp_response_time`      | `maxMs`         | Fails if initialization takes longer than threshold           |
| `mcp_response_time_warn` | `warnMs`        | Records degraded hint for elevated startup time               |
| `mcp_has_capability`     | `capability`    | Fails if the server doesn't advertise a specific capability   |
| `mcp_tool_available`     | `toolName`      | Fails if a specific tool isn't in the server's tool list      |
| `mcp_min_tools`          | `min`           | Fails if the tool count is below minimum                      |
| `mcp_protocol_version`   | `version`       | Fails if the server's MCP protocol version doesn't match      |
| `mcp_tool_count_changed` | `expectedCount` | Fails if the tool count differs from expected (detects drift) |

## Examples

### Basic connectivity

```yaml theme={null}
monitors:
  - name: Custom MCP server
    type: MCP_SERVER
    config:
      command: node
      args: ["dist/server.js"]
    assertions:
      - config:
          type: mcp_connects
        severity: fail
```

### Full validation

```yaml theme={null}
monitors:
  - name: Production MCP
    type: MCP_SERVER
    config:
      command: uvx
      args: ["devhelm-mcp-server"]
      env:
        DEVHELM_API_TOKEN: ${MCP_TOKEN}
    frequencySeconds: 300
    regions: [us-east]
    assertions:
      - config:
          type: mcp_connects
        severity: fail
      - config:
          type: mcp_response_time
          maxMs: 10000
        severity: fail
      - config:
          type: mcp_tool_available
          toolName: list-monitors
        severity: fail
      - config:
          type: mcp_tool_available
          toolName: create-monitor
        severity: fail
      - config:
          type: mcp_min_tools
          min: 5
        severity: warn
      - config:
          type: mcp_tool_count_changed
          expectedCount: 12
        severity: warn
```

## Next steps

<CardGroup cols={2}>
  <Card title="MCP overview" icon="robot" href="/monitoring/mcp-server/overview">
    When to use MCP server monitors.
  </Card>

  <Card title="MCP Server SDK" icon="code" href="/sdk/mcp/overview">
    The DevHelm MCP server for AI agents.
  </Card>
</CardGroup>
