---
title: "Revoke a person's MCP connection"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.nicer.travel/llms.txt
> Use this file to discover all available pages before exploring further.

# Revoke a person's MCP connection

Path: Nicer API › Assistant

`DELETE /agent/users/{userId}/mcp/connections/{connectionId}`

URL: `https://api.nicer.travel/agent/users/{userId}/mcp/connections/{connectionId}`

Revokes one person's MCP connection, for Nicer staff: for a lost laptop or a client that should not have access. Its tokens stop working on their next request, because the MCP server checks the token on every request. A connection the person does not hold is a 404. A caller without the superadmin platform role gets 403 `ERROR_FORBIDDEN`; a token minted from a connection gets 403 `ERROR_MCP_SESSION_REQUIRED`.

## Authentication

- `bearerAuth`, http bearer, header `Authorization`, format `JWT`

## Path parameters

- `userId` (`agent.users.mcp.connections.delete.path.userId`; string, required)
- `connectionId` (`agent.users.mcp.connections.delete.path.connectionId`; string, required)

## Code samples

### JavaScript SDK

```javascript
import { createClient } from "@nicertravel/sdk";

const nicer = createClient({
  baseUrl: "https://api.nicer.travel",
  token: process.env.NICER_TOKEN,
});

await nicer.agent.users.mcp.connections.delete({
  "userId": "string",
  "connectionId": "string"
});
```

### Nicer CLI

```bash
nicer agent users mcp connections delete --user-id 'string' --connection-id 'string'
```

### cURL

```bash
curl --request DELETE \
  --url 'https://api.nicer.travel/agent/users/<userId>/mcp/connections/<connectionId>' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/agent/users/<userId>/mcp/connections/<connectionId>';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.nicer.travel/agent/users/<userId>/mcp/connections/<connectionId>"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "connectionId": "string"
}
```

- `connectionId` (`agent.users.mcp.connections.delete.response.200.connectionId`; string, required) — The id of the connection that no longer works: its tokens are refused from the next request on.
  - minLength: `1`

### 400

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`agent.users.mcp.connections.delete.response.400.errorCode`; string, required)
- `errorMessage` (`agent.users.mcp.connections.delete.response.400.errorMessage`; string, required)

### 401

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`agent.users.mcp.connections.delete.response.401.errorCode`; string, required)
- `errorMessage` (`agent.users.mcp.connections.delete.response.401.errorMessage`; string, required)

### 403

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`agent.users.mcp.connections.delete.response.403.errorCode`; string, required)
- `errorMessage` (`agent.users.mcp.connections.delete.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/Assistant/agent.users.mcp.connections.delete/index.md
