await api.mcp.disconnect("example"); // { ok: true }api.mcp.disconnect("example") # {"ok": True}What goes
- The address, the label and the category.
- The token.
- The recorded catalogue and the allowed list.
The server is not notified
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
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
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
A name that is not connected answers 404. There is nothing else to go wrong — no request leaves for the server.