Skip to content

feat(mcp): refactor request output and add --filename option#40454

Merged
yury-s merged 8 commits intomicrosoft:mainfrom
yury-s:mcp-requests-static-note
Apr 28, 2026
Merged

feat(mcp): refactor request output and add --filename option#40454
yury-s merged 8 commits intomicrosoft:mainfrom
yury-s:mcp-requests-static-note

Conversation

@yury-s
Copy link
Copy Markdown
Member

@yury-s yury-s commented Apr 28, 2026

Summary

  • browser_network_requests now appends a note when static requests are hidden, telling the user to pass --static (CLI) or static: true (MCP) to see them.
  • browser_network_request no longer fetches the response body or inlines the post body; it points at the request-body / response-body part-commands instead.
  • The 5 part-commands (request, request-headers, request-body, response-headers, response-body) now accept a --filename option that saves the result to the client workspace.

yury-s added 7 commits April 27, 2026 17:28
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.
@github-actions

This comment has been minimized.

@yury-s yury-s merged commit 21ca727 into microsoft:main Apr 28, 2026
10 checks passed
@yury-s yury-s deleted the mcp-requests-static-note branch April 28, 2026 18:27
@github-actions
Copy link
Copy Markdown
Contributor

Test results for "MCP"

6795 passed, 927 skipped


Merge workflow run.

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.

2 participants