Overview
Add conformance tests for MCP clients that authenticate using Workload
Identity Federation as described in SEP-1933
(modelcontextprotocol/modelcontextprotocol#1933).
This mechanism allows autonomous workloads (e.g. running on Kubernetes,
SPIFFE/SPIRE, or cloud runtimes) to exchange a platform-issued JWT for an
MCP access token, using the JWT Bearer grant defined in RFC 7523
(https://www.rfc-editor.org/rfc/rfc7523).
No client registration is required. Trust is established at the issuer
level — the authorization server maintains a trusted issuer allowlist and
resolves signing keys dynamically via OIDC Discovery. Key resolution is
an authorization server responsibility and is out of scope for client
conformance testing.
Specification References
Scope
This issue covers client conformance only. From the client's
perspective, it receives a pre-issued JWT assertion (via scenario context)
and must present it correctly to the token endpoint. The test authorization
server accepts the assertion at face value and issues an access token —
testing the authorization server's ability to perform OIDC Discovery, key
validation, and enforcing specific policies is explicitly out of scope
and belongs in authorization server conformance tests.
From the MCP server (resource server) perspective, the grant type used to
obtain an access token does not affect how the resource server processes
requests — no changes to createServer are required.
Changes Required
1. createAuthServer updates
- Accept
urn:ietf:params:oauth:grant-type:jwt-bearer at the token
endpoint
- Advertise the grant type in
grant_types_supported on the
/.well-known/oauth-authorization-server metadata endpoint
- Support configurable rejection rules (e.g.
rejectedSubjects,
rejectedJtis, rejectedScopes, rejectGrantType) so the scenario
can exercise specific error responses without implementing real policy
logic
- Record conformance checks on how the client formats its token request
2. JWT assertion helper (new)
Add helpers/createWorkloadJwt.ts — a parameterised helper that
generates a pre-signed JWT assertion for passing to the client under test
via scenario context. Accepts parameters including subject, audience,
exp, and jti so that each check can produce the specific JWT shape
it needs without requiring a separate signing mechanism.
3. New scenario: wif-jwt-bearer.ts
A single scenario consolidating all WIF client checks, following the
"fewer scenarios, more checks" principle from AGENTS.md. The scenario
starts the test authorization server and test MCP server once, then
exercises the full range of client behaviours across multiple checks
within the same scenario run.
The positive check exercises both the test authorization server (token
request format, grant type) and the test MCP server (bearer token
presented correctly). All negative checks terminate at the token endpoint
and do not reach the test MCP server.
4. Scenario registration
Register in src/scenarios/client/auth/index.ts. Tier placement
(required vs. extension) should follow SEP-1933's final status in the
spec process.
Checks to Cover
Positive (happy path)
Negative — all errors are non-recoverable without operator intervention;
client must fail clearly, fail fast, and not silently degrade
Acceptance Criteria
Out of Scope
- OIDC Discovery, signing key resolution, and enforcing specific policies
(authorization server conformance concerns)
- Client registration / DCR (not required for WIF)
- Refresh token behaviour vs. always presenting fresh workload JWTs
(open question in SEP-1933, deferred to follow-on)
- Multi-tenant isolation tests (deferred to follow-on issue)
Overview
Add conformance tests for MCP clients that authenticate using Workload
Identity Federation as described in SEP-1933
(modelcontextprotocol/modelcontextprotocol#1933).
This mechanism allows autonomous workloads (e.g. running on Kubernetes,
SPIFFE/SPIRE, or cloud runtimes) to exchange a platform-issued JWT for an
MCP access token, using the JWT Bearer grant defined in RFC 7523
(https://www.rfc-editor.org/rfc/rfc7523).
No client registration is required. Trust is established at the issuer
level — the authorization server maintains a trusted issuer allowlist and
resolves signing keys dynamically via OIDC Discovery. Key resolution is
an authorization server responsibility and is out of scope for client
conformance testing.
Specification References
SEP-1933: Workload Identity Federation modelcontextprotocol#1933
https://www.rfc-editor.org/rfc/rfc7523
Authorization Grants:
https://www.rfc-editor.org/rfc/rfc7521
codes):
https://www.rfc-editor.org/rfc/rfc6749#section-5.2
Scope
This issue covers client conformance only. From the client's
perspective, it receives a pre-issued JWT assertion (via scenario context)
and must present it correctly to the token endpoint. The test authorization
server accepts the assertion at face value and issues an access token —
testing the authorization server's ability to perform OIDC Discovery, key
validation, and enforcing specific policies is explicitly out of scope
and belongs in authorization server conformance tests.
From the MCP server (resource server) perspective, the grant type used to
obtain an access token does not affect how the resource server processes
requests — no changes to
createServerare required.Changes Required
1.
createAuthServerupdatesurn:ietf:params:oauth:grant-type:jwt-bearerat the tokenendpoint
grant_types_supportedon the/.well-known/oauth-authorization-servermetadata endpointrejectedSubjects,rejectedJtis,rejectedScopes,rejectGrantType) so the scenariocan exercise specific error responses without implementing real policy
logic
2. JWT assertion helper (new)
Add
helpers/createWorkloadJwt.ts— a parameterised helper thatgenerates a pre-signed JWT assertion for passing to the client under test
via scenario context. Accepts parameters including
subject,audience,exp, andjtiso that each check can produce the specific JWT shapeit needs without requiring a separate signing mechanism.
3. New scenario:
wif-jwt-bearer.tsA single scenario consolidating all WIF client checks, following the
"fewer scenarios, more checks" principle from AGENTS.md. The scenario
starts the test authorization server and test MCP server once, then
exercises the full range of client behaviours across multiple checks
within the same scenario run.
The positive check exercises both the test authorization server (token
request format, grant type) and the test MCP server (bearer token
presented correctly). All negative checks terminate at the token endpoint
and do not reach the test MCP server.
4. Scenario registration
Register in
src/scenarios/client/auth/index.ts. Tier placement(required vs. extension) should follow SEP-1933's final status in the
spec process.
Checks to Cover
Positive (happy path)
grant_type=urn:ietf:params:oauth:grant-type:jwt-bearerandassertion=<jwt>server
Negative — all errors are non-recoverable without operator intervention;
client must fail clearly, fail fast, and not silently degrade
invalid_grant— expiredexp: client does not retryinvalid_grant— wrongaud: client does not retryinvalid_grant— unauthorisedsub: client does not retryinvalid_grant— replayedjti: client does not retryinvalid_scope— valid JWT but scope not accepted: client does notretry, surfaces scope-specific error distinct from JWT failure
invalid_request— client does not retry, does not hang, surfacesactionable error signalling misconfiguration
unauthorized_client— client does not retry, does not silentlyfall back to another grant type, surfaces error for operator
intervention
Acceptance Criteria
createAuthServeraccepts and records checks for the jwt-bearergrant type
urn:ietf:params:oauth:grant-type:jwt-bearercreateWorkloadJwthelper accepts parameters forsubject,audience,exp, andjti— no separate signing mechanismneeded per check
via
context— client never generates its own assertionboth the test authorization server and test MCP server
as non-recoverable and does not retry, hang, silently fail, or
fall back to a less secure method
auth/index.tsbefore PR submission
Out of Scope
(authorization server conformance concerns)
(open question in SEP-1933, deferred to follow-on)