Description
When utilizing Streamable HTTP transport mode, the server consistently rejects connection attempts from standard MCP clients (LM Studio, Lobe, MCP Inspector) with a JSON-RPC error. The server correctly processes stdio transport requests, indicating the issue is isolated to the HTTP transport lifecycle/handshake management.
Error Message
{"jsonrpc":"2.0","error":{"code":-32600,"message":"Invalid Request: Server already initialized"},"id":null}
To Reproduce
-
Run the container with HTTP transport:
docker run --rm -p 4000:3000 \
-e CYBERCHEF_TRANSPORT=http \
-e CYBERCHEF_HTTP_PORT=3000 \
-e CYBERCHEF_HTTP_HOST=0.0.0.0 \
ghcr.io/doublegate/cyberchef-mcp_v1:latest
-
Attempt to connect using an MCP client (e.g., LM Studio, Lobe, or MCP Inspector) using http://127.0.0.1:4000/mcp.
-
Observe the Server already initialized error during the client's connection/probing phase.
Expected Behavior
The server should negotiate the connection handshake without rejecting the formal initialize request following the client's discovery probe.
Environment
- OS: Windows 11 / Docker v4.45
- **MCP Client: ** LM Studio, Lobe,
@modelcontextprotocol/inspector and webui
- Transport Mode: Streamable HTTP
more details
Many MCP clients perform an initial discovery/probing request to the endpoint. It appears this initial probe initializes the global Server instance. Consequently, when the client sends the subsequent formal initialize handshake, the SDK rejects it because the server state is already marked as initialized.
While stdio transport functions as expected, the HTTP transport implementation currently prevents compatibility with clients that utilize these discovery protocols.
Thank you for your work on this project.
Description
When utilizing
Streamable HTTPtransport mode, the server consistently rejects connection attempts from standard MCP clients (LM Studio, Lobe, MCP Inspector) with a JSON-RPC error. The server correctly processesstdiotransport requests, indicating the issue is isolated to the HTTP transport lifecycle/handshake management.Error Message
{"jsonrpc":"2.0","error":{"code":-32600,"message":"Invalid Request: Server already initialized"},"id":null}To Reproduce
Run the container with HTTP transport:
Attempt to connect using an MCP client (e.g., LM Studio, Lobe, or MCP Inspector) using
http://127.0.0.1:4000/mcp.Observe the
Server already initializederror during the client's connection/probing phase.Expected Behavior
The server should negotiate the connection handshake without rejecting the formal
initializerequest following the client's discovery probe.Environment
@modelcontextprotocol/inspectorand webuimore details
Many MCP clients perform an initial discovery/probing request to the endpoint. It appears this initial probe initializes the global
Serverinstance. Consequently, when the client sends the subsequent formalinitializehandshake, the SDK rejects it because the server state is already marked as initialized.While
stdiotransport functions as expected, the HTTP transport implementation currently prevents compatibility with clients that utilize these discovery protocols.Thank you for your work on this project.