Skip to content

test(wasm32): HTTP MCP through the host's fetch - #276

Merged
yuanhao merged 1 commit into
mainfrom
test/wasm32-mcp
Oct 9, 2026
Merged

yuanhao merged 1 commit into
mainfrom
test/wasm32-mcp

Conversation

@yuanhao

@yuanhao yuanhao commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

HTTP MCP was documented as available on wasm32 (Cloudflare Workers) but never run there.

  • tests/wasm32.rs: a scripted MCP server replaces the global fetch (reqwest's wasm client calls it per request, as in a Worker). An agent connects with with_mcp_server_http, discovers a tool and calls it from the loop. Asserts the tool result and the request sequence: initialize, then notifications/initialized, tools/list, tools/call, each replaying Mcp-Session-Id. Mutation-checked: dropping the session replay in HttpTransport fails the test.
  • Workers guide: HTTP MCP is tested; no idle read timeout on wasm32 (platform limits apply); custom headers pending MCP: custom headers on HttpTransport #275.

Local: all 10 wasm32 tests pass under Node; wasm32 clippy clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01T7iq5hpndSiHQcnAsywKuG

A scripted MCP server replaces the global fetch: connect, discover and call
a tool from the loop, with the Mcp-Session-Id replayed on every request
after the handshake (mutation-checked: dropping the replay fails it). The
Workers guide notes the missing idle read timeout and #275.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T7iq5hpndSiHQcnAsywKuG
@yuanhao
yuanhao merged commit 3cfed23 into main Oct 9, 2026
15 checks passed
@yuanhao
yuanhao deleted the test/wasm32-mcp branch October 9, 2026 09:59
@yuanhao yuanhao mentioned this pull request Oct 9, 2026
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