# disconnect()

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

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

删除连接及其标记。 服务器没有被告知任何信息, 它不知道它连接过 。

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

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

## 发生什么 {#what}

- 地址、标签和类别。
- 象征
- 记录目录和允许清单。

## 服务器未通知 {#server}

> **连接是我们这边的记录**
>
> 没有任何会议可以结束:这个客户所说的协议修订是无国籍的,所以“连接”只是“我们有它的地址和象征性的”而已。在发出该标志的地方,就取消它本身。

## 下一场跑步时失去的代理 {#runs}

服务器列表在每次运行的开始处重新读取, 断开功能对下一个运行生效, 而已经在运行中的运行保存着它所装入的东西 。

## 温柔版本 {#alternative}

`update(name, { tools: [] })` 保留连接并声明不做。 最好在您想阻止服务器到达运行时不丢失证书 。

## 错误 {#errors}

一个没有连接到的名称 答案 404 。 没有什么可以出错的了 , 没有服务器的请假 。

- [update()](/zh/sdk/ref/mcp/update): 把它关掉
- [api.mcp](/zh/sdk/ref/mcp): 连接、列出和使用服务器。

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