/mcp/tokensCreate MCP Token
Mints the bearer token an MCP client presents to the project's MCP endpoint.
The body names the tools the token may call: project functions, all functions of named extensions, and tools on the project's registered MCP servers.
There is no wildcard. ttlSeconds is 60 to 3600 (one hour).
The token is minted from an operator session, not a personal access token, and it works only on the MCP endpoint.
It is revoked by its jti.
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
| tools | object | The functions the token may call. Required unless At most 100 tools in all, functions and external tools together. |
| functions | string[] | Names of individual functions the token may call. No wildcards. |
| extensions | string[] | Slugs of extensions: the token may call every function of each one that exists now. Functions added later are not included. |
| externalTools | object[] | Tools on the project's registered MCP servers that the token may call, each named by server and tool. The caller must be allowed to call that server. |
| server * | string | The name of a registered MCP server of this project. |
| tool * | string | The tool on that server. |
| ttlSeconds | integer | How long the token lasts, in seconds: 60 to 3600. Default 3600. |
| HTTP | K9O Code | Description |
|---|---|---|
| 201 | Created | |
| 400 | K9O_INVALID_FIELD_VALUE | The tool selection is empty, names a wildcard, or names something that is not a function name or extension slug. |
| 403 | K9O_FORBIDDEN | The caller is an MCP token, a plugin token, a delegated agent or a sandbox token; none of these can mint. |
| 403 | K9O_IAM_POLICY_DENIED | The caller is not an operator, or the bound IAMPolicy ceiling denies functions:invoke for the caller. |
| 404 | K9O_NOT_FOUND | The caller has no access to the project, or a selected function or extension has no active extension function on the project. |
| data * | object | |
| token * | string | The bearer token for the MCP endpoint. It is shown only in this response. |
| tokenId * | string | The token's id: use it to revoke the token with |
| tokenType * | "Bearer" | Always |
| scope * | string | The scope the token carries: |
| audience * | string | The MCP endpoint URI the token is bound to. Another project's endpoint refuses it. |
| tools * | string[] | The functions the token may call, resolved to names at mint time. |
| externalTools * | object[] | The external MCP tools the token may call. |
| server * | string | The registered MCP server. |
| tool * | string | The tool on that server. |
| name * | string | The tool's name in |
| expiresAt * | string <date-time> | When the token stops working. |
| meta * | any |
curl -X POST 'https://<org>.api-<region>.k9o.io/@storefront/mcp/tokens' \
-H 'Authorization: Bearer $K9O_TOKEN' \
-H 'Content-Type: application/json' \
-d '{}'Showing example in cURL
{
"tools": {
"functions": [
"string"
],
"extensions": [
"string"
]
},
"externalTools": [
{
"server": "string",
"tool": "string"
}
],
"ttlSeconds": 0
}{
"data": {
"token": "string",
"tokenId": "string",
"tokenType": "Bearer",
"scope": "string",
"audience": "string",
"tools": [
"string"
],
"externalTools": [
{
"server": "string",
"tool": "string",
"name": "string"
}
],
"expiresAt": "string"
}
}