Create Mcp Token
POST
/api/mcp/tokens
const url = 'http://localhost:8000/api/mcp/tokens';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"capabilities":["example"],"name":"","ttl_days":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8000/api/mcp/tokens \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "capabilities": [ "example" ], "name": "", "ttl_days": 1 }'Mint a token bound to the caller’s current workspace. Plaintext shown once.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Successful Response
Media typeapplication/json
TokenCreated
object
capabilities
required
Capabilities
Array<string>
id
required
Id
string
name
required
Name
string
prefix
required
Prefix
string
token
required
Token
string
workspace_id
required
Workspace Id
string
Examplegenerated
{ "capabilities": [ "example" ], "created_at": "example", "expires_at": "example", "id": "example", "last_used_at": "example", "name": "example", "prefix": "example", "revoked_at": "example", "token": "example", "workspace_id": "example"}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}