Skip to main content
Glama
README.md
# caido-mcp

Model Context Protocol (MCP) server for [Caido](https://caido.io) (`GET /health` + `POST /graphql`). Connect Claude Desktop, Cursor, Cline / VS Code, Windsurf, or n8n to your local or remote Caido instance to query captured HTTP traffic with **HTTPQL**, inspect raw request/response pairs, manage project scopes, and record structured security findings.

Built on the official `@modelcontextprotocol/sdk` stdio transport and `@caido/server-auth` Personal Access Token (`caido_…`) exchange, with JSON Schema 2020-12 validated tools, sensitive HTTP header redaction (`CAIDO_REDACT_AUTH_HEADERS=1`), preview-first mutations (`confirm: false` by default), and a hard read-only lock (`CAIDO_READ_ONLY=1`).

---

## Features

- **Official Caido GraphQL & PAT contract**: Supports both `CAIDO_PAT` (`caido_…` Personal Access Tokens exchanged and refreshed automatically via `@caido/server-auth`) and static/session `CAIDO_ACCESS_TOKEN` Bearer tokens against `POST /graphql` and `GET /health`.
- **JSON Schema 2020-12 & Anthropic API verified**: Every tool's `inputSchema` is validated in CI with `Ajv2020` (`strict: true`) and checked against Anthropic's strict tool-use schema rules.
- **Context-safe raw HTTP inspection & DLP**: Decodes Base64 `Request.raw` / `Response.raw` payloads, masks `Authorization`, `Cookie`, `Set-Cookie`, and `X-Api-Key` header values by default (`CAIDO_REDACT_AUTH_HEADERS=1`), and bounds payload size via `CAIDO_MAX_RAW_BYTES` (default `8192`).
- **Safe-by-default mutations**: `select_project`, `create_scope`, and `create_finding` default to `confirm: false` (dry-run preview), and `CAIDO_READ_ONLY=1` removes and blocks all write tools completely.

---

## Tools

| Tool | Caido Endpoint / Operation | Mode | Description |
| :--- | :--- | :--- | :--- |
| `get_instance_status` | `GET /health` + `query Viewer` + `query Projects` | Read | Instance version, readiness, viewer identity/plan, and workspace project summary. |
| `list_projects` | `query Projects` | Read | Lists all Caido projects (`id`, `name`, `status`, `size`, `version`, `readOnly`). |
| `select_project` | `mutation SelectProject($id)` | Write (`confirm`) | Switches the active Caido workspace project. Hidden when `CAIDO_READ_ONLY=1`. |
| `list_scopes` | `query Scopes` | Read | Lists target scopes with `allowlist` and `denylist` glob patterns. |
| `create_scope` | `mutation CreateScope($input)` | Write (`confirm`) | Creates a target scope with `allowlist` and `denylist` rules. Hidden when `CAIDO_READ_ONLY=1`. |
| `list_filter_presets` | `query FilterPresets` | Read | Lists saved `HTTPQL` and `StreamQL` filter presets (`id`, `name`, `alias`, `clause`). |
| `list_requests` | `query Requests($filter: HTTPQLInput, ...)` | Read | Searches captured HTTP history via Caido `HTTPQL`, `scopeId`, cursor pagination, and sort order. |
| `get_request` | `query Request($id)` | Read | Fetches a full HTTP request & response by ID with Base64 decoding and header DLP redaction. |
| `list_findings` | `query Findings` | Read | Paginated security findings with optional `reporter` filter and sort ordering. |
| `create_finding` | `mutation CreateFinding($requestId, $input)` | Write (`confirm`) | Attaches a structured security finding (`title`, `reporter`, `description`, `dedupeKey`) to a request. Hidden when `CAIDO_READ_ONLY=1`. |

---

## Environment Variables

| Variable | Required | Default | Description |
| :--- | :--- | :--- | :--- |
| `CAIDO_URL` | No | `http://127.0.0.1:8080` | Base URL of your local or remote Caido instance. |
| `CAIDO_PAT` | One of `CAIDO_PAT` / `CAIDO_ACCESS_TOKEN` | — | Caido Personal Access Token (`caido_…`) for automatic device-flow auth & refresh. |
| `CAIDO_ACCESS_TOKEN` | One of `CAIDO_PAT` / `CAIDO_ACCESS_TOKEN` | — | Direct Bearer access token (for offline/CI or pre-authenticated sessions). |
| `CAIDO_TOKEN_CACHE_PATH` | No | — | Optional file path to cache PAT-exchanged tokens (`0600` permissions). |
| `CAIDO_ALLOW_NO_AUTH` | No | `0` | Set to `1` only when connecting to a local Caido instance started with `--no-auth`. |
| `CAIDO_READ_ONLY` | No | `0` | Set to `1` or `true` to hide and block all mutating tools. |
| `CAIDO_REDACT_AUTH_HEADERS` | No | `1` | Masks `Authorization`, `Cookie`, `Set-Cookie`, and `X-Api-Key` values in raw HTTP payloads. |
| `CAIDO_MAX_RAW_BYTES` | No | `8192` | Maximum decoded bytes per raw HTTP request/response (`256`–`262144`). |
| `CAIDO_TIMEOUT_MS` | No | `15000` | Per-request HTTP timeout in milliseconds (`1000`–`120000`). |

---

## Client Configuration

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "caido": {
      "command": "npx",
      "args": ["-y", "github:khoap1220-hue/caido-mcp"],
      "env": {
        "CAIDO_URL": "http://127.0.0.1:8080",
        "CAIDO_PAT": "caido_your_pat_here"
      }
    }
  }
}
```

### Cursor (`.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "caido": {
      "command": "npx",
      "args": ["-y", "github:khoap1220-hue/caido-mcp"],
      "env": {
        "CAIDO_URL": "http://127.0.0.1:8080",
        "CAIDO_PAT": "caido_your_pat_here"
      }
    }
  }
}
```

### Cline / VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "caido": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "github:khoap1220-hue/caido-mcp"],
      "env": {
        "CAIDO_URL": "http://127.0.0.1:8080",
        "CAIDO_PAT": "caido_your_pat_here"
      }
    }
  }
}
```

### Windsurf (`~/.codeium/windsurf/mcp_config.json`)

```json
{
  "mcpServers": {
    "caido": {
      "command": "npx",
      "args": ["-y", "github:khoap1220-hue/caido-mcp"],
      "env": {
        "CAIDO_URL": "http://127.0.0.1:8080",
        "CAIDO_PAT": "caido_your_pat_here"
      }
    }
  }
}
```

### n8n (MCP Client Tool Node — Command-line / Stdio)

| Field | Value |
| :--- | :--- |
| **Connection Type** | `Command Line (STDIO)` |
| **Command** | `npx` |
| **Arguments** | `-y github:khoap1220-hue/caido-mcp` |
| **Environment** | `CAIDO_URL=http://127.0.0.1:8080,CAIDO_PAT=caido_your_pat_here` |

---

## Development & Verification

Requires **Node.js >= 20**.

```bash
npm install
npm run lint
npm run typecheck
npm run build
npm test
```

## License

MIT © 2026 [Khoa Phan](https://khoaphan.dev/services/?ref=gh-caido-mcp)

TDQS

A3.9/5.0

Scored across 10 tools

Disambiguation5/5

Each tool targets a distinct resource+action pair: instance status, projects, scopes, filter presets, requests, and findings are all clearly separated. The list/get pairing on requests (list_requests vs get_request) and scopes vs presets are unambiguous from descriptions.

Naming Consistency5/5

All ten tools follow a clean verb_noun snake_case pattern (get_instance_status, list_projects, create_scope, create_finding, etc.). No mixed conventions or vague single-word verbs.

Tool Count5/5

Ten tools is well within the ideal 3-15 range and each maps to a meaningful operation in the Caido workflow. Nothing feels padded or redundant.

Completeness3/5

The server covers read-heavy discovery plus create for scopes and findings, but lacks update/delete operations for scopes and findings, and filter presets are list-only. Agents cannot fully manage the lifecycle of the artifacts they create, which are notable gaps.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues