MCP · Tools
Tools: keys
Four tools on the management plane. Two require a signed-in human when the key is a secret key. Descriptions are quoted as the agent reads them. The meaning of each key class is in Keys and identities.
list_keys#
List a project's API keys (prefixes and metadata; secret values are never returned). Some fields are graded on human elevation.
| Parameter | Type | Required |
|---|---|---|
project_id | string | yes |
Calls GET /v1/projects/:pid/keys. Without a human: { id, kind, name, created_at, revoked_at, status }, plus inert on a publishable key — always false since 2026-09-07, kept only for compatibility. With one: prefix, last_used_at, grace_until, the rotating status and the accountability fields. The account key itself is never in this list.
create_key — human required for sk#
Create an API key for a project. 'pk' = publishable (client apps), 'sk' = secret (server-side). The secret value is shown ONCE. Creating an 'sk' key requires human elevation (MANYBASES_ACCOUNT_SESSION).
| Parameter | Type | Required | Meaning |
|---|---|---|---|
project_id | string | yes | |
kind | "pk" or "sk" | yes | |
name | string, 1–64 | yes | What this key is for — "web app", "staging server". It is what tells you which key to revoke later. |
Calls POST /v1/projects/:pid/keys. The value comes back once and is never readable again. A pk created by an agent alone signs users up like any other — until 2026-09-07 it was “inert” and could not. An sk cannot be created without the elevation token: the API answers 401 and issues nothing.
rotate_key — human required for sk#
Rotate a key: a new value is issued and the old one keeps working until its grace window ends — unless revoke_previous is true, which cuts it at once. Rotating an 'sk' key requires human elevation.
| Parameter | Type | Required |
|---|---|---|
project_id | string | yes |
key_id | string | yes |
revoke_previous | boolean | no |
Calls POST /v1/projects/:pid/keys/:kid/rotate. The grace is 24 hours; the two values share the same rate limit. revoke_previous: true cuts the previous value at once — the gesture for a key that leaked. A value that is no longer live cannot be rotated (403). A function's key (fn: name) is refused here — use rotate_function_secret.
revoke_key#
Revoke a key immediately. No human elevation required — cutting off a leaked key must not wait.
| Parameter | Type | Required |
|---|---|---|
project_id | string | yes |
key_id | string | yes |
Calls DELETE /v1/projects/:pid/keys/:kid. No grace: the key is refused from the next request on, everywhere, and there is no way back — the next step is create_key. A 503 means the cut is not confirmed yet: call it again until it succeeds. Revoking the newest value of a rotating key cuts the previous one too; revoking the previous one cuts only that one. Revoking the key the request itself presents is refused with 403. Revoking a function's key is allowed and stops that function's data access at once.
