-
Notifications
You must be signed in to change notification settings - Fork 133
Add Virtual MCP Server proposal #2106
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
a2a5279 to
9312f00
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2106 +/- ##
=======================================
Coverage 53.61% 53.61%
=======================================
Files 239 239
Lines 30704 30704
=======================================
Hits 16463 16463
Misses 13071 13071
Partials 1170 1170 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@claude please review this |
|
Claude finished @JAORMX's task —— View job Code Review: Virtual MCP Server ProposalI've reviewed the Virtual MCP Server proposal. This is a well-thought-out design that appropriately leverages existing ToolHive constructs. Here's my detailed feedback: Strengths1. Excellent reuse of existing patterns ✓
2. Clear phased implementation ✓
3. Good alignment with MCP specification ✓
Issues & Recommendations1. Authentication design needs clarification
|
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.
Pull Request Overview
This PR introduces a technical proposal for a Virtual MCP Server feature that consolidates multiple MCP servers from a ToolHive group into a single unified interface. The proposal aims to simplify client integration and centralize authentication complexity while maintaining backward compatibility.
- Adds comprehensive design documentation for the Virtual MCP Server (
thv virtualcommand) - Defines group-based architecture leveraging existing ToolHive constructs
- Outlines phased implementation approach from basic aggregation to enterprise features
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@JAORMX This part of Claudes review is what I was getting at in the vMCP GDoc. I'll explain more here just so it's visible to others. If the benefit of vMCP itself is that it can aggregate 10 backing MCP servers, that's great, but let's think of the security implications / risks of this. In this case, a single vMCP server will have access to different 10 MCP servers. In the event that vMCP is ever exploited, would it be able to make calls to the backing MCP servers directly? Or will they themselves be protected by authn/z? If so, then this isn't as much of a concern from me. |
I see. So... we should clarify the architecture and deployment recommendations then. backed MCP servers should still not be deployed as they are without appropriate protections. That is, they should still enforce authentication and perhaps even authorization. If the vMCP is ever exploited, the backed MCP servers will still authenticate and authorize the request. I'm more keen on a zero-trust policy in general. |
@JAORMX Yep, that would be my understanding (and hope) too! I had a feeling you thought the same way but I just wanted to triple check 😄 |
|
@ChrisJBurns picture me with a tinfoil hat on at any given moment 😄 |
Hmm, but the vMCP server would be an OAuth app so the user would connect with a token that says That would work if we can use token exchange all the way through, but not if we need to drive a consent and do the full flow (we would want to drive the consent chain to the consent on the vMCP server correct)? So in that case we'd have to send the back end server through a back channel? |
13e4f9d to
6fc029f
Compare
This proposal introduces MCPGroup support to the Kubernetes operator, enabling the Virtual MCP Server feature and logical grouping of MCPServer resources. Key design decisions: - Explicit group field on MCPServer spec (matches CLI behavior) - Simple MCPGroup CRD with description field - Status tracks server list and count - Namespace-scoped groups only - Enables field selector queries for group membership Related: #2106
a983db5 to
f1f918c
Compare
|
@claude could you do another review? |
|
Claude finished @JAORMX's task —— View job Code Review: Virtual MCP Server ProposalI've completed a thorough review of the Virtual MCP Server proposal. The document has been significantly enhanced since the last review, with excellent additions around elicitation support and composite tools. Here's my detailed feedback: Summary of Changes Since Last ReviewThe most recent commit (f1f918c) added:
These additions substantially improve the proposal's completeness and practicality. Strengths1. Excellent architectural reuse ✅
2. Clear phased implementation ✅
3. Elicitation integration is well-designed ✅
4. Practical examples ✅
Critical Issues1. Token Exchange Integration Needs Clarification
|
f1f918c to
ac1d31f
Compare
|
@claude please do another review |
|
Claude finished @JAORMX's task —— View job Code Review: Virtual MCP Server ProposalI've completed a comprehensive review of the Virtual MCP Server proposal. This is a substantial and well-structured document that has clearly evolved based on previous feedback. Here's my detailed assessment: Overall AssessmentVerdict: ✅ Strong proposal with excellent improvements This proposal demonstrates thoughtful design and has addressed many concerns from the previous review. The document is now significantly more comprehensive, particularly with:
Key Strengths1. Excellent Security Architecture ✅ (lines 128-248)The proposal now includes a thorough security section addressing the zero-trust concerns raised by @ChrisJBurns and @JAORMX:
This directly addresses the PR discussion about whether backends should enforce their own auth even when accessed via Virtual MCP. The answer is clearly "yes" (line 179: "Each backend MCP server MUST enforce its own authentication"). 2. Token Exchange Integration Well-Documented ✅ (lines 950-963)The proposal now properly references THV-2063 and explains:
This resolves the previous review's Issue #1 about token exchange clarity. 3. Conflict Resolution Fully Specified ✅ (lines 700-778)All three strategies are now well-documented with examples:
This resolves the previous review's Issue #3. 4. Comprehensive Error Handling ✅ (lines 781-853)The proposal now covers:
This addresses the previous review's Issue #4 about failure modes. 5. Practical Examples ✅The incident investigation example (lines 427-463) effectively demonstrates tool reuse with multiple calls to the same backend tool with different URLs. This is a compelling use case. Issues and RecommendationsCritical Issue #1: Token Exchange Flow Security Gap
|
|
|
||
| # ===== TOKEN CACHING ===== | ||
| token_cache: | ||
| provider: memory # memory | redis | custom |
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.
Would this be encrypted given it will be a token cache
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.
You mean the memory one, or in general?
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.
in general
|
|
||
| 2. **Outgoing Authentication** (Virtual MCP → Backends) | ||
| - **Purpose**: Per-backend token exchange for accessing backend services | ||
| - **Token Audience**: Backend-specific (e.g., `aud=github-api`, `aud=jira-api`) |
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 confused when you say github-api do you mean a token issued by github's IDP meant to access github's API or a token issued by the same IDP as the vMCP meant to access the back end MCP server?
| - **Configuration**: `incomingAuth` (K8s) / `incoming_auth` (CLI) | ||
| - **Implementation**: Uses existing ToolHive auth middleware (OIDC, local, anonymous) | ||
|
|
||
| 2. **Outgoing Authentication** (Virtual MCP → Backends) |
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.
nit but let's use "Back end MCP" here (see my question below)
|
|
||
| - **accept**: User provided data (accessible via `{{.steps.step_id.content}}`) | ||
| - **decline**: User explicitly rejected the request | ||
| - **cancel**: User dismissed without choosing |
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.
Note that elicitation pretty much kills scalability because you need to send the elicitation response to the same MCP server, so we /must/ keep vMCP a singleton in that case.
|
|
||
| ### Zero-Trust Security Model | ||
|
|
||
| Virtual MCP adheres to a zero-trust security architecture where compromising one layer does not automatically grant access to others: |
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 think this is good, but again I think we should extend the architecture all the way to the back end. The primary reason is that if we want to support an interactive flow to acquire credentials - either for the back end MCP servers that might be authed by a different IDP or the back end APIs, I think that we need to do the OAuth flow on the vMCP side because that's the only one a browser will interact with. In that case (back end interactive auth) we also need to transfer the back end creds, which means sending 2 creds (vMCP and back end) in one go.
| TokenMgr->>Cache: Store token with TTL | ||
| end | ||
|
|
||
| TokenMgr->>Backend: Forward request + Bearer token (aud=backend-api) |
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.
do you think the token mgr should be forwarding the tokens or just caching? Asking because we have a pending issue to wrap TokenSource in a caching layer even for the usual token exchange in the middlewares and I think it would be cool to reuse here.
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'll take all I can re-use! I'm open to changing/enhancing this.
This proposal introduces a Virtual MCP Server that aggregates multiple MCP servers from a ToolHive group into a single unified interface. Key features: - Leverages existing ToolHive groups for backend management - Uses existing ToolsFilter and ToolOverride constructs - Supports per-backend authentication strategies - Enables composite tools for cross-service workflows - Maintains full MCP protocol compatibility The Virtual MCP Server will simplify client integration by providing a single connection point while handling the complexity of multiple backend authentication requirements and tool namespace management. Signed-off-by: Juan Antonio Osorio <[email protected]>
ac1d31f to
53f8c5a
Compare
Summary
This PR introduces a proposal for the Virtual MCP Server, a new ToolHive feature that aggregates multiple MCP servers from a group into a single unified interface.
What does this PR do?
Adds a technical proposal document that outlines the design and implementation approach for the Virtual MCP Server (
thv virtualcommand).Key Design Decisions
ToolsFilterfor including specific tools andToolOverridefor renaming/redescribing toolsBenefits
Testing
This is a proposal document - implementation and testing will follow in subsequent PRs.
Related Issues
This proposal addresses the need for consolidating multiple MCP servers as discussed in the Virtual MCP design document.