# MCP server

The Oh Dear MCP server lets AI assistants query your monitoring data and manage maintenance windows directly through the [Model Context Protocol](https://modelcontextprotocol.io). Ask questions about your monitors, uptime, broken links, DNS, performance, sitemaps, and more, in natural language.

## Connect

Add this URL to your AI client as an MCP server (or "Custom Connector"):

```
https://ohdear.app/mcp
```

The client will redirect you to Oh Dear. You log in (if you aren't already), pick which teams to share, and choose which permissions to grant. After approving, you're bounced back to your client and the connection is live.

The connection appears under [Connected AI assistants](/user/connected-apps), where you can revoke it any time.

### Claude.ai (web)

In Claude.ai, open Settings, Custom Connectors, and add the URL above. Claude.ai walks you through the OAuth approval.

### Claude Code

```bash
claude mcp add --transport http ohdear https://ohdear.app/mcp
```

Claude Code opens the OAuth flow on first use.

### Claude Desktop, Cursor, VS Code, others

These clients reach our server through [`mcp-remote`](https://www.npmjs.com/package/mcp-remote), which handles OAuth automatically. Example for Claude Desktop:

```json
{
  "mcpServers": {
    "ohdear": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://ohdear.app/mcp"]
    }
  }
}
```

Save the file and restart Claude Desktop. The first request opens a browser window for OAuth approval; after that, the token is stored locally and reused.

## Permissions

The consent screen offers two scopes:

- **Read access** (always granted): read your monitors, uptime, broken links, DNS, performance, sitemaps, cron checks, and existing maintenance windows.
- **Write access** (opt-in): create, update, and delete monitors, monitor settings, status pages, and recurring maintenance windows.

You can grant access to one or more teams in a single approval. Tools take a `team_id` argument when more than one is granted.

## What you can do

Examples:

- "Show me all my Oh Dear monitors"
- "Which monitors have issues right now?"
- "Get the details for monitor 12345"
- "What's the uptime for example.com over the last 24 hours?"
- "Are there any broken links on example.com?"
- "Show DNS history for example.com"
- "What are the latest Lighthouse scores?"
- "Show recurring maintenance periods for example.com"
- "Create a weekly maintenance window for Mondays at 4am"
- "Add a new monitor for https://example.com with broken-link checks"
- "Rename the monitor for example.com to 'Marketing site'"
- "Delete the monitor for old-site.com"

## Manage connections

Visit [Connected AI assistants](/user/connected-apps) to see every AI assistant connected via OAuth, when each was last used, and revoke any of them.
