Skip to content

fix: report conflicting server names when merging referenced MCP tools - #7152

Closed
iuiu-py wants to merge 1 commit into
1Panel-dev:v2from
iuiu-py:fix/mcp-referenced-config-conflict
Closed

iuiu-py wants to merge 1 commit into
1Panel-dev:v2from
iuiu-py:fix/mcp-referenced-config-conflict

Conversation

@iuiu-py

@iuiu-py iuiu-py commented Sep 22, 2026

Copy link
Copy Markdown

问题

  • 引用(referencing)多个 MCP 工具时,服务端配置字典按键名直接合并。服务名是用户自定义的自由文本,两个被引用的 MCP 工具若定义了同名服务,后者会整体覆盖前者且无任何日志/报错,导致模型只看到其中一个服务的工具(issue [Bug] 使用多个MCP时,只会选择一个MCP服务 #7120:两个 MCP 同时挂载时能源 MCP 工具完全消失,单独挂载均正常)。

修复

  • 合并循环中检测不同 MCP 工具贡献的同名服务键,冲突时抛出带冲突服务名的 AppApiException,让失败显式化并提示用户改名,而不是静默丢弃服务。
  • 两处同段复制代码(简单应用 base_chat_step.py、工作流 AI 对话节点 base_chat_node.py)同步修改。

Fixes #7120

Referencing multiple MCP tools merges their server config dicts by key.
Server names are user-defined free text, so two referenced tools defining
the same server name silently overwrote each other and only the last
server's tools were visible (issue 1Panel-dev#7120) — every tool worked when
referenced alone.

Raise an explicit error naming the conflicting servers instead of
dropping them silently.

Fixes 1Panel-dev#7120

Signed-off-by: wangzifei <wangzifei@cit.group.hk>
@liuruibin

Copy link
Copy Markdown
Member

diff 看不出你改了什么东西

@liuruibin liuruibin closed this Sep 23, 2026
@good-ideal

Copy link
Copy Markdown

diff 看不出你改了什么东西

我对比了下他提交代码差异,其实我的问题就是出在这儿,我使用了相同的服务名
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 使用多个MCP时,只会选择一个MCP服务

3 participants