-
Notifications
You must be signed in to change notification settings - Fork 127
Add proposal for Remote MCP Server Proxy Support #2151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2151 +/- ##
==========================================
- Coverage 53.05% 52.98% -0.07%
==========================================
Files 222 222
Lines 28868 28868
==========================================
- Hits 15315 15296 -19
- Misses 12414 12436 +22
+ Partials 1139 1136 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@claude Can you review the proposal made in this PR? Put your Kubernetes and security hat on for this one |
Claude finished @ChrisJBurns's task —— View job Remote MCP Proxy Proposal ReviewI've completed a thorough review of the proposal from both Kubernetes and security perspectives. Overall, this is a well-architected proposal that builds intelligently on existing ToolHive infrastructure. Below is my detailed feedback. ✅ StrengthsArchitecture & Design
Security Model
🔴 Critical Issues1. Missing CRD Type Definition for
|
Note that the external auth config crd is here #2150 |
docs/proposals/remote-mcp-proxy.md
Outdated
} | ||
``` | ||
|
||
**With OAuth-capable clients (future):** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure this is the structure of future clients config files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it wasn't very clever for me to add samples here. I removed it. It's not up to us how these look like. The point was that it should work.
docs/proposals/remote-mcp-proxy.md
Outdated
name: salesforce-tools | ||
|
||
port: 8080 | ||
replicas: 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this bit. If we want the proxy runner to dynamically scale itself based on usage, this value will keep overriding it back to 3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the replicas from the CRD. Probably once this is implemented we should instead document how the Deployment looks like so folks can configure HPA or something along those lines accordingly without conflicting with the operator.
1a50fe9
to
daf7537
Compare
- Add validation rules and defaults | ||
|
||
**Controller**: `cmd/thv-operator/controllers/mcpremoteproxy_controller.go` | ||
- Create Deployment running `thv-proxyrunner` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is everything in proxyrunner implemented to support this use-case?
Replicas int32 `json:"replicas,omitempty"` | ||
|
||
// Optional: Company OIDC for token exchange | ||
OIDCConfig *OIDCConfigRef `json:"oidcConfig,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need the OIDCConfig for TE, IIRC all the information is in ExternalAuthConfigRef...I guess you just need OIDCConfig to validate the incoming token?
|
||
### Token Handling | ||
|
||
**No Token Storage**: Proxy never stores user tokens. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how it works currently, but note that for token exchange this might change...as every exchange is not completely free, we might want to implement some sort of caching, I was thinking about taking oauth2.ReuseTokenSource
into use.
This proposal extends the ToolHive Kubernetes operator to support proxying remote Model Context Protocol (MCP) servers with OAuth authentication, bringing feature parity with the existing `thv run <remote-url>` CLI capability. Key features: - New MCPRemoteProxy CRD for deploying remote MCP proxies - JWT validation and identity extraction for policy enforcement - Optional token exchange support via MCPExternalAuthConfig CRD - Integration with existing authz, audit, and tool filtering - Stateless, horizontally scalable architecture This enables enterprises to gain centralized observability and policy enforcement over external MCP usage without requiring changes to remote services or storing user credentials. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> Signed-off-by: Juan Antonio Osorio <[email protected]>
Add status field enhancements: - Add ObservedGeneration field - Document recommended condition types (Ready, RemoteAvailable) Add implementation clarifications: - Explain authentication model differences between CLI and K8s proxy - Document two proxy modes: direct (token forwarding) vs token exchange - Clarify OIDC configuration validates different issuers in different modes - Document cross-namespace reference policy - Specify middleware ordering - Note that token exchange may use oauth2.ReuseTokenSource for caching Fix numbering in best practices list. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
d041022
to
2807939
Compare
Thanks for the review! I've addressed your comments in commit 2807939: Re: OIDC Config for token exchange (line 283): Re: Token exchange caching (line 425): Re: ProxyRunner implementation (line 395):
Added middleware ordering to the proposal. |
Summary
This proposal extends the ToolHive Kubernetes operator to support proxying remote MCP servers with OAuth authentication, bringing the
thv run <remote-url>
CLI capability to Kubernetes.Problem
Organizations can't deploy centralized remote MCP proxies in Kubernetes to gain visibility, enforce policies, and maintain audit logs for employee interactions with external SaaS MCP services (e.g., Salesforce MCP, GitHub MCP).
Proposed Solution
Seeking Feedback On
🤖 Generated with Claude Code