Proposal: export urlElicitationMiddleware

オープン
#1,492 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
50/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go
領域
api

調査の方向性

Start in mcp/client.go and read urlElicitationMiddleware, including its TODO about exporting it. Compare the proposed exported middleware, a ClientOptions option, and the alternative decoding helper before settling the public API. Done means clients can handle -32042 elicitations without decoding the error data themselves.

索引モデルが issue の本文から書いたものです。

説明

Checklist
  • I searched the existing issues, and this has not been reported before.
  • This is a real problem that I ran into myself, using the latest release of the SDK.
  • I ran into it in a production system, not in a toy example, a benchmark, or an automated or AI-driven scan of the code.
  • I (a human) examined the relevant SDK code, and wrote or reviewed every line of this report. It is not unreviewed AI output.
  • This report is brief and concise, and sticks to the facts needed to understand the problem.
What problem are you trying to solve?

Our client handles URL mode elicitations in its ElicitationHandler. On 2026-07-28 the input requests of a tool result reach that handler. On 2025-11-25 a -32042 error does not: CallTool returns the *jsonrpc.Error, so we decode its elicitations data ourselves to get the same ElicitParams.

urlElicitationMiddleware in mcp/client.go already turns -32042 into handler calls, but it is unexported (see its TODO(rfindley) about exporting it). It returns a handler error wrapped, so it also works for a client that can't wait in-process: our handler returns an error carrying the URL and we pause the task for a person.

Where did you hit this?

kagent's Go ADK agent runtime relays an MCP server's URL elicitation to the person as an A2A input-required task (kagent-dev/kagent#3500).

What would help?

Export the middleware, e.g. func URLElicitationMiddleware() Middleware, or an option on ClientOptions that installs it. A smaller alternative: an exported helper that decodes -32042 data into []*ElicitParams, the inverse of URLElicitationRequiredError.

AI assistance: used to check the SDK code paths and draft this report.

主要言語
Go
スター
5.3k
フォーク
607
平均マージ
1日 17時間
マージ済み PR(30日)
80

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelcontextprotocol/go-sdk のほかの issue

modelcontextprotocol/go-sdk の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。