About Fastmcp Deadlock Repro
Fastmcp Deadlock Repro is an MCP server published by tkellogg in the Developer Tools category: reproduces a deadlock bug in fastmcp.
Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.
Install
git clone https://github.com/tkellogg/fastmcp-deadlock-reproThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Fastmcp Deadlock Repro
Powered by Claude · Grounded in docs
Security checks
- ✓README presentThe repository ships documentation.
5 checks have not been run yet.
README
Deadlock Bug
This is reproducible in streamable-http and sse but not stdio. That makes me think it's a core
concurrency issue in mcp.
Running
In all these examples, change the numeric argument on the client. What I've found
- 10 — works easily, fast
- 100 — works
- 200 — works in
streamable-http, deadlock insse - 250 - deadlock in
streamable-http - 500 — deadlock
- 1000 — big deadlock
For both streamable-http and sse, the following error occurs frequently, followed by the script hanging:
Error in post_writer: All connection attempts failed
If it fails and I kill the client but not the server and re-run with a much lower number (e.g. 250 and then 10), the second small run works fine.
conclusion: maybe the deadlock is in the client and the server is uneffected?
The --tool-concurrency flag changes the concurrency to not include connecting, one single connection
serves all threads and only a tool call is made. In my experiments, this doesn't trigger a deadlock issue.
Running streamable-http
server:
uv run --script server.py streamable-http
client:
uv run --script client.py 0.0.0.0 8000 streamable-http 1000
Running sse
server:
uv run --script server.py streamable-http
client:
uv run --script client.py 0.0.0.0 8000 sse 1000
Running stdio
# lots of excess noise on stderr
uv run --script client.py 0.0.0.0 8000 stdio 10 2>/dev/null
README copy captured when this server was indexed; it may lag the repository. The original is authoritative.