mcp: client returns an input_required result that has only requestState instead of retrying
Maintainers usually reply within 1 day
A pull request for this has already been merged.
- #1365 by @SergeevDmitry — merged
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 62/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Go
- Stars
- 5.2k
- Forks
- 583
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 47
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelcontextprotocol/go-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
modelcontextprotocol/go-sdk#1387 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
modelcontextprotocol/go-sdk#1379 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
modelcontextprotocol/go-sdk#1372 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
modelcontextprotocol/go-sdk#1367 · 4 comments ·
Maintainers usually reply within 1 day
-
Session-lifecycle bookkeeping logs at info, spamming multiple log lines per request on stateless streamable HTTPPossibly taken @anneheartrecord claimed this 45 days ago. OpenP3
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
modelcontextprotocol/go-sdk#1204 · 1 reaction ·
Maintainers usually reply within 1 day
All issues in modelcontextprotocol/go-sdk
Similar issues
-
automation models
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/TypeScript#64758 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
SocialGouv/iterion#2369 ·
Maintainers usually reply within 1 day
-
daemon/cluster: imageWithDigestString returns the mirror error even when upstream resolves the tagOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
area/ci bug priority/p3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day