# disconnect()

Canonical URL: https://developers.iagenify.com/sdk/ref/mcp/disconnect/
Language: en

`api.mcp.disconnect(name) → Promise<{ ok: true }>`

Removes the connection and its token. Nothing is told to the server — it has no idea it was connected.

Status: removes the token · nothing is told · runs lose it immediately

```javascript
await api.mcp.disconnect("example");   // { ok: true }
```

## What goes {#what}

- The address, the label and the category.
- The token.
- The recorded catalogue and the allowed list.

## The server is not notified {#server}

> **A connection is a record on our side**
>
> There is no session to end: the protocol revision this client speaks is stateless, so « connected » only ever meant « we have its address and a token ». Revoking the token itself is done where it was issued.

## Running agents lose it at their next run {#runs}

The server list is re-read at the start of every run, so a disconnection takes effect on the next one — and a run already in flight keeps what it loaded.

## The gentler version {#alternative}

`update(name, { tools: [] })` keeps the connection and declares nothing. Prefer it when you want to stop a server reaching your runs without losing the credential.

## Errors {#errors}

A name that is not connected answers 404. There is nothing else to go wrong — no request leaves for the server.

- [update()](/sdk/ref/mcp/update): Turning it off instead.
- [api.mcp](/sdk/ref/mcp): Connecting, listing and using a server.

```python
api.mcp.disconnect("example")   # {"ok": True}
```
