---
title: "Revoke a tunnel's live grant"
method: POST
path: "/projects/{projectId}/tunnels/{serverId}/close"
tags: ["Tunnels"]
---

# Revoke a tunnel's live grant

`POST /projects/{projectId}/tunnels/{serverId}/close`

Revokes the grant at the control plane and edge: the public URL stops working immediately and any live tunnel session is disconnected. The server record — including its now-dead `url` — is intentionally left untouched, so the next create revives the tunnel with the same slug.

## Path parameters

- `projectId` string, required
- `serverId` string, required

## Response `200`

Grant revoked; the server record is unchanged.

- TunnelClosed
  - `serverId` string, required
  - `status` 'closed', required

## Other responses

- `401` — Missing, invalid, revoked, or orphaned key (`UNAUTHORIZED`) — or the **target MCP server** needs an OAuth grant (`OAUTH_REQUIRED`), which is a property of the server, not your key.
- `403` — Key is valid but not allowed to do this.
- `404` — Unknown project, server, or resource.
- `429` — Per-key rate limit exceeded (60 requests/minute sustained, bursts up to 10). Honor `Retry-After` and back off with jitter.
- `500` — Something failed on MCPJam's side.
- `502` — Could not connect to the target MCP server.

---

[API](https://skmtc.net/mcpjam/apis/mcpjam-api.md) · [All operations](https://skmtc.net/mcpjam/apis/mcpjam-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mcpjam/mcpjam-api/versions/b767df188d0c/schema)
