Closed
Labels
bugSomething isn't workingSomething isn't workingserver-everythingReference implementation for the Everything MCP server - src/everythingReference implementation for the Everything MCP server - src/everythingv2
Milestone
Description
Problem
fetchSafely in src/everything/tools/gzip-file-as-resource.ts checks that a response has a body but never checks its status. A URL that answers 404 or 500 is gzipped and returned, or registered as a resource, as though it were the requested file, with the error page as its content.
Expected
A non-2xx response cancels the body and fails the call with an error naming the URL and the status, as the tool already does for size and timeout failures.
Prior work
The PR(s) above targeted the pre-refactor code and are closed as part of the backlog triage in #4875; this issue is where the work continues, with the PR(s) as a prototype. Thank you to their authors.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingserver-everythingReference implementation for the Everything MCP server - src/everythingReference implementation for the Everything MCP server - src/everythingv2
Activity
cliffhall commentedon Oct 20, 2026
Triage: Priority Medium (total 6)
buglabelFiled from the PR backlog triage (#4877). Board: Servers V2 (#43), Status
Incoming, awaiting maintainer review (no milestone yet).kabishou11 commentedon Oct 20, 2026
I reproduced this on
v2/main(f18beb7) and built a fix locally. Per CONTRIBUTING, here is the prompt and the evidence rather than a PR.Prompt
The change was generated with this prompt (opencode CLI, model
opencode/deepseek-v4.1-flash-free, variantmax), run on a checkout that already contained the failing regression test listed below:Before
When a local HTTP server answers
404with the body<h1>Not Found</h1>, callinggzip-file-as-resourcewithoutputType: "resource"returns a successful result (isErrorunset). The embedded blob gunzips to<h1>Not Found</h1>.After
fetchSafelychecksresponse.okbefore the body check. On a non-2xx response it cancels the body and throws, so the tool returnsisError: truewithFetching <url> failed with HTTP 404 Not Found(or... 500 Internal Server Error), and no session resource is registered. The change also adds a patch changeset for@modelcontextprotocol/server-everything.Verification
__tests__/gzip-file-as-resource.test.ts: the default 404 route now sends an HTML body, and a new/server-errorroute returns 500. Newit.eachtest "rejects an HTTP error response from %s (everything: gzip-file-as-resource treats an HTTP error response as file content #5207)" asserts the exact error and thaterror.gzis not listed. Both cases failed before the change (2 failed, 12 passed).npm run validate -w src/everythinggives 341 tests passed.npm run coverage -w src/everythinggives 100% lines and functions.npm run validate:guardsandnpm run verify:dco: OK.cliffhall commentedon Oct 27, 2026
Fixed by #5290, merged into
v2/main; ships in v2.2.0 (tracker #5266).fix(everything): fail gzip-file-as-resource on an HTTP error response