Skip to content

Add network-level MCP elicitation callback test with context - #1883

Merged
jfallows merged 1 commit into
developfrom
claude/exciting-tesla-u9hmcz
Jun 15, 2026
Merged

jfallows merged 1 commit into
developfrom
claude/exciting-tesla-u9hmcz

Conversation

@jfallows

Copy link
Copy Markdown
Contributor

Description

This change adds a new network-level test specification for the MCP binding that validates the complete elicitation flow with OAuth callback handling at the transport layer.

Changes

  • Added tools.call.elicit.completed.context/client.rpt: New network-level test script that exercises the full MCP elicitation workflow, including:

    • Client initialization with elicitation capability
    • Tool call request that triggers an elicitation challenge
    • Server-side elicitation creation with OAuth URL
    • Client callback to the authorization endpoint with state and code parameters
    • Tool result completion after elicitation
  • Updated application-level test scripts to use transport-scoped state parameters:

    • Modified tools.call.elicit.completed.context/client.rpt and server.rpt to include transport-1 prefix in the state parameter, enabling proper session correlation between the network and application layers
  • Enabled previously ignored test shouldCallToolElicitCompletedWithContext() in McpServerIT.java by:

    • Removing the @Ignore annotation
    • Updating the test to reference the new network-level script (tools.call.elicit.completed.context/client instead of tools.call.elicit.completed/client)

Motivation

This completes the implementation of OAuth-callback-based elicitation at the broker level, enabling proper handling of authorization flows where the MCP binding acts as an intermediary between clients and servers. The transport-scoped state parameters ensure secure correlation of elicitation requests across multiple HTTP connections.

Fixes #1810

https://claude.ai/code/session_01EL1ihZrSH7R4DjmJtnDJLW

Un-ignore McpServerIT.shouldCallToolElicitCompletedWithContext (was
deferred per issue #1810) and complete its supporting scripts for the
broker OAuth-callback elicitation flow:

- Add network/tools.call.elicit.completed.context/client.rpt and its peer
  server.rpt driving the broker flow: the URL-mode elicitation/create
  carries a prefixed state <session>.<elicit>.<state> and redirect_uri =
  binding callback; the client GETs /mcp/auth/callback?code=xyz&state=...
  then reads the completion notification and tool result.
- Add the NetworkIT.shouldCallToolElicitCompletedWithContext peer method
  so the two network scripts are proven complementary without the runtime.
- Fix the application context scripts' elicitCreate redirect_uri from the
  https://replace.me/callback placeholder to the binding's resolved
  callback https://localhost:8080/mcp/auth/callback, so isBrokerElicit is
  satisfied, the elicitation registers, and the callback correlates
  (matching the tools.call.elicit.declined broker pattern).

Verified: full 'mvnw clean verify' on runtime/binding-mcp (233 ITs, 0
skipped) and specs/binding-mcp.spec (NetworkIT + ApplicationIT) pass.

https://claude.ai/code/session_01EL1ihZrSH7R4DjmJtnDJLW
@jfallows
jfallows force-pushed the claude/exciting-tesla-u9hmcz branch from 7b3663d to b73c334 Compare June 15, 2026 18:12

@jfallows jfallows left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jfallows
jfallows marked this pull request as ready for review June 15, 2026 18:16
@jfallows
jfallows merged commit e03912f into develop Jun 15, 2026
39 checks passed
@jfallows
jfallows deleted the claude/exciting-tesla-u9hmcz branch July 1, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

binding-mcp: per-toolkit elicitation for mcp proxy

2 participants