claude-code - 💡(How to fix) Fix HTTP MCP servers requiring `Accept: text/event-stream` fail with 406 (never load) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45368Fetched 2026-04-09 08:07:03
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×5commented ×1

HTTP MCP servers that strictly require Accept: application/json, text/event-stream in the request headers fail to connect with a 406 Not Acceptable error. The affected servers never appear in the MCP server list regardless of restarts.

Error Message

HTTP MCP servers that strictly require Accept: application/json, text/event-stream in the request headers fail to connect with a 406 Not Acceptable error. The affected servers never appear in the MCP server list regardless of restarts. {"jsonrpc":"2.0","id":"server-error","error":{"code":-32600,"message":"Not Acceptable: Client must accept both application/json and text/event-stream"}}

Root Cause

Claude Code's HTTP MCP client appears to send only Accept: application/json when connecting to HTTP MCP servers. The VWO server (and likely any server that strictly implements the MCP Streamable HTTP transport spec) rejects this with:

``` HTTP 406 {"jsonrpc":"2.0","id":"server-error","error":{"code":-32600,"message":"Not Acceptable: Client must accept both application/json and text/event-stream"}} ```

Manually sending the correct Accept header works:

```bash curl -X POST "https://mcp.vwo.io/mcp?key=..."
-H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream"
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'

→ 200 OK, returns initialize result + full tools list correctly

```

Without text/event-stream in Accept:

```bash curl -X POST "https://mcp.vwo.io/mcp?key=..."
-H "Content-Type: application/json"
-H "Accept: application/json"
-d '...'

→ 406, "Not Acceptable: Client must accept both application/json and text/event-stream"

```

Other HTTP MCP servers (Sanity, Vercel) are more lenient and work fine, which is why this issue only surfaces with strict servers.

RAW_BUFFERClick to expand / collapse

Summary

HTTP MCP servers that strictly require Accept: application/json, text/event-stream in the request headers fail to connect with a 406 Not Acceptable error. The affected servers never appear in the MCP server list regardless of restarts.

Environment

  • Claude Code version: 2.1.96
  • OS: macOS Darwin 24.6.0

Steps to Reproduce

  1. Add a type: "http" MCP server to ~/.claude/settings.json that enforces the text/event-stream accept type (e.g. the VWO MCP server): ```json "vwo": { "type": "http", "url": "https://mcp.vwo.io/mcp?key=YOUR_KEY" } ```
  2. Start (or restart) Claude Code.
  3. Run /mcp — the VWO server is absent from the list.

Root Cause

Claude Code's HTTP MCP client appears to send only Accept: application/json when connecting to HTTP MCP servers. The VWO server (and likely any server that strictly implements the MCP Streamable HTTP transport spec) rejects this with:

``` HTTP 406 {"jsonrpc":"2.0","id":"server-error","error":{"code":-32600,"message":"Not Acceptable: Client must accept both application/json and text/event-stream"}} ```

Manually sending the correct Accept header works:

```bash curl -X POST "https://mcp.vwo.io/mcp?key=..."
-H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream"
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'

→ 200 OK, returns initialize result + full tools list correctly

```

Without text/event-stream in Accept:

```bash curl -X POST "https://mcp.vwo.io/mcp?key=..."
-H "Content-Type: application/json"
-H "Accept: application/json"
-d '...'

→ 406, "Not Acceptable: Client must accept both application/json and text/event-stream"

```

Other HTTP MCP servers (Sanity, Vercel) are more lenient and work fine, which is why this issue only surfaces with strict servers.

Expected Behavior

Claude Code's HTTP MCP client should include Accept: application/json, text/event-stream in all HTTP MCP requests, per the MCP Streamable HTTP transport specification.

Actual Behavior

HTTP MCP servers that enforce the full Accept header per spec fail silently and never appear in the MCP server list.

extent analysis

TL;DR

Update the Claude Code's HTTP MCP client to include Accept: application/json, text/event-stream in the request headers to fix the connection issue with strict HTTP MCP servers.

Guidance

  • Verify that the issue is caused by the missing text/event-stream accept type in the request headers by manually sending a request with the correct headers using a tool like curl.
  • Update the Claude Code's HTTP MCP client to include the full Accept header as specified in the MCP Streamable HTTP transport spec.
  • Test the updated client with strict HTTP MCP servers, such as the VWO server, to ensure that the connection is established successfully.
  • Consider updating the Claude Code version to a newer release that may include the fix, if available.

Example

// Example of the updated Accept header
"Accept": "application/json, text/event-stream"

Note that this is just an example and the actual implementation may vary depending on the programming language and framework used.

Notes

The issue seems to be specific to the Claude Code version 2.1.96 and may not affect other versions. Additionally, the fix may require updates to the underlying HTTP client library or framework used by Claude Code.

Recommendation

Apply the workaround by updating the Claude Code's HTTP MCP client to include the full Accept header, as this is the most direct and effective solution to the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING