Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

mcp: client returns an input_required result that has only requestState instead of retrying

已关闭
#1,364 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

已经有一个关联 PR 被合并了。

  • #1365 来自 @SergeevDmitry —— 已合并

评估

难度
3/5
预计耗时
半天
新手友好度
62/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
api

调研方向

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

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

modelcontextprotocol/go-sdk 的其他 Issue

查看 modelcontextprotocol/go-sdk 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。