docs: ClientHandler list_changed callbacks don't mention Peer::listen (2026-07-28)
维护者通常 3 天内回复
评估
这个 Issue 还没有评估数据。
描述
Summary
ClientHandler::on_tool_list_changed, on_prompt_list_changed and on_resource_list_changed (crates/rmcp/src/handler/client.rs) have no rustdoc, and nothing in that file mentions Peer::listen.
On 2026-07-28, list-changed notifications go through subscriptions/listen: servers SHOULD send notifications/tools/list_changed to clients that opened a listen stream with toolsListChanged: true (Tools), and MUST NOT send notification types the client has not requested (Subscriptions). So with a compliant server:
- a client that never calls
Peer::listengets no list-changed notifications, and the callbacks never fire; - a client that does call it gets them on the
Subscription: the serve loop routes notifications whose_meta["io.modelcontextprotocol/subscriptionId"]matches an active subscription to that channel and skipshandle_notification(crates/rmcp/src/service.rs~L1645-1678; the response cache is still invalidated first, ~L1612).
On 2025-11-25, or with servers that still send unscoped notifications, the callbacks fire as before.
Peer::listen already says "Notifications routed to the returned Subscription are not also delivered through ClientHandler callbacks", but the callbacks themselves don't, and the README's resources section (~L489, "Clients handle these via ClientHandler") shows on_resource_list_changed without pointing to the Subscriptions section. Real-world example: goose implements on_tool_list_changed without opening a listen stream (aaif-goose/goose#13055).
Proposal
Docs only: rustdoc on the three callbacks saying they receive only notifications not routed to a Subscription, pointing to Peer::listen with SubscriptionFilterBuilder::{tools,prompts,resources}_list_changed() and the subscriptions_streamhttp client example. Optionally a one-line pointer from the README's resources section to the Subscriptions section. Happy to open the PR if this direction works for you.
AI Disclosure (pursuant to the AI Contribution Policy): I used Claude to help write this issue; all checks, reviews, and code were handled by me personally.
- 主要语言
- Rust
- 星标
- 4.1k
- 派生
- 680
- 平均合并
- 3 天 20 小时
- 30 天内合并 PR
- 32
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/rust-sdk 的其他 Issue
-
auth: refresh_token() requests offline_access that was never granted, so refreshes fail with invalid_scope可能已有人在做 @jstar0 于 21 天前认领。 未关闭bug P1 ready for work T-security T-transport
难度 2/5 1-3 小时 新手友好度 65/100
modelcontextprotocol/rust-sdk#1330 ·
维护者通常 3 天内回复
-
Enterprise-managed auth: ID-JAG `resource` claim should be optional可能已有人在做 @gocamille 于 1 天前认领。 未关闭bug P1 ready for work T-security T-transport
modelcontextprotocol/rust-sdk#1404 · 2 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
-
Auto discovery timeout rejects a late probe response during legacy initialization可能已有人在做 @gocamille 于 2 天前认领。 未关闭bug P1 ready for work T-service
modelcontextprotocol/rust-sdk#1400 · 1 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
-
URL mode elicitation requires elicitationId, which the 2026-07-28 schema removed可能已有人在做 @gocamille 于 2 天前认领。 未关闭bug P1 ready for work T-model
modelcontextprotocol/rust-sdk#1399 · 1 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
-
stdio transport: a request over the maximum line length gets no answer可能已有人在做 @gocamille 于 3 天前认领。 未关闭bug P1 ready for work T-transport
modelcontextprotocol/rust-sdk#1395 · 1 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
查看 modelcontextprotocol/rust-sdk 的全部 Issue
相似的 Issue
-
good first issue help wanted r-docs
难度 2/5 1-3 小时 新手友好度 72/100
servo/rust-smallvec#824 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
priority middle
难度 1/5 1 小时以内 新手友好度 62/100
KATO-Hiro/AtCoderClans#12940 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
hurttlocker/o8#5112 ·