Proposal: export urlElicitationMiddleware

Đang mở
#1,492 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
50/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
api

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
5.3k
Fork
607
Merge trung bình
1 ngày 16 giờ
Pull request đã merge (30 ngày)
81

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của modelcontextprotocol/go-sdk

Tất cả issue của modelcontextprotocol/go-sdk

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.