ModelEngine-Group / ModelEngine-Group/nexent

fix(mcp): unbind deleted MCP tools from agent drafts

Open
#3,935 0 comments 0 reactions 1 assignee View on GitHub

@xuyaqist is already working on this.

Since Sep 16, 2026.

Improvement Medium
Dominant language
Python
Stars
5.9k
Forks
731
Avg merge
19h 34m
Merged PRs (30d)
172

Description

问题现象

删除 MCP 服务后,该服务下的工具会被标记为不可用,但已经配置这些工具的 Agent 仍保留对应绑定。由于工具不再出现在可选工具列表中,用户既无法继续使用,也无法从 Agent 配置中正常删除这些残留工具。

复现步骤

  1. 创建或配置一个 MCP 服务。
  2. 将该服务下的部分工具绑定到一个 Agent。
  3. 删除该 MCP 服务。
  4. 重新打开 Agent 的工具配置。

实际行为

Agent 草稿中的工具绑定仍然存在,但对应工具已不可用,形成无法使用、无法移除的残留关系。

期望行为

删除 MCP 服务时:

  • 将该服务下的工具标记为不可用。
  • 自动软删除对应 Agent 草稿中 version_no=0 的工具绑定。
  • 保留 version_no>0 的已发布版本历史快照。
  • 用户可在清理草稿后重新发布 Agent,以更新线上版本。
  • 如果绑定清理失败,不继续删除 MCP 记录,避免产生不一致状态。

验收标准

  • MCP 服务对应的工具被标记为不可用。
  • 所有相关 Agent 草稿绑定被软删除。
  • 已发布版本的工具绑定保持不变。
  • 无匹配工具或草稿绑定时,删除流程正常完成。
  • 清理失败时不会删除 MCP 服务记录。
  • 增加覆盖上述行为的后端单元测试。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.