# MCP for agents

> Switchboard exposes scoped tools over Model Context Protocol JSON-RPC at `POST /v1/mcp`. Same bearer key as HTTP; tool names are `connector.op`.

## Endpoint

```http
POST /v1/mcp
Authorization: Bearer sb_live_agt_…
Content-Type: application/json
```

## tools/list

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list",
  "params": { "toolset": "ai" }
}
```

Alias method: `sb_search_operations`.

Optional `toolset` filters (e.g. `ai`, `marketing`) to the key’s MCP toolsets. Only ops with `mcp.expose: true` in connector YAML appear.

## tools/call

```json
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "twilio.send_sms",
    "arguments": { "To": "+15550192", "Body": "hi" }
  }
}
```

`name` must be `connector.op`. Arguments map to the hub op body.

## Approvals

If `mcp.requires_approval` is set on the op, the first call may return an approval-pending result. Operators approve/deny in Control Room (`/v1/approvals`). Denied → JSON-RPC error `approval_denied`.

Agent keys are the intended caller kind for MCP traffic.

## Relationship to HTTP

| Concern | MCP | HTTP |
|---|---|---|
| List capabilities | `tools/list` | `GET /v1/connectors` |
| Invoke op | `tools/call` name=`connector.op` | `POST /v1/call/connector.op` |
| AI chat | tool wrapping proxy/tiers | `/v1/proxy/switchboard/…` |
| Auth | same Bearer | same Bearer |

Prefer MCP when the runtime is an agent tool loop. Prefer HTTP/SDK when the runtime is a product backend.
