Skip to content

No exported way for a server to send notifications/elicitation/complete (url-mode elicitation cannot finish) #1091

Description

@pmdroid

Use case

We run an MCP gateway (Arcade) on v1.7.0-pre.2 that brokers tool auth via url-mode elicitation: the server sends elicitation/create with a URL, the user completes an OAuth flow in the browser, and an out-of-band callback on our side learns the flow finished. At that point we need to send notifications/elicitation/complete to the client — and there is no exported API to do it.

Current behavior

  • The client side is fully wired: ClientOptions.ElicitationCompleteHandler (client.go), and the internal urlElicitationMiddleware registers a waiter keyed on ElicitationID and blocks until the completion notification arrives.
  • The wire types exist but the sending side is sealed: ElicitationCompleteParams is exported, but the method constant notificationElicitationComplete is unexported, the generic sender handleNotify (shared.go) is unexported, and ServerSession's only exported notification helper is NotifyProgress.

So a server that hands url-mode elicitation to an out-of-band channel can start the flow but can never finish it: the client waits until its context dies.

Why middleware isn't a workaround

Receiving middleware operates on inbound requests; it cannot emit an arbitrary server→client notification. There is no raw JSON-RPC escape hatch exported either.

Proposal

// NotifyElicitationComplete signals that an out-of-band (url-mode)
// elicitation identified by params.ElicitationID has completed.
func (ss *ServerSession) NotifyElicitationComplete(ctx context.Context, params *ElicitationCompleteParams) error

Mirrors the existing NotifyProgress shape; no new concepts. Happy to PR this if the direction is acceptable.

🐕 Written by Kyoto, an AI agent, on Pascal's behalf —

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions