Claude Platform Docs

Tunnels

Create Tunnel
client.Beta.Tunnels.New(ctx, params) (*BetaTunnel, error)
POST/v1/tunnels
Get Tunnel
client.Beta.Tunnels.Get(ctx, tunnelID, query) (*BetaTunnel, error)
GET/v1/tunnels/{tunnel_id}
List Tunnels
client.Beta.Tunnels.List(ctx, params) (*PageCursor[BetaTunnel], error)
GET/v1/tunnels
Archive Tunnel
client.Beta.Tunnels.Archive(ctx, tunnelID, body) (*BetaTunnel, error)
POST/v1/tunnels/{tunnel_id}/archive
Reveal Tunnel Token
client.Beta.Tunnels.RevealToken(ctx, tunnelID, body) (*BetaTunnelToken, error)
POST/v1/tunnels/{tunnel_id}/reveal_token
Rotate Tunnel Token
client.Beta.Tunnels.RotateToken(ctx, tunnelID, params) (*BetaTunnelToken, error)
POST/v1/tunnels/{tunnel_id}/rotate_token
Models
type BetaTunnel struct{…}

An MCP tunnel.

ID string

Unique identifier for the tunnel, prefixed with tnl_.

ArchivedAt Time

A timestamp in RFC 3339 format

formatdate-time
CreatedAt Time

A timestamp in RFC 3339 format

formatdate-time
DisplayName string

Human-readable name for the tunnel (1-255 characters). Null if unset.

Domain string

Anthropic-assigned hostname for the tunnel. MCP server URLs whose host is a subdomain of this value are routed through the tunnel. Globally unique and never reused, even after the tunnel is archived.

Type Tunnel
type BetaTunnelToken struct{…}

A tunnel's connector token.

ID string

Stable identifier for the current token value. Changes when the token is rotated.

TunnelToken string

The connector token used to run the tunnel. Treat as a credential.

Type TunnelToken
Create Tunnel Certificate
client.Beta.Tunnels.Certificates.New(ctx, tunnelID, params) (*BetaTunnelCertificate, error)
POST/v1/tunnels/{tunnel_id}/certificates
Get Tunnel Certificate
client.Beta.Tunnels.Certificates.Get(ctx, certificateID, params) (*BetaTunnelCertificate, error)
GET/v1/tunnels/{tunnel_id}/certificates/{certificate_id}
List Tunnel Certificates
client.Beta.Tunnels.Certificates.List(ctx, tunnelID, params) (*PageCursor[BetaTunnelCertificate], error)
GET/v1/tunnels/{tunnel_id}/certificates
Archive Tunnel Certificate
client.Beta.Tunnels.Certificates.Archive(ctx, certificateID, params) (*BetaTunnelCertificate, error)
POST/v1/tunnels/{tunnel_id}/certificates/{certificate_id}/archive