Repository navigation
Description
Summary
When using a VirtualMCPServer (vMCP) with multiple discovered MCPServer backends, there is currently no first-class way to authorize access to all tools belonging to a specific backend.
Today, tools are exposed as individual Tool entities and inherit from the vMCP server entity itself:
Tool::<tool-name>
-> parent MCP::<vmcp-name>
This makes the following policy work:
permit(principal, action, resource)
when {
resource in MCP::"vmcp-main"
};
However, backend MCPServer resources are not represented as Cedar entities, so policies such as:
permit(principal, action, resource)
when {
resource in MCP::"backend-a"
};
do not match any tools.
Current workaround
The current workaround is to use prefix matching on the resolved tool name:
permit(principal, action, resource)
when {
resource.name like "backend-a_*"
};
This works, but it relies on string matching rather than a resource hierarchy.
Requested enhancement
Represent discovered backends as Cedar entities and make tools inherit from their originating backend.
For example:
Tool::"backend-a_get_user"
-> parent MCP::"backend-a"
Tool::"backend-b_read_file"
-> parent MCP::"backend-b"
This would allow policies such as:
permit(principal in THVGroup::"mcp.common", action, resource)
when {
resource in MCP::"backend-a"
};
and
permit(principal in THVGroup::"mcp.dev", action, resource)
when {
resource in MCP::"backend-b"
};
without enumerating individual tools or relying on naming conventions.
Use case
A common scenario is a single vMCP aggregating multiple backends where access should be granted per backend rather than per tool.
Example:
backend-a = Directory / Identity tools
backend-b = File access tools
backend-c = Infrastructure tools
Administrators may want to grant access to all tools from a backend while keeping a single vMCP endpoint and a clean Cedar authorization model.
Environment
- ToolHive v0.29.1
- VirtualMCPServer with dynamically discovered MCPServer backends
- Cedar authorization enabled
Activity
jhrozek commentedon Jun 11, 2026
I think this is a valid RFE. We'd want to extend the schema with a Backend entity type. Tool entities become children of both MCP (the vMCP) and their origin Backend. A policy can then say:
This requires:
Sanskarzz commentedon Aug 9, 2026
@jhrozek I’m interested in working on this. I’ve reviewed the proposed direction around adding the Backend entity, associating tools with their originating backend, and updating the vMCP authorization configuration.
Since this is a security-sensitive change that spans the Cedar model and vMCP/operator configuration, would you prefer that I start with an RFC/design proposal, or is the direction described here sufficient to proceed directly with implementation?
If this issue is available, please assign it to me. Thanks!
jhrozek commentedon Aug 10, 2026
Give it a shot I do think this issue needs a bit of design around the cedar mechanics
Sanskarzz commentedon Aug 10, 2026
@jhrozek Thanks! I went through the current vMCP/Cedar authorization flow and the THV-0076 implementation before puting the design.
Today, the vMCP aggregator already records the originating backend in
Tool.BackendID. This value is preserved even when a tool is renamed by prefix, priority, or manual conflict resolution.The Cedar admission layer also receives the complete vmcp.Tool for both listing and calling tools. However, it currently passes only
tool.Nameto the authorizer, so theBackendIDis lost before the Cedar resource entity is created.My proposed entity shape is:
This keeps the existing vMCP-wide policies working while allowing backend-scoped policies such as:
The BackendID would come only from the aggregated vmcp.Tool, not from the tool name, arguments, or any client-controlled value.
In the original suggestion, backend membership was generated from the routing table and added to the authz ConfigMap. After checking the current implementation, I think we could build this relationship when the Cedar request entity is created instead:
Building the parent at runtime would use the same BackendID that routing uses, remain correct with dynamic backend discovery, and avoid maintaining a second backend-membership graph in the ConfigMap. For direct resource in Backend::"..." checks, the Backend parent UID should be sufficient. Materialized Backend entities could still be added later if backends need their own attributes or group hierarchy.
I would keep the first change scoped to tools. Resources and prompts also carry BackendID, but their direct authorization paths need some additional lookup work to maintain list/operation consistency.
I also checked the THV-0076 epic (#5419). The pieces this depends on
BackendIDpreservation, the core admission seam, direct VMCP calls, and routing through the new core have already landed. The remaining assembly API and documentation/example work does not appear to block this change.Before I start implementing, could you please confirm:
CC: @tgrunnagle
Sanskarzz commentedon Aug 30, 2026
Hi @jhrozek, do you have an update on the confirmations?