# MCP keys

> Mint, list and revoke MCP keys for one account's end user.

URL: https://docs.workwae.com/reference/mcp-keys

Guides: [MCP for your users](/guides/mcp/for-your-users), [MCP server](/guides/mcp).

| Method | Path | Operation | Scope |
| --- | --- | --- | --- |
| `GET` | `/v1/accounts/{accountId}/mcp-keys` | [List an account's MCP keys](#list-an-accounts-mcp-keys) | `admin` |
| `POST` | `/v1/accounts/{accountId}/mcp-keys` | [Mint an MCP key for an account's user](#mint-an-mcp-key-for-an-accounts-user) | `admin` |
| `DELETE` | `/v1/accounts/{accountId}/mcp-keys/{keyId}` | [Revoke an MCP key](#revoke-an-mcp-key) | `admin` |

## List an account's MCP keys

`GET /v1/accounts/{accountId}/mcp-keys`

TypeScript SDK method: `workwae.mcpKeys.list()`

Newest first, without their secrets; revoked keys are left out.

Required scope: `admin`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |

### Responses

- **200** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | object[] | yes |  |
| `items[].id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `items[].name` | string | yes |  |
| `items[].prefix` | string | yes |  |
| `items[].scopes` | ("read" \| "write" \| "send")[] | yes |  |
| `items[].accountId` | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `items[].expiresAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].lastUsedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `items[].sendPolicy` | object \| null | yes |  |
| `items[].sendPolicy.mode` | "allow" \| "confirm" \| "drafts_only" | no |  |
| `items[].sendPolicy.allowedRecipientDomains` | string[] \| null | no |  |
| `items[].sendPolicy.dailySendLimit` | integer \| null | no |  |
| `items[].sendPolicy.externalRecipientConfirmation` | boolean | no |  |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 404: `account_not_found`
  - 409: `idempotency_key_in_progress`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Mint an MCP key for an account's user

`POST /v1/accounts/{accountId}/mcp-keys`

TypeScript SDK method: `workwae.mcpKeys.create()`

The key is returned once; it is not retrievable later. It works only at the MCP server (mcpUrl, sent as `Authorization: Bearer <key>`), only for this account and with these scopes; every other route answers it with mcp_only_key. MCP clients that send a header take it (Claude Code, Cursor, Codex and the like); Claude.ai and ChatGPT custom connectors sign in with OAuth instead. Needs the admin scope and a key that is not bound to accounts. Revoked with the account when it is deleted.

Required scope: `admin`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |

### Request body (required)

Content type `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | 1 to 100 characters. Default `"MCP"`. |
| `scopes` | ("read" \| "write" \| "send")[] | yes | At least 1 item. |
| `expiresAt` | string (date-time) \| null | no | Example `"2026-05-04T09:30:00.000Z"`. |
| `sendPolicy` | object \| null | no |  |
| `sendPolicy.mode` | "allow" \| "confirm" \| "drafts_only" | no |  |
| `sendPolicy.allowedRecipientDomains` | string[] \| null | no |  |
| `sendPolicy.dailySendLimit` | integer \| null | no |  |
| `sendPolicy.externalRecipientConfirmation` | boolean | no |  |

### Responses

- **201** OK (application/json, object)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Example `"c4e6a8b0-1d3f-4a5c-8e7b-9d1f3a5c7e9b"`. |
| `name` | string | yes |  |
| `prefix` | string | yes |  |
| `scopes` | ("read" \| "write" \| "send")[] | yes |  |
| `accountId` | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `expiresAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `createdAt` | string (date-time) | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `lastUsedAt` | string (date-time) \| null | yes | Example `"2026-05-04T09:30:00.000Z"`. |
| `sendPolicy` | object \| null | yes |  |
| `sendPolicy.mode` | "allow" \| "confirm" \| "drafts_only" | no |  |
| `sendPolicy.allowedRecipientDomains` | string[] \| null | no |  |
| `sendPolicy.dailySendLimit` | integer \| null | no |  |
| `sendPolicy.externalRecipientConfirmation` | boolean | no |  |
| `key` | string | yes |  |
| `mcpUrl` | string (uri) | yes | Example `"https://app.example.com/"`. |

- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 404: `account_not_found`
  - 409: `idempotency_key_in_progress`, `mcp_key_limit`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`

## Revoke an MCP key

`DELETE /v1/accounts/{accountId}/mcp-keys/{keyId}`

TypeScript SDK method: `workwae.mcpKeys.delete()`

The MCP server refuses the key from its next request on.

Required scope: `admin`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Example `"6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"`. |
| `keyId` | path | string (uuid) | yes | Example `"5fe5a352-781d-4daa-a11d-c85fa8118da2"`. |

### Responses

- **204** OK (application/json, any)
- **Errors**, by status and `code` (see [Errors](/guides/errors)):
  - 400: `invalid_input`, `invalid_idempotency_key`
  - 401: `unauthenticated`, `api_key_expired`
  - 403: `missing_scope`, `role_forbidden`, `account_token_forbidden`, `account_scope_forbidden`, `mcp_only_key`
  - 404: `account_not_found`, `mcp_key_not_found`
  - 409: `idempotency_key_in_progress`
  - 413: `payload_too_large`
  - 422: `idempotency_key_reused`
  - 429: `rate_limited`, `too_many_requests`
  - 500: `internal_error`
  - 503: `overloaded`
