openclaw - 💡(How to fix) Fix [Bug]: Streamable HTTP: missing required Accept header causes failures with strict MCP servers (e.g. 智谱/BigModel) [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
openclaw/openclaw#71433Fetched 2026-04-26 05:12:43
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×2closed ×1commented ×1

Bug Description

mcporter fails to communicate with MCP servers that strictly enforce the Streamable HTTP transport spec. Specifically, 智谱 (BigModel/ZhipuAI) MCP services (e.g. web_search_prime, web_reader) are broken.

Root Cause

Two issues:

  1. Missing Accept header: mcporter sends POST requests without Accept: application/json, text/event-stream. The server responds with: "message": "Accept header must include both application/json and text/event-stream"
  2. Missing session management: After initialize, the server expects subsequent requests to include Mcp-Session-Id header. mcporter doesn't propagate this.

Error Message

initialize

curl -X POST "https://open.bigmodel.cn/api/mcp/web_search_prime/mcp"
-H "Authorization: Bearer <key>"
-H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream"
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name" :"test","version":"1.0"}}}' 4. Without Accept header → Java stacktrace error ❌ Environment

  • mcporter: 0.9.0
  • Node: v22.22.2
  • OS: Linux (WSL2)
  • Target: 智谱 BigModel MCP (Streamable HTTP transport)

Expected behavior

mcporter should include Accept: application/json, text/event-stream on all Streamable HTTP POST requests, and manage Mcp-Session-Id across the session lifecycle per the MCP spec.

Actual behavior

mcporter sends POST requests without the required Accept header, causing the server to return a Java stacktrace error instead of MCP responses. All tool calls return "[]" (empty string) with no error message surfaced to the user. The Accept header and session management gaps make mcporter incompatible with any MCP server that strictly validates the Streamable HTTP transport protocol.

OpenClaw version

OpenClaw 2026.4.23 (a979721)

Operating system

Linux (WSL2, Ubuntu, kernel 6.6.87.2-microsoft-standard-WSL2, x64)

Install method

No response

Model

zai/glm-5.1 (智谱 BigModel)

Provider / routing chain

zai/glm-5.1 (智谱 BigModel)

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Root Cause

Root Cause

Code Example

{
    "web-search-prime": {
      "baseUrl": "https://open.bigmodel.cn/api/mcp/web_search_prime/mcp",
      "headers": {
        "Authorization": "Bearer <valid-api-key>"
      }
    }
  }

---

# initialize
  curl -X POST "https://open.bigmodel.cn/api/mcp/web_search_prime/mcp" \
    -H "Authorization: Bearer <key>" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json, text/event-stream" \
    -d
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name"
:"test","version":"1.0"}}}'
4. Without Accept header → Java stacktrace error ❌
Environment

- mcporter: 0.9.0
- Node: v22.22.2
- OS: Linux (WSL2)
- Target: 智谱 BigModel MCP (Streamable HTTP transport)

### Expected behavior

mcporter should include Accept: application/json, text/event-stream on all Streamable HTTP POST requests, and manage
Mcp-Session-Id across the session lifecycle per the MCP spec.

### Actual behavior

mcporter sends POST requests without the required Accept header, causing the server to return a Java stacktrace error instead
of MCP responses. All tool calls return "[]" (empty string) with no error message surfaced to the user. The Accept header and
session management gaps make mcporter incompatible with any MCP server that strictly validates the Streamable HTTP transport
protocol.

### OpenClaw version

OpenClaw 2026.4.23 (a979721)

### Operating system

 Linux (WSL2, Ubuntu, kernel 6.6.87.2-microsoft-standard-WSL2, x64)

### Install method

_No response_

### Model

zai/glm-5.1 (智谱 BigModel)

### Provider / routing chain

zai/glm-5.1 (智谱 BigModel)

### Additional provider/model setup details

_No response_

### Logs, screenshots, and evidence
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Bug Description

mcporter fails to communicate with MCP servers that strictly enforce the Streamable HTTP transport spec. Specifically, 智谱 (BigModel/ZhipuAI) MCP services (e.g. web_search_prime, web_reader) are broken.

Root Cause

Two issues:

  1. Missing Accept header: mcporter sends POST requests without Accept: application/json, text/event-stream. The server responds with: "message": "Accept header must include both application/json and text/event-stream"
  2. Missing session management: After initialize, the server expects subsequent requests to include Mcp-Session-Id header. mcporter doesn't propagate this.

Steps to reproduce

  1. Configure a 智谱 MCP server:
  {
    "web-search-prime": {
      "baseUrl": "https://open.bigmodel.cn/api/mcp/web_search_prime/mcp",
      "headers": {
        "Authorization": "Bearer <valid-api-key>"
      }
    }
  }
  1. mcporter call web-search-prime web_search_prime search_query="test" → returns "[]"
  2. Verify the API works with curl (correct headers):
  # initialize
  curl -X POST "https://open.bigmodel.cn/api/mcp/web_search_prime/mcp" \
    -H "Authorization: Bearer <key>" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json, text/event-stream" \
    -d
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name"
:"test","version":"1.0"}}}'
4. Without Accept header → Java stacktrace error ❌
Environment

- mcporter: 0.9.0
- Node: v22.22.2
- OS: Linux (WSL2)
- Target: 智谱 BigModel MCP (Streamable HTTP transport)

### Expected behavior

mcporter should include Accept: application/json, text/event-stream on all Streamable HTTP POST requests, and manage
Mcp-Session-Id across the session lifecycle per the MCP spec.

### Actual behavior

mcporter sends POST requests without the required Accept header, causing the server to return a Java stacktrace error instead
of MCP responses. All tool calls return "[]" (empty string) with no error message surfaced to the user. The Accept header and
session management gaps make mcporter incompatible with any MCP server that strictly validates the Streamable HTTP transport
protocol.

### OpenClaw version

OpenClaw 2026.4.23 (a979721)

### Operating system

 Linux (WSL2, Ubuntu, kernel 6.6.87.2-microsoft-standard-WSL2, x64)

### Install method

_No response_

### Model

zai/glm-5.1 (智谱 BigModel)

### Provider / routing chain

zai/glm-5.1 (智谱 BigModel)

### Additional provider/model setup details

_No response_

### Logs, screenshots, and evidence

```shell

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

To fix the issue, mcporter needs to include the Accept: application/json, text/event-stream header in all Streamable HTTP POST requests and manage the Mcp-Session-Id across the session lifecycle.

Guidance

  • Add the Accept header with the required values to the POST requests sent by mcporter to ensure compatibility with MCP servers that strictly enforce the Streamable HTTP transport spec.
  • Implement session management in mcporter to propagate the Mcp-Session-Id header in subsequent requests after initialization.
  • Verify the fix by testing mcporter with the 智谱 MCP server using the provided configuration and checking for the presence of the Accept header and Mcp-Session-Id in the requests.
  • Use tools like curl to test the API and compare the results with mcporter to identify any discrepancies.

Example

// Example of a POST request with the required Accept header
{
  "method": "POST",
  "url": "https://open.bigmodel.cn/api/mcp/web_search_prime/mcp",
  "headers": {
    "Authorization": "Bearer <valid-api-key>",
    "Content-Type": "application/json",
    "Accept": "application/json, text/event-stream"
  },
  "data": {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2025-03-26",
      "capabilities": {},
      "clientInfo": {
        "name": "test",
        "version": "1.0"
      }
    }
  }
}

Notes

The provided information suggests that the issue is specific to the mcporter implementation and its compatibility with the Streamable HTTP transport spec. The fix should focus on adding the required Accept header and implementing session management.

Recommendation

Apply a workaround by modifying mcporter

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…

FAQ

Expected behavior

mcporter should include Accept: application/json, text/event-stream on all Streamable HTTP POST requests, and manage Mcp-Session-Id across the session lifecycle per the MCP spec.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: Streamable HTTP: missing required Accept header causes failures with strict MCP servers (e.g. 智谱/BigModel) [1 comments, 2 participants]