seams-lab

Find where MCP clientsbreak under failure

A fault-injection harness: the same cancellations, hung tools, huge responses and restarts, run against every client. Pick a client and a failure to see what we measured.

Open on GitHub
seams-lab Findings
Client
Failure
{
  "client": "ai-sdk",
  "scenario": "hang",
  "outcome": "still pending after 70 s"
}

Never returns. Other clients give up after 60 s. Reported: vercel/ai#25730

Bugs reported to

11 issues and 9 pull requests across 7 projects, each with a reproduction that runs on that project's own main branch.

A steel expansion joint crossing a bridge deck between two concrete spans

Each side's tests pass. The break is at the joint.

Expansion joint, Donaubrücke, Krems an der Donau. Photo: GT1976, CC BY-SA 4.0

One finding, start to fix

Found

Vercel AI SDK, stdio, one tool result of 80 MB

npm run seams-lab -- run --client ai-sdk --scenario big · main 2a231338a6

10,271 ms

10 MB 218 ms · 20 MB 598 ms · 40 MB 2,674 ms. Double the size, four times the wait.

A worn expansion joint on Kruunuvuorensilta bridge before renovation
Kruunuvuorensilta joint, before renovation

Reported

Openvercel/ai#25704

@ai-sdk/mcp: stdio transport reads a large message in quadratic time

ReadBuffer concatenates the whole buffer on every chunk and searches it from the start.

Fixed in a PR

Openvercel/ai#25705

fix(mcp): read large stdio messages in linear time

241 ms

10 MB 31 ms · 20 MB 61 ms · 40 MB 115 ms. Each byte is copied and searched once.

The same expansion joint on Kruunuvuorensilta bridge after renovation
The same joint, after

How it runs

First, clone and install.

git clone https://github.com/Koobi33/seams-lab
cd seams-lab && npm install

Then run one failure against one client.

npm run seams-lab -- run --client ai-sdk --scenario cancel
{
  "client": "ai-sdk",
  "clientVersion": "1.0.107",
  "scenario": "cancel",
  "transport": "stdio",
  "outcome": "server ran to the end",
  "detail": { "server": ["slow_task finished all 5s"] }
}

Last, read the clients side by side.

FailureVercel AI SDKLangChainMCP TS SDKgoose
Hung toolnever returnsgives up at 60 sgives up at 60 sextension timeout
Cancel a callserver runs all 5 sserver stopsserver stops
Tool returns isErrormodel sees successstatus: errorisError: truemodel sees the error
Reply over 16 MB80 MB in 10.3 sover 10 MB closes the transporthangs 5 min
Server restartstools stay dead
A bridge expansion joint running across a road, a sidewalk and paving
One joint, four surfaces. Photo: Ramsch, CC BY-SA 4.0

Reported upstream,with reproductions

Full table on GitHub

Break it first

Copy the command, run it on your machine, and get the same JSON the table above was built from.

Run a scenario

npm run seams-lab -- run --client ai-sdk --scenario cancel

Photographs: "Bridge expansion joint at Donaubrücke in Krems an der Donau" by GT1976, CC BY-SA 4.0; "Kruunuvuorensilta bridge expansion joint before renovation" and "after renovation" by Lasse Keskinen, CC BY 4.0; "Bridge expansion joints 01" by Ramsch, CC BY-SA 4.0. All via Wikimedia Commons.