mcp: client returns an input_required result that has only requestState instead of retrying
维护者通常 1 天内回复
已经有一个关联 PR 被合并了。
- #1365 来自 @SergeevDmitry —— 已合并
评估
调研方向
The early return is in clientMultiRoundTripMiddleware in mcp/mrtr.go, around lines 81-84, which exits when InputRequests is nil before checking the result type. Read that middleware and the MRTR section of client.md, then write a test where the server answers with an input_required result carrying only requestState. Done when ClientSession.CallTool retries with requestState echoed until NeedsInput() is false, and the existing MRTR tests still pass.
由索引模型根据 Issue 内容生成。
描述
What did you do?
Called a tool on a server that answers the first tools/call with an InputRequiredResult carrying only requestState:
{"resultType":"input_required","requestState":"continue"}
SEP-2322 allows this. Servers "MUST include at least one of inputRequests or requestState", and without inputRequests "the client MAY retry the original request immediately" (MRTR). The TypeScript SDK server sends such results from inputRequired({ requestState }).
What did you see?
ClientSession.CallTool returns that result to the caller (NeedsInput() is true, no content), with the multi-round-trip middleware enabled. clientMultiRoundTripMiddleware returns as soon as InputRequests is nil, before it looks at the result type (mrtr.go L81-L84).
What did you expect to see?
The middleware retries the call with the requestState echoed. The client docs say it retries while NeedsInput() is true, "repeating until the result no longer needs input" (client.md). The TypeScript client retries these results as load-shedding rounds.
What version of the Go MCP SDK are you using?
main at 71fd646, also v1.8.0.
What version of Go are you using (go version)?
go1.27.1 darwin/arm64
I have a fix with tests and will open a PR.
AI assistance: I used Claude Code to help investigate this.
- 主要语言
- Go
- 星标
- 5.2k
- 派生
- 594
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 66
环境准备
在浏览器里用你自己的 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 · 1 条评论 ·
维护者通常 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: LoggingHandler drops records logged at custom slog levels可能已有人在做 @kaankucukx 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 45/100
modelcontextprotocol/go-sdk#1445 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
modelcontextprotocol/go-sdk#1436 ·
维护者通常 1 天内回复
查看 modelcontextprotocol/go-sdk 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
slavakurilyak/awesome-ai-agents#845 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
-
[BUG] deploy.restart_policy without condition drops the restart policy可能已有人在做 @akshat-lakhera 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
docker/compose#14383 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
Azure/azure-storage-fuse#2429 ·
维护者通常 1 天内回复