MCP Inspector crashes with 'Controller is already closed' on fastmcp Streamable HTTP
I'm using MCP Inspector v0.17.2 via
npx @modelcontextprotocol/inspectoron Windows 10 with Node v22.13.0. When I connect to a fastmcp Streamable HTTP endpoint at http://127.0.0.1:8001/mcp, the Node proxy crashes withTypeError [ERR_INVALID_STATE]: Invalid state: Controller is already closed. The same fastmcp server works in Legacy SSE mode. Is there a fix or workaround?Originally asked on GitHub: https://github.com/modelcontextprotocol/inspector/issues/951
5 answers
Fixed in MCP Inspector v0.17.5. A maintainer confirmed the fix in PR #940, and several commenters reported that v0.17.5 resolves the crash.
To fix, run the latest version:
bashnpx @modelcontextprotocol/inspectoror pin the fixed version explicitly:
bashnpx --yes @modelcontextprotocol/inspector@0.17.5If you cannot upgrade yet, the workaround that multiple users confirmed is to downgrade to v0.16.7:
bashnpx --yes @modelcontextprotocol/inspector@0.16.7The crash affected only the Streamable HTTP transport handling in the inspector's Node.js proxy; the same fastmcp service worked fine in Legacy SSE mode. Other users reproduced the issue with a spring-ai Streamable HTTP server as well, so the problem was not specific to fastmcp.
Did this work for you?What @Feng-YiJing-Dao tried on GitHub (Didn't work)
Reporter ran inspector v0.17.2 via
npx @modelcontextprotocol/inspectoragainst a fastmcp Streamable HTTP server at http://127.0.0.1:8001/mcp on Windows with Node v22.13.0. It crashed withTypeError [ERR_INVALID_STATE]: Invalid state: Controller is already closed. The same server worked in Legacy SSE mode.Source: https://github.com/modelcontextprotocol/inspector/issues/951 (opens external site)
Did this work for you?What @mathieu-benoit tried on GitHub (Worked)
A commenter confirmed downgrading to v0.16.7 works as a workaround:
npx --yes @modelcontextprotocol/inspector@0.16.7.Did this work for you?What @rperezll tried on GitHub (Worked)
Another commenter reported that downgrading to 0.16.6 fixed the crash for them.
Did this work for you?What @rperezll tried on GitHub (Worked)
After the fix release, a commenter confirmed that upgrading to v0.17.5 fixes the problem.
Did this work for you?
Related questions
- MCP Inspector 0.10.2 sends null for unset optional params (error -32602)?
- Why does npx @modelcontextprotocol/inspector fail with 'mcp-inspector: command not found' after 0.10.0?
- How do I increase MCP Inspector's 10-second request timeout?
- Why does the MCP Inspector Docker container refuse connections on localhost:6274, and how do I fix it?
- Why doesn't MCP Inspector auto-refresh an expired access token (HTTP 401)?