Same feature set as ServerTransportSecurityValidator but uses a lazy
"header accessor" function to read header values instead of extracting
all headers into a map. Matches more closely what modern frameworks and
JDK APIs do.
Fixes#870
Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
Concurrent calls to `sendMessage` on the STDIO transports raced on the
unicast sink and sporadically failed with `FAIL_NON_SERIALIZED`, dropping
the message with `RuntimeException("Failed to enqueue message")`.
Switch `tryEmitNext` to `emitNext` with a `busyLooping` EmitFailureHandler
so concurrent emissions are serialized as recommended by the Reactor
maintainers. Applied on both `StdioServerTransportProvider` and
`StdioClientTransport`.
Co-authored-by: Nicolas Quinquenel <nicolas.quinquenel@sonarsource.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
There is a race condition where the GET /mcp SSE stream in Streamable
HTTP is established _after_ the server tries to send notifications. This
surfaces errors from the MCP client sending notifications and breaks
some integration tests.
We add a utility showing to ensure the stream is established before
sending server notifications.
Fixes#1114
Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
- Instead of running one Tomcat per test method, run one per test
- Improves the testing time of Servlet-based tests
Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
Lets contributors manually run CI against a branch on their own fork
before opening a PR, without needing to open a draft PR or push an
empty commit just to get a CI run.
Fixes#1116
Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
This reverts commit 439dc90d25.
Spring AI still uses the old API from these tests because they have
muliple clients.
Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
Per the SSE specification (WHATWG HTML Living Standard 9.2.6), an event with no explicit event field MUST be dispatched as a message event. HttpClientStreamableHttpTransport previously used strict equality and silently dropped such frames in the reconnect/GET stream path, causing server-initiated notifications to never reach the handler. Extract classification into a package-private isMessageEvent helper and cover with parameterized unit tests.
Closes gh-885
- DefaultJsonSchemaValidator now emits a neutral message;
- Call sites in ToolInputValidator and the server output handlers
prepend their own context prefix,
- Integration test assertions strengthened accordingly.
Closes#986
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
* address review comments
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
* address review comments
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
---------
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Add URL-type elicitation schema support allowing servers to request URL
input from users during tool execution. This enables out-of-band
interactions like payment processing or API key entry.
Breaking changes:
- `ElicitRequest` changed from a `record` to an `interface`.
- The original `ElicitRequest` record was renamed to `ElicitFormRequest`.
- `McpClient` builder `elicitation()` methods now accept `ElicitFormRequest` instead of `ElicitRequest`.
New APIs:
- `ElicitUrlRequest` record for URL-mode elicitation.
- `urlElicitation()` builder methods in `McpClient`.
- `elicitationCompleteConsumer()` and `elicitationCompleteConsumers()` builder methods in `McpClient`.
- `sendElicitationComplete()` methods in `McpAsyncServer` and `McpSyncServer`.
- `McpError.URL_ELICITATION_REQUIRED` and `McpSchema.ErrorCodes.URL_ELICITATION_REQUIRED`.
- `ElicitationCompleteNotification` record and `METHOD_NOTIFICATION_ELICITATION_COMPLETE` constant.
Co-authored-by: Daniel Garnier-Moiroux <git@garnier.wf>
Co-authored-by: Sainath Reddy Bobbala <bsnr@amazon.com>