feat: support custom HTTP headers from tool parameters in OneMcpServer - #10902
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds support for forwarding custom HTTP headers (Mcp-Param-*) to remote MCP tools when defined in tool parameter input schemas (x-mcp-header), per SEP-2243. It updates OneMcpServer to parse the tool's inputSchema and extract parameters mapped to headers, forwarding them during tool execution, and includes corresponding unit tests. The feedback suggests reducing nesting in the parameter-extraction loop by using continue statements to align with the repository's style guide.
joehan
approved these changes
Aug 7, 2026
### Description Adds support for forwarding custom HTTP headers (Mcp-Param-*) to remote MCP tools when defined in tool input parameter schemas via the x-mcp-header property per [SEP-2243](https://modelcontextprotocol.io/seps/2243-http-standardization). When OneMcpServer executes a tools/call request to a remote MCP backend, it inspects tool.inputSchema.properties for "x-mcp-header": "HeaderName". If present and the corresponding argument is supplied in args, OneMcpServer attaches Mcp-Param-<HeaderName>: <value> to the outbound HTTP request headers. Bug: 530219396 ### Scenarios Tested 1. Tested listTools() and verified tool schema mapping remains unchanged. 2. Tested callTool() with a tool having "x-mcp-header": "Region" in inputSchema.properties and verified Mcp-Param-Region: us-west1 is included in outbound POST headers to remote MCP servers. 3. Tested callTool() without x-mcp-header properties to ensure no extra headers are injected. 4. Ran unit tests (npx mocha src/mcp/onemcp/onemcp_server.spec.ts) and linters (npm run lint:changed-files). ### Sample Commands - npx mocha src/mcp/onemcp/onemcp_server.spec.ts
chkuang-g
force-pushed
the
chkuang/mcp-custom-header
branch
from
August 7, 2026 17:02
e560d80 to
992a805
Compare
yuichi0301
pushed a commit
to yuichi0301/firebase-tools
that referenced
this pull request
Aug 16, 2026
firebase#10902) ### Description Adds support for forwarding custom HTTP headers (Mcp-Param-*) to remote MCP tools when defined in tool input parameter schemas via the x-mcp-header property per [SEP-2243](https://modelcontextprotocol.io/seps/2243-http-standardization). When OneMcpServer executes a tools/call request to a remote MCP backend, it inspects tool.inputSchema.properties for "x-mcp-header": "HeaderName". If present and the corresponding argument is supplied in args, OneMcpServer attaches Mcp-Param-<HeaderName>: <value> to the outbound HTTP request headers. Bug: 530219396 ### Scenarios Tested 1. Tested listTools() and verified tool schema mapping remains unchanged. 2. Tested callTool() with a tool having "x-mcp-header": "Region" in inputSchema.properties and verified Mcp-Param-Region: us-west1 is included in outbound POST headers to remote MCP servers. 3. Tested callTool() without x-mcp-header properties to ensure no extra headers are injected. 4. Ran unit tests (npx mocha src/mcp/onemcp/onemcp_server.spec.ts) and linters (npm run lint:changed-files). ### Sample Commands - npx mocha src/mcp/onemcp/onemcp_server.spec.ts
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.
Description
Adds support for forwarding custom HTTP headers (
Mcp-Param-*) to remote MCP tools when defined in tool input parameter schemas via thex-mcp-headerproperty per SEP-2243.When OneMcpServer executes a
tools/callrequest to a remote MCP backend, it inspectstool.inputSchema.propertiesfor"x-mcp-header": "HeaderName". If present and the corresponding argument is supplied in args, OneMcpServer attachesMcp-Param-<HeaderName>: <value>to the outbound HTTP request headers.Bug: 530219396
Scenarios Tested
Sample Commands