Key Takeaway
A stateless MCP integration test sends related requests to distinct replicas of the same server and checks that they produce the same authorised results. The July 2026 revision makes this a practical test for remote deployments. A useful fixture covers discovery, tool execution and recovery after an instance is replaced.
What should both replicas share?
Build both instances from the same image and use a fixed catalogue fixture. Give each instance a diagnostic label in application logs. An instance label can explain routing when a test fails, while the actual response should still satisfy the same tool contract.
How can the test force a real handoff?
Send list discovery to A and call a read-only tool through B. Both requests should take the same proxy path when possible. Verify the chosen upstream in logs, since repeated requests to one instance can pass even when the application still depends on process memory.
What should survive a restart?
Replace B and repeat the same lookup with the same subject and fixture. Keep business state in a durable backing store when the tool needs it. A process-local cache can help performance as long as a cold instance can reconstruct the correct value.
How should access be checked?
Repeat the call with a second test identity that lacks access to the fixture. Compare outcomes from both replicas. A passing result for an authorised identity and a denial for the other proves more than matching status codes from two anonymous requests.
What can fail at the gateway?
Compare what the client sent with what the upstream received. For the modern HTTP fixture, inspect MCP-Protocol-Version, Mcp-Method and Mcp-Name when the method names a target. Preserve a redacted request trace. This helps distinguish an application bug from gateway rewriting or missing headers.
# Local lab that runs two fixture replicas in the same process.
node --test examples/learn/mcp-stateless.test.mjsWhat should the CI gate assert?
Assert the tool name, returned business fields and the replica IDs observed by the harness. Repeat against a newly started instance. A concise assertion message should identify which phase failed so a developer can reproduce the same route locally.

