-
Notifications
You must be signed in to change notification settings - Fork 49
Description
Summary
When running the AWS Agent Core MCP server backed by quarkus-mcp-server, the MCP client receives an error when it sends a ping message before completing the initialize handshake.
π₯ Observed Behavior
Server logs show:
{
"jsonrpc" : "2.0",
"method" : "ping",
"params" : null,
"id" : 4
}2025-10-25 02:23:21,753 INFO [io.qua.mcp.ser.traffic] (vert.x-eventloop-thread-0) MCP message sent [...]:
{
"jsonrpc" : "2.0",
"id" : 4,
"error" : {
"code" : -32601,
"message" : "The first message from the client must be \"initialize\": ping"
}
}
As a result, the server rejects legitimate ping requests that occur before initialize.
π Expected Behavior (per MCP spec)
According to the [Model Context Protocol Specification (2025-06-18)](https://modelcontextprotocol.io/specification/2025-06-18/basic/lifecycle):
The client SHOULD NOT send requests other than pings before the server has responded to the initialize request.
The server SHOULD NOT send requests other than pings and logging before receiving the initialized notification.
Therefore, ping should be accepted at any point in the lifecycle, including before initialization completes.
βοΈ Environment
- MCP server: Quarkus MCP Server (
io.quarkiverse.mcp.server) - Deployment: AWS Agent Core
- Protocol: Streamable HTTP v1.7.0
π§© Likely Root Cause
McpMessageHandler.initializeNew(...) currently enforces:
if (!INITIALIZE.equals(method)) {
String msg = "The first message from the client must be \"initialize\": " + method;
...
}This check blocks legitimate pre-initialize ping requests, contrary to the latest spec.
β Suggested Fix
Permit ping in the NEW connection state (before initialize) β for example:
if (PING.equals(method)) {
return ping(message, mcpRequest);
}before the if (!INITIALIZE.equals(method)) check in initializeNew(...).
This would make the behavior compliant with the 2025-06-18 MCP lifecycle specification.