feat(mcp): refactor request output and add --filename option#40454
Merged
yury-s merged 8 commits intomicrosoft:mainfrom Apr 28, 2026
Merged
feat(mcp): refactor request output and add --filename option#40454yury-s merged 8 commits intomicrosoft:mainfrom
yury-s merged 8 commits intomicrosoft:mainfrom
Conversation
When the requests tool filters out successful static resources, append a note to the result with the count and how to include them. The hint uses `--static` in skill (CLI) mode and `"static"` in MCP mode.
When the request details include a request body or response body, append a one-line hint pointing at the request-body / response-body commands (CLI skill mode) or browser_network_request part calls (MCP).
The full request details no longer eagerly fetch and persist the response body to a file. Callers should use the response-body command (or the response-body part) to read it explicitly.
The full request details no longer print the post body inline; callers should use the request-body command (or the request-body part) to read it. The hint line is unchanged.
The browser_network_request tool now accepts a filename argument that saves the result (full details, headers, or body) to that file in the client workspace. The CLI commands request, request-headers, request-body, response-headers, and response-body each expose a --filename option that plumbs through to it.
- Drop the { text, isFilePath } return shape from renderRequestPart;
let it write to the Response directly via addResult / addTextResult.
- Use addResult unconditionally in the no-part path; it already falls
through to addTextResult when no suggestedFilename is given.
- Use part-specific titles (Request body / Response headers / ...) so
the saved-to-file link matches the content instead of always saying
"Body".
- Extract canHaveResponseBody() and call it from saveResponseBody so
the RFC 7230 status list lives in one place.
- Extract partHint() to drop the duplicated CLI/MCP wording, and
collect hint lines into an array so the blank-line spacing isn't
encoded as a cross-branch flag.
This comment has been minimized.
This comment has been minimized.
pavelfeldman
approved these changes
Apr 28, 2026
Contributor
Test results for "MCP"6795 passed, 927 skipped Merge workflow run. |
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
browser_network_requestsnow appends a note when static requests are hidden, telling the user to pass--static(CLI) orstatic: true(MCP) to see them.browser_network_requestno longer fetches the response body or inlines the post body; it points at therequest-body/response-bodypart-commands instead.request,request-headers,request-body,response-headers,response-body) now accept a--filenameoption that saves the result to the client workspace.