mcp_json_rest_bridge: add protocolVersion header check and support#44133
Open
guoyilin42 wants to merge 2 commits intoenvoyproxy:mainfrom
Open
mcp_json_rest_bridge: add protocolVersion header check and support#44133guoyilin42 wants to merge 2 commits intoenvoyproxy:mainfrom
guoyilin42 wants to merge 2 commits intoenvoyproxy:mainfrom
Conversation
Signed-off-by: Yilin Guo <guoyilin@google.com>
Contributor
Author
Contributor
Author
|
/gemini review |
Contributor
There was a problem hiding this comment.
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.
source/extensions/filters/http/mcp_json_rest_bridge/mcp_json_rest_bridge_filter.cc
Outdated
Show resolved
Hide resolved
source/extensions/filters/http/mcp_json_rest_bridge/mcp_json_rest_bridge_filter.cc
Outdated
Show resolved
Hide resolved
source/extensions/filters/http/mcp_json_rest_bridge/mcp_json_rest_bridge_filter.cc
Outdated
Show resolved
Hide resolved
Signed-off-by: Yilin Guo <guoyilin@google.com>
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.
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:]