Describe the bug
mcp-server-fetch terminates on any malformed JSON-RPC message. A single invalid byte on stdin kills the server process. This happens because server.py passes raise_exceptions=True to server.run(), which causes parse errors to propagate as unhandled ExceptionGroups.
Other reference servers (like mcp-server-sqlite) use the default raise_exceptions=False and handle malformed input gracefully.
fuzz_fetch_report.json
To Reproduce
pip install mcp-server-fetch # v2025.4.7, MCP SDK v1.26.0
echo "NOT VALID JSON" | mcp-server-fetch
Server exits with ExceptionGroup traceback.
Fuzz test comparison
Protocol fuzzer sent 65 identical test cases to three servers:
| Server |
MCP SDK |
Crashes |
Survives |
| mcp-server-fetch |
1.26.0 |
61 |
4 |
| mcp-server-sqlite |
1.26.0 |
0 |
65 |
| test server |
1.26.0 |
0 |
65 |
Root cause
mcp_server_fetch/server.py line 287-288:
await server.run(read_stream, write_stream, options, raise_exceptions=True)
Suggested fix
Change to raise_exceptions=False (consistent with other reference servers), or add exception handling around the serve() call.
Environment
- mcp-server-fetch: 2025.4.7
- mcp SDK: 1.26.0
- Python: 3.12.2
- OS: Windows 11
Describe the bug
mcp-server-fetch terminates on any malformed JSON-RPC message. A single invalid byte on stdin kills the server process. This happens because server.py passes
raise_exceptions=Truetoserver.run(), which causes parse errors to propagate as unhandled ExceptionGroups.Other reference servers (like mcp-server-sqlite) use the default
raise_exceptions=Falseand handle malformed input gracefully.fuzz_fetch_report.json
To Reproduce
Server exits with ExceptionGroup traceback.
Fuzz test comparison
Protocol fuzzer sent 65 identical test cases to three servers:
Root cause
mcp_server_fetch/server.py line 287-288:
Suggested fix
Change to
raise_exceptions=False(consistent with other reference servers), or add exception handling around the serve() call.Environment