design: add MCP client proxy design doc - #674
Conversation
Defines the proxy architecture for MCP Inspector-like functionality. The proxy lives in the developer-portal-controller and handles gateway discovery, auth passthrough, session management, and multi-gateway support. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: R-Lawton <rlawton@redhat.com>
📝 WalkthroughWalkthroughAdds a design document for an MCP Client Proxy in ChangesMCP Client Proxy
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/designs/2026-07-15-mcp-client-proxy-design.md`:
- Around line 36-39: Update the endpoint selection and outbound proxy flow
described in the MCPGatewayExtension design to validate privateHost before use:
allow only http/https, approved internal hostname forms and ports, reject
resolutions to loopback, link-local, private, or otherwise unauthorized IP
ranges, and disable or revalidate redirects against the same rules. Ensure
forwarded Authorization headers are sent only after the target passes
validation, while preserving the derived Gateway endpoint behavior.
- Around line 74-104: Update the “MCP protocol” and request/response flow
sections to explicitly document the proxy’s HTTP contract: require Accept to
include both application/json and text/event-stream, describe handling of 202
notification responses with no body, and state whether the proxy supports these
behaviors or intentionally exposes a JSON-only subset. If JSON-only, define the
rejection behavior for unsupported Accept values and notification-only requests,
including status and response handling.
- Around line 118-127: The proxy flow described in the session-handling section
must automatically recover from a 404 on any session-bearing request: clear the
stale Mcp-Session-Id, issue a fresh initialize request, capture the replacement
session header, and retry the original request. Update the statements under the
session lifecycle and 404 behavior to document this recovery instead of
requiring manual reconnect.
- Around line 80-88: Add explicit deadlines and cancellation propagation to the
proxy’s outbound POST, enforce maximum request and response body sizes, and
apply a concurrency limit around the gateway call. Update the “Sends this
request to the gateway” flow while preserving the existing header and body
forwarding behavior.
- Around line 34-39: Update the endpoint-resolution design to use the targeted
Gateway’s reported status/address data rather than assuming gatewayClassName
determines a Service name. If the generated <gateway-name>-<gatewayClassName>
convention is required, explicitly define it as an MCP Gateway contract and add
validation that the referenced Gateway conforms before constructing the
endpoint.
- Around line 106-115: Clarify the Auth model section to explicitly state the
intended access-control behavior for gateways without an AuthPolicy, including
that they are publicly callable if that is the design. Distinguish controller
ServiceAccount RBAC, which only governs discovery, from user authorization for
GET /gateways and POST /gateways/{namespace}/{name}/mcp; if uncovered gateways
should not be public, define the required per-gateway authorization or filtering
model.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8a560c51-e9da-47c1-b32d-25954583c67b
📒 Files selected for processing (1)
docs/designs/2026-07-15-mcp-client-proxy-design.md
|
Will dig into this today |
|
After reading this and some experimentation, I've got a different take on what we should do here. Taking as given that we want a way to debug/test MCP in-console without reaching for mcp-inspector.* Some thoughts:
Extending the developer-portal-controller bothered me a bit:
*I could easily be swayed that we don't want this at all. Is it something we think we want, or has it come from elsewhere? For what it's worth it doesn't look like it originated in this PR: #667 is an accepted epic for MCP management UI with a Figma prototype behind it, and #670-673 hang off that, so someone has designed for it. Worth knowing who's asking before we build the plumbing. |
|
hey @jasonmadigan, i think your approach makes a lot of sense here — pushing CORS config into the gateway via would you mind writing up a design doc for your proposal? i'd like to close this PR in favour of that. we can link them together for context. |
|
I should have a draft design doc for this a little later today. Want to write a small PoC to prove whether some issues with content security policies are real or imaginary... |
In-console MCP inspection via a new spec.cors on MCPGatewayExtension: the browser speaks Streamable HTTP directly to the gateway, superseding the proxy in Kuadrant#674. Includes PoC results (two-host tool list + call, CORS and CSP findings on real ROSA 4.21) and the remaining gaps. Refs Kuadrant#667 Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
In-console MCP inspection via a new spec.cors on MCPGatewayExtension: the browser speaks Streamable HTTP directly to the gateway, superseding the proxy in Kuadrant#674. Includes PoC results (two-host tool list + call, CORS and CSP findings on real ROSA 4.21) and the remaining gaps. Refs Kuadrant#667 Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
In-console MCP inspection via a new spec.cors on MCPGatewayExtension: the browser speaks Streamable HTTP directly to the gateway, superseding the proxy in Kuadrant#674. Includes PoC results (two-host tool list + call, CORS and CSP findings on real ROSA 4.21) and the remaining gaps. Refs Kuadrant#667 Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
In-console MCP inspection via a new spec.cors on MCPGatewayExtension: the browser speaks Streamable HTTP directly to the gateway, superseding the proxy in Kuadrant#674. Includes PoC results (two-host tool list + call, CORS and CSP findings on real ROSA 4.21) and the remaining gaps. Refs Kuadrant#667 Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
In-console MCP inspection via a new spec.cors on MCPGatewayExtension: the browser speaks Streamable HTTP directly to the gateway, superseding the proxy in Kuadrant#674. Includes PoC results (two-host tool list + call, CORS and CSP findings on real ROSA 4.21) and the remaining gaps. Refs Kuadrant#667 Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
In-console MCP inspection via a new spec.cors on MCPGatewayExtension: the browser speaks Streamable HTTP directly to the gateway, superseding the proxy in Kuadrant#674. Includes PoC results (two-host tool list + call, CORS and CSP findings on real ROSA 4.21) and the remaining gaps. Refs Kuadrant#667 Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
In-console MCP inspection via a new spec.cors on MCPGatewayExtension: the browser speaks Streamable HTTP directly to the gateway, superseding the proxy in Kuadrant#674. Includes PoC results (two-host tool list + call, CORS and CSP findings on real ROSA 4.21) and the remaining gaps. Refs Kuadrant#667 Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
|
closing in favour of #748 |
In-console MCP inspection via a new spec.cors on MCPGatewayExtension: the browser speaks Streamable HTTP directly to the gateway, superseding the proxy in Kuadrant#674. Includes PoC results (two-host tool list + call, CORS and CSP findings on real ROSA 4.21) and the remaining gaps. Refs Kuadrant#667 Signed-off-by: Jason Madigan <jason@jasonmadigan.com>
Summary
Key decisions
🤖 Generated with Claude Code
Summary by CodeRabbit