v1

latestOpenAPI 3.0.02026-07-174565114.3 KB
Auth

Create an MCP access token

Creates a JWT MCP access token for the project. If threadId is provided, the token will be bound to that thread. If threadId is omitted, a sessionless token will be created using the provided contextKey (or from Bearer token if not provided). Sessionless tokens can only access resources and prompts, not session-specific features. The token expires in 15 minutes and can be used as a bearer token.

post/auth/mcp/access-token

Request body

threadIdstring

Thread ID for the MCP access token. If provided, the token will be bound to this thread. If omitted, a sessionless token will be created.

contextKeystring

Context key for sessionless MCP access tokens. If not provided, will be extracted from Bearer token.

Example request

{
  "threadId": "thread-123",
  "contextKey": "user-context-123"
}

Response

MCP access token created successfully

mcpAccessTokenstring

JWT MCP access token to be used as bearer token. Only included when MCP servers are configured for the project.

expiresAtnumber

Expiration time of the token in milliseconds since epoch. Only included when mcpAccessToken is present.

hasSessionboolean

Whether the token is bound to a specific thread session. Only included when mcpAccessToken is present.

Example response

{
  "mcpAccessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expiresAt": 1704123456789,
  "hasSession": true
}