Proposal: support for sending `tools/list_changed` notifications manually
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先跟踪 AddTools 和 RemoveTools 在 Go SDK 中如何触发 tools/list_changed 通知。确定服务器通知路径,并确定当工具在服务器启动前注册时,调用方如何请求相同的通知。当调用方无需添加或删除虚拟工具即可手动发送该通知,且相关测试覆盖了这一行为时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
At the moment in this library it seems to only be possible to send a tools/list_changed notifications when one of two events are triggered: AddTools and RemoveTools. In the GitHub MCP Server we would like to extend this so that these notifications can be sent when other conditions occur such as a mismatch in the version of the MCP server in a session and the client. At this point in time, this does not seem to be possible.
Describe the solution you'd like
For context, we create a new mcp.Server instance per request, since each user may have different tools depending on factors such as their license, the client the token was minted for, if they are a staff user, or if they have a feature toggled on. Because we construct a server for each request, we never add new tools to a server, they are simply there before the server is started.
That being said, we do need a way of notifying clients that new tools are available when they are released. We're looking at doing this via this notification when the available tools differ from what is stored in their session (which is handled outside the scope of the MCP server's internal sessions.)
Describe alternatives you've considered
-
Forcing tool registration changes: We considered artificially adding/removing a dummy tool to trigger the notification, but this is hacky and pollutes the tool list unnecessarily.
-
We've also looked at intercepting requests and return a 400, invalidating a MCP session and theoretically having the client reinitialise their connection thereby getting a new tool list. In practice this is not well supported, while this works in VSCode for example, in Claude Code it results in a persistent broken connections until the agent runtime is restarted.
cc @omgitsads
- 主要语言
- Go
- 星标
- 5.2k
- 派生
- 594
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 63
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/go-sdk 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
modelcontextprotocol/go-sdk#1444 · 2 条评论 ·
维护者通常 1 天内回复
-
Session-lifecycle bookkeeping logs at info, spamming multiple log lines per request on stateless streamable HTTP可能已有人在做 @anneheartrecord 于 58 天前认领。 未关闭P3
难度 2/5 1-3 小时 新手友好度 75/100
modelcontextprotocol/go-sdk#1204 · 1 个 reaction ·
维护者通常 1 天内回复
-
Expose generic `SendNotification` on `ServerSession` for custom protocol extensions可能已有人在做 @ajuijas 于 224 天前认领。 未关闭needs investigation
难度 2/5 1-3 小时 新手友好度 72/100
modelcontextprotocol/go-sdk#745 · 13 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
mcp: notifications and interrupted calls lose ErrConnectionClosed可能已有人在做 @Jackmeson1 于 1 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 30/100
modelcontextprotocol/go-sdk#1448 ·
维护者通常 1 天内回复
-
mcp: LoggingHandler drops records logged at custom slog levels可能已有人在做 @kaankucukx 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 45/100
modelcontextprotocol/go-sdk#1445 ·
维护者通常 1 天内回复
查看 modelcontextprotocol/go-sdk 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug good first issue help wanted
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
SimonWaldherr/golang-examples#109 ·
-
area: localization needs-triage
难度 1/5 1 小时以内 新手友好度 75/100
维护者通常 1 天内回复
-
bug ready-for-pr
难度 2/5 1-3 小时 新手友好度 71/100
kunchenguid/no-mistakes#1615 · 1 条评论 ·
维护者通常 1 天内回复