Contrib/1690
why
From 1690 shoutout @huuyafwww !
This enables agent to connect to MCP servers that require Authorization headers.
what changed
connectToMCPServer was modified to accept options for StreamableHTTPClientTransport as arguments.
test plan
A public api test was added
[!NOTE]
Low Risk
Small additive API change that only affects MCP HTTP connection setup; minimal behavior change unless callers opt into requestOptions.
Overview
connectToMCPServer now accepts requestOptions and forwards them to StreamableHTTPClientTransport, enabling HTTP connections to MCP servers that require request-header auth (e.g., Authorization).
Updates the public API type test to include requestOptions, adds docs showing a header-authenticated connection example, and publishes patch changesets for @browserbasehq/stagehand and @browserbasehq/stagehand-docs.
Written by Cursor Bugbot for commit 657b7d5fb2350ec2d171175b366b72b671a7315e. This will update automatically on new commits. Configure here.
Summary by cubic
Enable header-based auth for MCP HTTP connections. connectToMCPServer now accepts requestOptions and forwards them to StreamableHTTPClientTransport.
- New Features
- Added requestOptions to connectToMCPServer for HTTP transports to pass headers like Authorization.
- Updated docs with an authenticated MCP server example, expanded the public API type test, and limited the changeset bump to @browserbasehq/stagehand (docs package bump removed).