List MCP Tokens
Retrieve all MCP tokens associated with an account.
Path Parameters
Account identifier (format: acc_ followed by 27 alphanumeric characters)
Bearer token for authentication
Response
Indicates if there are more records to paginate through
Unique MCP token identifier (format: mcp_ prefix)
Account identifier this token belongs to
Environment this token is scoped to
Array of bucket SIDs this token can access. Empty array means all buckets in the environment.
Masked token value (full value only shown on creation)
Whether this token has been revoked
ISO 8601 timestamp of last token usage (nullable)
ISO 8601 timestamp of token creation
curl -X GET "https://api.apitraffic.io/v1/accounts/acc_abc123def456ghi789jkl012/mcpTokens" \
-H "Authorization: Bearer your-jwt-token"
{
"hasMore": false,
"records": [
{
"sid": "mcp_abc123def456ghi789jkl012",
"accountSid": "acc_abc123def456ghi789jkl012",
"environmentSid": "prod01",
"bucketSids": [],
"name": "Claude Desktop - Production",
"token": "mcp_2abc1*******ef789",
"isRevoked": false,
"lastUsedAt": "2025-03-15T14:30:00.000Z",
"createdAt": "2025-03-15T10:30:00.000Z",
"updatedAt": "2025-03-15T10:30:00.000Z",
"revokedAt": null
}
]
}
Create MCP Token
Create a new MCP token for AI assistant access. MCP tokens are read-only and scoped to a specific environment and set of buckets.
Path Parameters
Bearer token for authentication
Request Body
A descriptive name for the MCP token (e.g. “Claude Desktop - Production”)
The environment SID this token should be scoped to
Array of bucket SIDs to restrict access to. Leave empty or omit to grant access to all buckets in the environment.
Response
Returns the created MCP token with the full token value (only shown once).
The token value is only returned once during creation. Store it securely as it cannot be retrieved again.
curl -X POST "https://api.apitraffic.io/v1/accounts/acc_abc123def456ghi789jkl012/mcpTokens" \
-H "Authorization: Bearer your-jwt-token" \
-H "Content-Type: application/json" \
-d '{
"name": "Claude Desktop - Production",
"environmentSid": "prod01",
"bucketSids": []
}'
{
"sid": "mcp_abc123def456ghi789jkl012",
"accountSid": "acc_abc123def456ghi789jkl012",
"environmentSid": "prod01",
"bucketSids": [],
"name": "Claude Desktop - Production",
"token": "mcp_2abc1d3e4f5g6h7i8j9k0l1m2n3o4p5q6r7s8t9u0v1w2x3y4z",
"isRevoked": false,
"lastUsedAt": null,
"createdAt": "2025-03-15T10:30:00.000Z",
"updatedAt": "2025-03-15T10:30:00.000Z",
"revokedAt": null
}
Update MCP Token
Update an existing MCP token’s name or bucket scope.
Path Parameters
Bearer token for authentication
Request Body
Updated name for the token
Updated array of bucket SIDs (empty = all buckets in environment)
curl -X PUT "https://api.apitraffic.io/v1/accounts/acc_abc123def456ghi789jkl012/mcpTokens/mcp_abc123def456ghi789jkl012" \
-H "Authorization: Bearer your-jwt-token" \
-H "Content-Type: application/json" \
-d '{
"name": "Claude Desktop - Staging",
"bucketSids": ["abc1234", "def5678"]
}'
{
"sid": "mcp_abc123def456ghi789jkl012",
"accountSid": "acc_abc123def456ghi789jkl012",
"environmentSid": "prod01",
"bucketSids": ["abc1234", "def5678"],
"name": "Claude Desktop - Staging",
"token": "mcp_2abc1*******ef789",
"isRevoked": false,
"lastUsedAt": "2025-03-15T14:30:00.000Z",
"createdAt": "2025-03-15T10:30:00.000Z",
"updatedAt": "2025-03-15T15:00:00.000Z",
"revokedAt": null
}
Revoke MCP Token
Revoke an MCP token, immediately terminating access for any AI assistants using it.
This action is immediate. Any AI assistants using this token will lose access instantly.
Path Parameters
Bearer token for authentication
curl -X DELETE "https://api.apitraffic.io/v1/accounts/acc_abc123def456ghi789jkl012/mcpTokens/mcp_abc123def456ghi789jkl012" \
-H "Authorization: Bearer your-jwt-token"
{
"sid": "mcp_abc123def456ghi789jkl012",
"deleted": true
}