Skip to content

mcp_json_rest_bridge: add protocolVersion header check and support#44133

Open
guoyilin42 wants to merge 2 commits intoenvoyproxy:mainfrom
guoyilin42:mcp
Open

mcp_json_rest_bridge: add protocolVersion header check and support#44133
guoyilin42 wants to merge 2 commits intoenvoyproxy:mainfrom
guoyilin42:mcp

Conversation

@guoyilin42
Copy link
Copy Markdown
Contributor

Commit Message: mcp_json_rest_bridge: add protocolVersion header check and support
Additional Description:
The filter now supports version negotiation specified in https://modelcontextprotocol.io/specification/2025-11-25/basic/lifecycle#version-negotiation. Also modified test files to use a more consistent style for the expect setup.
Risk Level: Low
Testing: Unit and Integ tests
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

Signed-off-by: Yilin Guo <guoyilin@google.com>
@guoyilin42
Copy link
Copy Markdown
Contributor Author

@paulhong01

@guoyilin42
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for MCP protocol versioning by adding a default protocol version and a dedicated header for version tracking. The changes include a new validation mechanism for the 'mcp-protocol-version' header in incoming requests and a negotiation process during the initialization phase to ensure compatibility. Feedback focuses on improving maintainability by replacing magic strings with named constants and optimizing performance by using string views to avoid unnecessary heap allocations.

Signed-off-by: Yilin Guo <guoyilin@google.com>
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.

1 participant