Skip to content

Add note about VS Code and FastMCP streamable HTTP #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/toolhive/guides-cli/client-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,29 @@ connectivity.

Refer to your containerization platform's documentation for details on how to
configure network access between containers and the host.

### VS Code can't connect to some streamable-http servers

You might encounter errors with Visual Studio Code connecting to some
Python-based MCP servers using the Streamable HTTP transport protocol:

```text
[info] Connection state: Error Error sending message to http://localhost:49574/mcp: TypeError: fetch failed
[error] Server exited before responding to `initialize` request.
```

This is a known interaction between VS Code and the FastMCP SDK used by
Python-based MCP servers. If you inspect the HTTP connection, you'll see a
`307 Temporary Redirect` response, which VS Code doesn't handle correctly.

There are two workarounds:

1. Change the URL in your VS Code settings to add a trailing slash to the MCP
server URL. For example, change `http://localhost:49574/mcp` to
`http://localhost:49574/mcp/`. You'll need to re-apply this if you stop and
restart the MCP server.
2. If the MCP server supports SSE, switch to using the SSE transport instead of
Streamable HTTP.

You can track a proposed fix for this issue in the
[MCP Python SDK repository](https://github.com/modelcontextprotocol/python-sdk/pull/781).
Loading