Documentation Index
Fetch the complete documentation index at: https://docs.agentium.in/llms.txt
Use this file to discover all available pages before exploring further.
MCP Auth Conformance (2026-07-28 spec)
The Model Context Protocol 2026-07-28 spec tightens authorization in two specific ways:- RFC 9207 —
issparameter validation. Mitigates “OAuth mix-up” attacks where a malicious AS swaps tokens between two ASes the client is talking to. - OpenID Connect Dynamic Client Registration with
application_type. Lets the client tell the AS whether it’s a native app or a web app at registration time.
@agentium/core/mcp/auth-validation.ts. They’re framework-agnostic — use them in any MCP client implementation, not just Agentium’s.
RFC 9207 — validateAuthorizationResponse
When the AS redirects back to your callback URL with ?code=...&state=..., it should also include an iss parameter (the AS’s own URL identifier). If it doesn’t match the AS you actually sent the user to, abort.
Why
Mix-up attack flow (simplified):- Client supports two ASes:
bank.exampleandattacker.example. - User starts a sign-in with
bank.example. - Attacker convinces user to also click “sign in with attacker.example”.
- Attacker’s AS sends a callback that looks like it came from bank.
- Client exchanges the
codeagainstbank.example(wrong AS!). - Bank issues a token for attacker’s account back to the attacker.
iss blocks step 4 — the callback must declare which AS sent it, and the client checks the value matches the AS the user actually picked.
Helper
AuthValidationError
Thrown when:
issis missing from the callback query.issis present but doesn’t match the expectedissuer(string equality on URL.origin + URL.pathname).
When this matters most
Agentium clients that talk to multiple MCP authorization servers (e.g. a research agent that connects to GitHub MCP + Slack MCP + an internal MCP). For single-AS deployments the attack vector is weak but the check is cheap, so the default behavior in the spec is “always validate.”OIDC Dynamic Client Registration — validateApplicationType
OIDC Dynamic Client Registration lets a client app register itself with the AS at runtime. The spec requires the client to declare application_type:
"native"— the client runs on a device (desktop, mobile, embedded). Custom URI schemes (myapp://callback) are allowed."web"— the client runs at an HTTPS URL. Redirect URIs must be HTTPS, no custom schemes.
Helper
AuthValidationError on policy violations.
Wiring into your MCP client
The MCP TypeScript SDK exposes anOAuthClient interface that you implement. Sketch:
Other 2026-07-28 changes (FYI)
The spec includes more than justiss validation. Other notable changes:
- Mandatory PKCE for all clients (even confidential ones). Agentium’s MCP SDK enables PKCE by default.
- Resource Indicators (RFC 8707) — clients should pass the MCP server URL as a
resourceparameter so the AS knows which protected resource the token is for. The MCP SDK adds this automatically when you setresource: ...on the auth request. - JWT access tokens with audience checks — when accepting tokens at an MCP server, verify the
audclaim matches the server’s URL.
auth-validation.ts. The helpers here cover the two specific call sites where you (the client integrator) need to make a decision: callback validation and registration.
Best practices
- Pin known ASes by URL. Don’t accept arbitrary issuer URLs at runtime.
- Log every
AuthValidationError. A spike usually means an attack attempt or a misconfigured AS. - For desktop apps, use the loopback flow (
http://127.0.0.1:<random_port>/callback). It’s safer than custom schemes (which can be hijacked by other apps). - Use refresh tokens with short access-token TTLs (5–15 minutes). Limits the blast radius of any token compromise.
See also
- MCP Integration — Agentium’s MCP client and server packages
- RFC 9207 spec
- OpenID Connect Dynamic Client Registration spec