MCP Stateless Compatibility Lab with Two Replicas
Run a local MCP stateless compatibility lab with two Node.js replicas, then inspect HTTP routing headers, a tool discovery response and a stock lookup.
By Matthews WongReviewed on Checked against MCP specification 2026-07-28
Key takeaway
This MCP stateless compatibility lab sends tool discovery to one local replica and a stock lookup to another. The requests carry the July 2026 revision and method information. You will read the test, run both cases and describe what a separate legacy-client check would still need to prove.
You will be able to
- Trace the HTTP requests and identify the selected replica.
- Record a passing result and a header mismatch in a compatibility matrix.
Step through the diagram
Press Play, or step with the arrows. Every step is written out below the diagram.
MCP Stateless Compatibility Lab with Two Replicas
This MCP stateless compatibility lab sends tool discovery to one local replica and a stock lookup to another. The requests carry the July 2026 revision and method information. You will read the test, run both cases and describe what a separate legacy-client check would still need to prove.
Reviewed on 3 December 2026 · MCP specification 2026-07-28
Keys: ← → step · Home / End · K play or pause
Two loopback servers run with identical sample stock and individual replica labels.
The client reads get_stock from the tools/list response reported by A.
The request reaches a different HTTP endpoint with the tool name and method already on the request.
Predict the next step Which result confirms the tool ran on B? (The stock count by itself · The HTTP success and B’s replica marker · The file name of the test)The test checks B’s marker and the stock object in structuredContent.
The fixture returns HTTP 400 when the method header disagrees with the request body.
Separate application state from request routing
MCP 2026-07-28 carries protocol and client information with requests. The fixture focuses on tools/list and tools/call, with an unchanged stock record available to both replicas. There is no previous discovery stored on B.
Read what the test proves
Read the x-lab-replica assertions alongside the returned stock. The label belongs to this fixture. In a real deployment you can use upstream logs to establish which server answered.
Read more (1)Show less
The fixture implements two local request cases. To claim support for a real SDK or an older client, run and record that pairing separately, including its discovery path and required extensions.
The real config behind this lesson
Excerpts from the repository that builds and deploys this website, quoted as they are.
const lookup = await call(b, 2, "tools/call", listing.result.tools[0].name);
assert.equal(lookup.status, 200);
assert.equal(lookup.headers.get("x-lab-replica"), "b");The client takes the tool name from A’s response and makes a new HTTP request to B. Both the operation and upstream are independently asserted.
Mistakes that cost real time
Both calls accidentally go to A
The stock can still look correct. Keep the replica assertions to catch routing mistakes.
The method head and body differ
Compare the sent HTTP header and JSON-RPC method. The fixture expects a 400 for the mismatch case.
Do it on your own machine
Run the fixture from the portfolio checkout with Node.js. It listens only on loopback and reads synthetic stock.
Run both cases and make a note about which one intentionally gets HTTP 400.
node --test examples/learn/mcp-stateless.test.mjsIn a practice copy, change the successful lookup’s endpoint from b to a. Rerun and confirm which assertion fails, then undo the one-line experiment.
node --test --test-name-pattern=discovery examples/learn/mcp-stateless.test.mjsRecord the tested revision, methods, replica labels and outputs. Add a row marked untested for an older client.
Three questions before you move on
Pick an answer to see why it is right or wrong. Nothing is graded, so guess freely; a miss is kept in this browser so the course can ask it again later.
Two questions from earlier lessons
Recalling an older lesson after a gap is what makes it stick. Answer from memory before you look anything up.
Answer in your head, then check
1.What does the test use as shared business data?Show the answer
Answer:Both servers read the same immutable sample stock, so no previous discovery on B is required.
2.What should the old client row say today?Show the answer
Answer:Only the modern fixture calls ran here. A legacy client needs a separate observed run.
Related deep dives on this site
Sources
Primary sources checked on the research date. Follow them for the current version.