Proposal: export urlElicitationMiddleware

Abierto
#1,492 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
50/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go
Área
api

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Go
Estrellas
5.3k
Forks
607
Merge medio
1 d 16 h
PR fusionados (30 d)
81

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de modelcontextprotocol/go-sdk

Todos los issues de modelcontextprotocol/go-sdk

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.