Skip to content

[Bug] Streamable HTTP MCP: tools/call always fails while tools/list succeeds #57

Description

@mwnu

Description

When connecting to a Streamable HTTP MCP server, tools/list works correctly (all tools are discovered), but every subsequent tools/call invocation fails with a generic Error: Function failed. message, regardless of the tool or parameters.

Environment

  • DotCraft Desktop
  • Windows 10
  • MCP server using streamableHttp transport

Steps to Reproduce

  1. Configure any Streamable HTTP MCP server in config.json with Bearer token auth
  2. Verify connection succeeds: log shows MCP connected to ... with N tools
  3. Call any tool — even one that takes no parameters
  4. Observe: Error: Function failed.

Investigation

Both tools/list and tools/call responses from the server are identical in HTTP structure:

  • HTTP 200
  • Content-Type: text/event-stream
  • Transfer-Encoding: chunked
  • SSE format: event: message\ndata: {...}\n\n

Direct HTTP calls to the same server work perfectly — the server is not the problem. Other MCP clients also work fine.

DotCraft successfully parses tools/list (tools are discovered) but fails on every tools/call, despite both responses sharing the exact same SSE/HTTP format. No errors are logged for the failed tool calls.

Likely Cause

Bug in DotCraft's Streamable HTTP MCP client response handling specific to the tools/call code path.

Side Note: Config docs are unclear

The config.json fields BearerTokenEnvVar and EnvHttpHeaders are undocumented. It's unclear how to configure a Streamable HTTP MCP server to read tokens from environment variables — attempting to do so produces cryptic errors like MCP server 'X' requires env var '<value>' for header 'Authorization'. Clear docs or examples for these fields would help avoid hardcoding tokens in Headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions