Skip to content

Request uncompressed responses from remote MCP servers#1399

Draft
RhysSullivan wants to merge 2 commits into
mainfrom
fix/mcp-accept-encoding-identity
Draft

Request uncompressed responses from remote MCP servers#1399
RhysSullivan wants to merge 2 commits into
mainfrom
fix/mcp-accept-encoding-identity

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Connecting to some remote MCP servers failed with "Failed connecting via sse". The server returns gzipped responses with a miscomputed Content-Length (the uncompressed size), so the stream is truncated and the streamable-http handshake fails with a decompression error; the auto-transport SSE fallback then fails too (the server never supported legacy SSE) and its error masked the real one.

This sends accept-encoding: identity on remote MCP transports and the shape probe, matching what other MCP clients do (a caller-supplied Accept-Encoding header still wins), and includes both transport failures in the error message when the auto fallback also fails.

Some remote MCP servers miscompute Content-Length on gzipped responses
(set to the uncompressed size), which truncates the stream and fails the
handshake with an opaque decompression error in runtimes that send a
default Accept-Encoding. Send accept-encoding: identity on the remote
transports and the shape probe (a caller-supplied header still wins);
MCP payloads are small, so compression buys nothing.

Also stop masking the streamable-http failure when the auto-transport
SSE fallback fails too: most servers never supported legacy SSE, so
reporting only the fallback's error hid the real cause.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 10, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 1a8357b Commit Preview URL

Branch Preview URL
Jul 10 2026, 06:15 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 10, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud 1a8357b Jul 10 2026, 06:16 PM

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Console https://executor-preview-pr-1399.executor-e2e.workers.dev
MCP https://executor-preview-pr-1399.executor-e2e.workers.dev/mcp
Deployed commit 1a8357b

Sign-in is Cloudflare Access (one-time PIN to an allowed email). The preview has its own database and encryption key; it is destroyed when this PR closes.

@pkg-pr-new

pkg-pr-new Bot commented Jul 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1399

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1399

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1399

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1399

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1399

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1399

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1399

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1399

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1399

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1399

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1399

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1399

executor

npm i https://pkg.pr.new/executor@1399

commit: 1a8357b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant