Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Closed
#1,364 0 comments 0 reactions 0 assignees View on GitHub

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
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
api

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

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelcontextprotocol/go-sdk

All issues in modelcontextprotocol/go-sdk

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.