Skip to main content
POST
Create (or revive) a relay tunnel for a named project server

Authorizations

Authorization
string
header
required

MCPJam API key (sk_…). Create one at Settings → API keys. Guest sessions cannot use the API, and API keys cannot manage other API keys.

Path Parameters

projectId
string
required

ID of the hosted project that contains the server.

Body

application/json
name
string
required

Server name to register the tunnel under. Reusing an existing server's name points that record at the tunnel: its url is overwritten and stdio records are converted to transportType: "http".

Required string length: 1 - 128

Response

Tunnel grant minted and the server record updated.

Everything the caller needs to host the tunnel connection. Treat the whole object as a credential: url embeds the plaintext ?k= bearer secret and connectToken authenticates the relay WebSocket.

serverId
string
required

The registered project server's ID.

name
string
required
existed
boolean
required

True when a server record with this name already existed (its config now points at the tunnel).

slug
string
required

Stable public subdomain slug; survives re-creates for the same server.

url
string
required

Public tunnel URL including the ?k= bearer secret. Also persisted on the server record's url.

connectToken
string
required

Bearer for the relay edge WebSocket handshake.

relayWsUrl
string
required

Relay edge WebSocket endpoint to connect to.

previousUrl
string

The record's previous URL, present when it existed with a different one (it has been overwritten).

previousTransportType
string

The record's previous transport, present when it existed (a stdio record has been converted to http).

connectTokenExpiresAt
number

Epoch-ms expiry of connectToken.

secretVersion
number

Monotonic secret version; each create bumps it.