Skip to main content
An MCP session is an opaque bearer for POST /v1/mcp. It carries an organization, control-plane scopes, an explicit tool allowlist, an expiry and, optionally, an identity as a label. The label is not enforced yet: a session acts on any identity its scopes and tools reach. Use one instead of a general API key when an MCP client should have a bounded lifetime and blast radius. Making a session with chosen scopes and tools needs admin. A signed-in person can connect their own agent and manage it. The routes are withheld from the MCP catalog itself, so a model cannot mint, enumerate, or revoke credentials.

Connect your own agent

A signed-in person of any role sends a name alone and gets a connected agent:
It is bound to them (member_id), holds a plain member’s scopes whatever their role, reaches any tool those scopes allow (its allowed_tools is empty, and tools/list shows it tools_search and tools_execute, which find and run the rest), and lasts 90 days unless expires_in_seconds says less. The reply adds url, the address to give the agent. Removing the person deletes it. API keys and agents cannot make one. Approving an app that signs in with OAuth, such as Claude or ChatGPT, makes the same kind of connected agent, without a secret anyone sees. Its name is the app’s name, its tokens work only at /v1/mcp, and its expires_at moves forward each time the app refreshes, so it ends after 90 days unused. Revoking it disconnects the app. A person lists, reads and revokes their own; an owner or admin, everyone’s. Nobody else reaches these routes.

Create

POST /v1/mcp_sessions
scopes and allowed_tools need admin, and API keys may use them. expires_in_seconds defaults to one day and must be between 60 seconds and 90 days. Duplicate scopes and tool names are collapsed. If identity_id is present, it must name an identity in the same organization (404 otherwise), and scopes and allowed_tools must be sent with it: a connected agent acts as its person and takes no identity (400 validation_failed). The response contains secret exactly once. Store it as a secret; the server stores only its SHA-256 digest. Later reads expose the non-sensitive prefix so an operator can identify the credential without replaying it.
The secret is shown only in this response. It is random and unrelated to the session’s id; only its SHA-256 and the prefix are stored. Use it as the MCP endpoint bearer:
tools/list returns only allowed_tools. A call must also satisfy its underlying route scope; allowlisting a tool never widens scopes. The bearer also works on the REST route behind an allowlisted tool, but never on a route the MCP catalog withholds (creating or rotating API keys, creating MCP sessions, and the like), whatever the allowlist names: those answer 403. Expiry and revocation are checked from storage on every request, so revocation has no cache-delay window.

List and inspect

  • GET /v1/mcp_sessions
  • GET /v1/mcp_sessions/{id}
Both return metadata only. Neither returns secret nor secret_hash.

Revoke

DELETE /v1/mcp_sessions/{id} marks an active credential revoked. The next request made with that bearer receives 401 unauthorized. Revocation is one-way; mint a new session to restore access.

TypeScript