feat(mcp): add MCP-Protocol-Version, Mcp-Method, and Mcp-Name HTTP headers#10808
Conversation
…TTP headers to `OneMcpServer` ### Description Adds `MCP-Protocol-Version`, `Mcp-Method`, and `Mcp-Name` HTTP headers for proxy requests issued by `OneMcpServer`, adhering to the MCP 0728 standard release candidate specification and SEP-2243: - https://blog.modelcontextprotocol.io/posts/2026-07-28-release-candidate/ - https://modelcontextprotocol.io/seps/2243-http-standardization ### Scenarios Tested - Unit tests in src/mcp/onemcp/onemcp_server.spec.ts verifying listTools sends `MCP-Protocol-Version` and `Mcp-Method`. - Unit tests in src/mcp/onemcp/onemcp_server.spec.ts verifying callTool sends `MCP-Protocol-Version`, `Mcp-Method`, `Mcp-Name`, and `x-goog-user-project` headers. ### Sample Commands npx mocha --require ts-node/register src/mcp/onemcp/onemcp_server.spec.ts
There was a problem hiding this comment.
Code Review
This pull request updates OneMcpServer to include MCP-Protocol-Version, Mcp-Method, and Mcp-Name HTTP headers in its requests, aligning with the MCP 0728 standard. The reviewer feedback consistently recommends changing the casing of MCP-Protocol-Version to Mcp-Protocol-Version in the source code, unit tests, and changelog to maintain consistency and adhere to standard casing.
| headers: { | ||
| "MCP-Protocol-Version": LATEST_PROTOCOL_VERSION, | ||
| "Mcp-Method": "tools/call", | ||
| "Mcp-Name": toolName, | ||
| ...(ctx.projectId ? { "x-goog-user-project": ctx.projectId } : {}), | ||
| }, |
There was a problem hiding this comment.
For consistency with other MCP headers like Mcp-Method and Mcp-Name, and to align with the standard casing defined in SEP-2243, use Mcp-Protocol-Version instead of MCP-Protocol-Version.
| headers: { | |
| "MCP-Protocol-Version": LATEST_PROTOCOL_VERSION, | |
| "Mcp-Method": "tools/call", | |
| "Mcp-Name": toolName, | |
| ...(ctx.projectId ? { "x-goog-user-project": ctx.projectId } : {}), | |
| }, | |
| headers: { | |
| "Mcp-Protocol-Version": LATEST_PROTOCOL_VERSION, | |
| "Mcp-Method": "tools/call", | |
| "Mcp-Name": toolName, | |
| ...(ctx.projectId ? { "x-goog-user-project": ctx.projectId } : {}), | |
| }, |
| expect(clientRequestStub.secondCall.args[0].headers).to.deep.include({ | ||
| "MCP-Protocol-Version": LATEST_PROTOCOL_VERSION, | ||
| "Mcp-Method": "tools/call", | ||
| "Mcp-Name": "test_tool", | ||
| "x-goog-user-project": "test-project", | ||
| }); |
There was a problem hiding this comment.
Update the test assertion to use the consistent casing Mcp-Protocol-Version.
| expect(clientRequestStub.secondCall.args[0].headers).to.deep.include({ | |
| "MCP-Protocol-Version": LATEST_PROTOCOL_VERSION, | |
| "Mcp-Method": "tools/call", | |
| "Mcp-Name": "test_tool", | |
| "x-goog-user-project": "test-project", | |
| }); | |
| expect(clientRequestStub.secondCall.args[0].headers).to.deep.include({ | |
| "Mcp-Protocol-Version": LATEST_PROTOCOL_VERSION, | |
| "Mcp-Method": "tools/call", | |
| "Mcp-Name": "test_tool", | |
| "x-goog-user-project": "test-project", | |
| }); |
Description
Adds
MCP-Protocol-Version,Mcp-Method, andMcp-NameHTTP headers for proxy requests issued byOneMcpServer, adhering to the MCP 0728 standard release candidate specification and SEP-2243:Scenarios Tested
MCP-Protocol-VersionandMcp-Method.MCP-Protocol-Version,Mcp-Method,Mcp-Name, andx-goog-user-projectheaders.Sample Commands
npx mocha --require ts-node/register src/mcp/onemcp/onemcp_server.spec.ts