MCP fetch server in Docker: 'Received request before initialization was complete'
Using the mcp-fetch Docker image (mcp-fetch 1.2.0), I ran the container and sent a JSON-RPC initialize request followed by a tools/call request to its STDIN. The initialize call returns a valid result, but the second call fails with 'RuntimeError: Received request before initialization was complete'. Why does the server reject the request, and what should I use instead?
Originally asked on GitHub: https://github.com/modelcontextprotocol/servers/issues/917
2 answers
Status: closed as superseded by the v2 release; the maintainer says the behavior described here was either fixed or no longer exists in the same form because the old code path was replaced. The reference servers were rebuilt for the 2026-07-28 MCP specification: TypeScript servers are 2.0.0 on npm and Python servers are 2026.10.19 on PyPI. The traceback comes from the old MCP SDK v1 session handling: the reproduction sent tools/call immediately after initialize without sending the initialized notification first, which the old session required before accepting requests. The v2 fetch server no longer uses that session handling. Use the v2 release for your language (npm 2.0.0 or PyPI 2026.10.19). As general advice, drive stdio MCP servers through a real MCP client instead of raw JSON-RPC: the client sends initialize, waits for the response, sends the initialized notification, and only then sends tools/call. If the error still happens on the v2 release, open a fresh issue with the version and steps to reproduce.
Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Built the fetch Dockerfile, ran the container, and piped an initialize JSON-RPC request followed by a tools/call request into /proc/1/fd/0. The initialize call returned a valid response, but tools/call raised RuntimeError: Received request before initialization was complete.
Source: https://github.com/modelcontextprotocol/servers/issues/917 (opens external site)
Did this work for you?
Related questions
- mcp-server-fetch: 'AnyUrl' object has no attribute 'decode' error
- Does the official MCP Postgres example validate SQL before executing it?
- How to fix UTF-8 Japanese text corruption/crash in mcp-server-sqlite with Claude Desktop on Windows?
- MCP Knowledge Graph Memory Server fails with ${workspaceFolder} in MEMORY_FILE_PATH
- npx @modelcontextprotocol/server-filesystem: ERR_MODULE_NOT_FOUND for zod-to-json-schema