Skip to content

mcp: advertise OAuth via RFC 9728 protected resource metadata#36669

Draft
bobbyiliev wants to merge 10 commits into
MaterializeInc:mainfrom
bobbyiliev:mcp-oauth-protected-resource-metadata
Draft

mcp: advertise OAuth via RFC 9728 protected resource metadata#36669
bobbyiliev wants to merge 10 commits into
MaterializeInc:mainfrom
bobbyiliev:mcp-oauth-protected-resource-metadata

Conversation

@bobbyiliev
Copy link
Copy Markdown
Contributor

@bobbyiliev bobbyiliev commented May 21, 2026

First step toward letting MCP clients that expect the standard OAuth discovery
flow (Claude Desktop Custom Connectors, ChatGPT remote MCP, etc.) connect to
our MCP endpoints. Per the MCP authorization spec,
the resource server MUST implement RFC 9728 Protected Resource Metadata; this
PR adds that piece and the matching 401 challenge.

Fixes https://linear.app/materializeinc/issue/DEX-31/support-oauth-21-authorization-flow-on-the-mcp-endpoints

@bobbyiliev bobbyiliev requested a review from a team as a code owner May 21, 2026 11:36
Copy link
Copy Markdown
Contributor

@def- def- left a comment

Choose a reason for hiding this comment

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

I added a test that would be important to fix! host injection

@bobbyiliev bobbyiliev marked this pull request as draft May 21, 2026 13:47
@bobbyiliev bobbyiliev changed the title mcp: advertise OAuth via RFC 9728 protected resource metadata while keeping Basic mcp: advertise OAuth via RFC 9728 protected resource metadata May 21, 2026
@def- def- force-pushed the mcp-oauth-protected-resource-metadata branch from 2e333ef to e4ae3fc Compare May 21, 2026 14:27
@def- def- self-requested a review May 21, 2026 14:42
bobbyiliev and others added 7 commits May 21, 2026 21:01
A payload like attacker.example.net" foo=bar smuggles a " into the
header value (accepted, HeaderValue::from_str only blocks CR/LF/control
bytes), closing the resource_metadata="..." parameter early. An RFC 7235
parser then reads the URL as https://attacker.example.net.
A payload like attacker.example.net" foo=bar smuggles a " into the
header value (accepted, HeaderValue::from_str only blocks CR/LF/control
bytes), closing the resource_metadata="..." parameter early. An RFC 7235
parser then reads the URL as https://attacker.example.net.
@bobbyiliev bobbyiliev force-pushed the mcp-oauth-protected-resource-metadata branch from fe2be6c to f48be5c Compare May 21, 2026 18:02
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.

2 participants