Skip to main content

List MCP Tokens

Retrieve all MCP tokens associated with an account.

Path Parameters

accountSid
string
required
Account identifier (format: acc_ followed by 27 alphanumeric characters)

Headers

Authorization
string
required
Bearer token for authentication

Response

hasMore
boolean
Indicates if there are more records to paginate through
records
array
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

accountSid
string
required
Account identifier

Headers

Authorization
string
required
Bearer token for authentication

Request Body

name
string
required
A descriptive name for the MCP token (e.g. “Claude Desktop - Production”)
environmentSid
string
required
The environment SID this token should be scoped to
bucketSids
array
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

accountSid
string
required
Account identifier
mcpTokenSid
string
required
MCP token identifier

Headers

Authorization
string
required
Bearer token for authentication

Request Body

name
string
Updated name for the token
bucketSids
array
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

accountSid
string
required
Account identifier
mcpTokenSid
string
required
MCP token identifier

Headers

Authorization
string
required
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
}