Skip to content

vMCP: optionally refuse JWT access tokens whose typ is not at+jwt (RFC 9068) #7345

Backlog

Description

@ChrisJBurns

Problem

The vMCP's incoming OIDC authentication accepts a JWT access token whose JOSE typ header is JWT, or has no typ, as long as its issuer, audience, signature and expiry are valid. It refuses only an ID-JAG's typ (oauth-id-jag+jwt).

RFC 9068 section 4 says a resource server MUST reject a JWT access token unless its typ is at+jwt or application/at+jwt. Requiring that type stops the vMCP from accepting another JWT that the same issuer signed for the same audience, but that isn't an access token.

The embedded authorization server issues typ: JWT by default. An embedder can choose at+jwt with runner.WithAccessTokenType("at+jwt") (#6941). So the vMCP can't require at+jwt for every issuer without breaking deployments that keep the default, and many external IdPs also issue typ: JWT.

Expected

The vMCP can be told to require at+jwt (or application/at+jwt) from an issuer, for example as a Go option an embedder sets alongside WithAccessTokenType("at+jwt"). With it on, the vMCP answers 401 with WWW-Authenticate: Bearer error="invalid_token" when a token's typ is anything else, including when it is missing. With it off, nothing changes.

Done when

  • With the requirement on, a token with typ JWT or no typ gets 401 invalid_token at the vMCP, and a token with typ at+jwt is accepted.
  • With it off, behaviour is unchanged.

Context

Mecatl's embedded gateway (stacklok/mecatl#2533) sets at+jwt on the access tokens of the authorization server in front of its vMCP, and would turn this requirement on. Its tests pin the vMCP accepting typ JWT and a missing typ as a tracked shortcut.

Activity

  1. added
    needs-triage
    on Nov 26, 2026
  2. changed the title [-]vMCP: refuse JWT access tokens whose typ is not at+jwt (RFC 9068)[/-] [+]vMCP: optionally refuse JWT access tokens whose typ is not at+jwt (RFC 9068)[/+] on Nov 26, 2026
  3. ChrisJBurns commented on Nov 28, 2026

    @ChrisJBurns
    CollaboratorAuthor

    Mecatl's embedded AS-2 now issues at+jwt gateway tokens in production (stacklok/mecatl#3015, #3018), and its tests pin the vMCP accepting typ JWT or no typ as a tracked shortcut. This is low priority for Mecatl, but it's unassigned. Is anyone able to take it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions