Skip to content

fix(filter): capture x-mcp-method and x-mcp-name header variants - #291

Merged
telleroutlook merged 1 commit into
mainfrom
fix/mcp-header-variants
Jul 22, 2026
Merged

fix(filter): capture x-mcp-method and x-mcp-name header variants#291
telleroutlook merged 1 commit into
mainfrom
fix/mcp-header-variants

Conversation

@telleroutlook

Copy link
Copy Markdown
Contributor

Closes #79

on_http_request_headers() now tries x-mcp-method first, falls back to mcp-method. Same fallback for mcp_name. proxy-wasm normalises headers to lowercase so both X-MCP-Method and MCP-Method are handled. cargo build && cargo test green.

on_http_request_headers() previously only looked up the bare
'mcp-method' / 'mcp-name' headers. The MCP protocol also uses the
'x-mcp-method' / 'x-mcp-name' prefixed form (and clients sending
'X-MCP-Method' / 'MCP-Method' as documented in the milestone).

proxy-wasm normalises header names to lowercase at the host boundary,
so the lookup is case-insensitive once lowercased. This change adds a
fallback chain: try 'x-mcp-method' first (prefixed form), then fall
back to 'mcp-method'. Same pattern for mcp_name.

No struct changes required (fields already exist). Existing tests pass
unchanged; cargo build + cargo test green.

Closes #79
@telleroutlook
telleroutlook merged commit a585e25 into main Jul 22, 2026
3 checks passed
@telleroutlook
telleroutlook deleted the fix/mcp-header-variants branch July 22, 2026 13:50
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.

[milestone Milestone 1 ] Fix crates/proxy-wasm-evidence/src/filter.rs on_http_request_headers(): capt...

1 participant