Skip to content

Streamable HTTP: "Not Acceptable" error after OAuth completes #1289

@jreynar

Description

@jreynar

Description

After connecting to a Streamable HTTP MCP server that requires OAuth, the OAuth dance completes successfully but subsequent POST requests to the server fail with:

MCP error -32099: Streamable HTTP error: Error POSTing to endpoint:
{"jsonrpc":"2.0","error":{"code":-32000,"message":"Not Acceptable: Client must accept both application/json and text/event-stream"},"id":null}

The Streamable HTTP transport spec requires clients to send Accept: application/json, text/event-stream on POST requests. Inspector 0.21.2 appears to send an Accept header that does not include both types, so the server's StreamableHTTPServerTransport.handleRequest rejects with -32000.

Reproduction

  1. Connect to any public MCP server using Streamable HTTP transport with OAuth (e.g., a server using @clerk/mcp-tools).
  2. Complete the OAuth flow in the browser.
  3. After redirect back, Inspector attempts the initialize request.
  4. The request fails with the -32000 "Not Acceptable" error.

Server-side verification

The same server returns a normal 401 (no token) when hit with curl using the correct Accept header, proving the server's Accept-validation is correct:

curl -i -X POST https://<server>/mcp \
  -H "Accept: application/json, text/event-stream" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'

Environment

  • Inspector version: 0.21.2 (latest published as of filing)
  • Server: HTTP MCP server using @modelcontextprotocol/sdk wrapped by @clerk/mcp-tools, behind AWS API Gateway

Expected behavior

Inspector sends Accept: application/json, text/event-stream on all POST requests to a Streamable HTTP endpoint, per the spec.

Actual behavior

The Accept header is missing one of the two required types, causing the server to reject the request with -32000 after OAuth completes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions