Repository navigation
Description
Bug description
When a VirtualMCPServer references an MCPAuthzConfig that sets multi_valued_claims, the setting is accepted and validated but never reaches the Cedar authorizer. As a result, the claimset_<name> attribute documented in the authz policy reference (Multi-valued claim normalization) is never created, and Cedar policies that use it always deny.
No validation error or warning is emitted, so the misconfiguration is invisible.
Reproduction
Given an MCPAuthzConfig:
apiVersion: toolhive.stacklok.dev/v1beta1
kind: MCPAuthzConfig
metadata:
name: example-authz
spec:
type: cedarv1
config:
multi_valued_claims: ["scope"]
entities_json: "[]"
policies:
- |
permit(
principal,
action == Action::"call_tool",
resource == Tool::"example_get-weather"
) when {
principal has claimset_scope &&
principal.claimset_scope.contains("weather:read")
};referenced by a VirtualMCPServer via spec.incomingAuth.authzConfigRef, and a token whose claims (JWT or RFC 7662 introspection) include:
{
"active": true,
"sub": "user-123",
"scope": "weather:read"
}the tool is excluded from tools/list.
The gateway logs show:
Client::"user-123" does not have the attribute `claimset_scope`
Expected behavior
multi_valued_claims should be honored for VirtualMCPServer the same way it is for thv run, MCPServer, and MCPRemoteProxy: principal.claimset_scope should be a Cedar Set (["weather:read"]) and the policy above should permit the call.
If the field is intentionally unsupported for vMCP, the operator should reject it or surface a status condition instead of silently dropping it.
Actual behavior
The field is parsed into cedar.ConfigOptions.MultiValuedClaims, but the vMCP path copies only an allow-list of fields and drops it:
cmd/thv-operator/pkg/vmcpconfig/converter.go,resolveAuthzConfigRef: buildsvmcpconfig.AuthzConfigfromPolicies,EntitiesJSON,GroupClaimName,RoleClaimName, andGroupEntityTypeonly. The ConfigMap branch ofconvertAuthzConfighas the same omission.pkg/vmcp/config/config.go:AuthzConfighas noMultiValuedClaimsfield.pkg/vmcp/auth/factory/incoming.go: buildscedar.ConfigOptionswithoutMultiValuedClaims, so the authorizer runs with it empty and never addsclaimset_*attributes.
Environment (if relevant)
- ToolHive version: vmcp:v0.49.0
Suggested direction
Plumb MultiValuedClaims through the vMCP path the same way GroupClaimName/RoleClaimName are:
- Add
MultiValuedClaims []stringtovmcpconfig.AuthzConfig. - Copy
opts.MultiValuedClaimsinresolveAuthzConfigRefand in the ConfigMap branch ofconvertAuthzConfig. - Pass it into
cedar.ConfigOptionsinpkg/vmcp/auth/factory/incoming.go.
Optionally, update the docs to note which deployment modes supportmulti_valued_claimsuntil this lands.
Activity
Sanskarzz commentedon Oct 4, 2026
Hi @lorenzozanee, thanks for raising the PR!
Before starting work on an issue, please make sure it’s assigned to you first. Please leave a comment on the issue, and I can assign it to you.
Please read CONTRIBUTING.md .
suantea commentedon Oct 11, 2026
I've opened #6794 to plumb multi_valued_claims through the vMCP authz path (vMCP config + auth factory + operator converter). All targeted tests pass and build is clean.
suantea commentedon Oct 11, 2026
Implemented in PR #6794 which also wires the OIDC transport flags and lockfile cleanup fix.
aponcedeleonch commentedon Nov 12, 2026
Sorry for the slow response on this one, @ngocketit. We checked this against current main and your diagnosis still holds: the vMCP converter and
buildCedarAuthzConfiginpkg/vmcp/auth/factory/incoming.gocarry the group and role claim settings but notmulti_valued_claims, so theclaimset_*attributes never reach Cedar. Your suggested fix is the right shape.Would you like to pick it up? If so, say so here and I'll assign it to you. A few notes to save you a review round:
multiValuedClaimsto the vMCPAuthzConfigand carry it through both the MCPAuthzConfig ref path and the ConfigMap path in the converter, plusbuildCedarAuthzConfig.docs/operator/crd-api.mdwith the operator Taskfile tasks rather than editing them by hand. Both served CRD versions need it.cedar.ConfigOptionsfield isn't mapped through (withPrimaryUpstreamProvideras the one deliberate exclusion) would stop the next option from being dropped the same way.multi_valued_claimswill seeclaim_<name>change from a set to a joined string once it's honored.Please link the PR here with
Fixes #6737.Sanskarzz commentedon Nov 19, 2026
Hi @bharathvemula thanks for raising the PR!
Before starting work on an issue, please make sure it’s assigned to you first. Please leave a comment on the issue, and I can assign it to you.
Please read CONTRIBUTING.md .