fix(client): preserve Request options in proxy fetch
Summary
- Normalize proxy fetch inputs with
new Request(input, init)before serializing them for/fetch - Preserve
Requestmethod, headers, and body instead of forwarding onlyRequest.url - Add regression coverage for
Requestinputs and explicitinitoverrides
Closes #1207.
Validation
git diff --check/home/ubuntu/modelcontextprotocol-inspector/clients/web/node_modules/.bin/prettier --check client/src/lib/proxyFetch.ts client/src/lib/__tests__/proxyFetch.test.ts- Manual Node 24 check that
new Request()preserves POST method, lower-cased headers, and text body for the reported Request-input case
I attempted the focused Jest command npm test -- --runTestsByPath src/lib/__tests__/proxyFetch.test.ts --runInBand, but this fresh worktree did not have jest installed. A scoped npm ci --workspace=client --include-workspace-root=false --ignore-scripts then failed on registry download with ECONNRESET for xml-name-validator-4.0.0.tgz, so I did not keep retrying registry downloads.
Validation update for the latest head 3746d533:
npm ci --workspace=client --include-workspace-root=false --ignore-scriptsnpm test -- --runTestsByPath src/lib/__tests__/proxyFetch.test.ts --runInBand(12 passed)npx prettier --check client/src/lib/proxyFetch.ts client/src/lib/__tests__/proxyFetch.test.tsgit diff --check origin/main...HEAD
GitHub reports the pushed commit signature as verified.
Closing: this targets the v1 codebase, which is deprecated.
When this PR was opened, main still held v1 — the diff is against client/src/…, the v1 layout. main has since become the release branch for v2 (clients/web/…, core/…), and the v1 line lives on v1/main, where it accepts security fixes only and takes no feature or non-security bug work. There is no branch this change could be retargeted to.
Thanks for taking the time to write it — that is genuinely appreciated, and the fact that it sat unanswered this long is on us, not on you. A sweep of deprecated v1 PRs ran on 2026-07-31 and selected on base branch v1/main; this one says main, so it was missed rather than passed over.
One thing worth knowing for anything you send next: the repo has since moved to an issues, not pull requests policy (CONTRIBUTING.md) — maintainers handle design and implementation, and external contributions come in as detailed issues. That policy landed after this PR was opened, so it is not the reason for this close; it is just where to start next time. If the underlying problem still reproduces on current v2, an issue describing it would be welcome.