part…
Building governance for MCP?
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
RFC 8707 lets the client tell the AS which resource it wants the token for. MCP makes it mandatory so that tokens are bound to a specific server and cannot be reused against another.
The resource parameter:
resource field of the PRM (RFC 9728).The client MUST send it even if the AS does not support it.
Clients SHOULD provide the most specific URI possible. Canonical form with lowercase scheme and host; implementations SHOULD accept uppercase for robustness.
| Valid | Invalid |
|---|---|
https://mcp.example.com/mcp |
mcp.example.com (no scheme) |
https://mcp.example.com |
https://mcp.example.com#fragment (fragment) |
https://mcp.example.com:8443 |
|
https://mcp.example.com/server/mcp (if the path identifies the server) |
With and without a trailing slash are distinct valid URIs; the form without a trailing slash SHOULD be used consistently unless the slash is semantically significant.
Example in the request: &resource=https%3A%2F%2Fmcp.example.com.
The MCP server MUST validate that the token was issued specifically for it (audience). It is the direct countermeasure to token passthrough and the confused deputy (lessons 9.8 and 10.2).
resource = its canonical URI; store the URI alongside the token and never send a token to another resource.aud on every token you receive./srv/a, /srv/b), each path can be a distinct resource with its own PRM (/.well-known/oauth-protected-resource/srv/a): decide whether you want per-server tokens or a single token for the gateway.1. Must the client send resource if the AS does not support it?
It MUST be sent in both requests regardless of AS support.
2. Which of these is a valid canonical URI?
It needs a scheme and does not allow a fragment; the port is valid.
3. Which attack does audience validation on the server mitigate?
A token for another resource must not be accepted.