Borrowing it
Nothing to install: this file belongs to velias/mcp-auth-adapter. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/velias/mcp-auth-adapter/main/AGENTS.mdgit clone --depth 1 https://github.com/velias/mcp-auth-adapterWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/velias/mcp-auth-adapter/agents-md)<a href="https://agentmods.dev/instructions/velias/mcp-auth-adapter/agents-md"><img src="https://agentmods.dev/badge/instructions/velias/mcp-auth-adapter/agents-md.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.05980 | $0.05980 |
| Opus 5 | $0.02990 | $0.02990 |
| Sonnet 5 | $0.01196 | $0.01196 |
| Haiku 4.5 | $0.00598 | $0.00598 |
Grade A, and why
mcp-auth-adapter AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 384 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
Project overview
mcp-auth-adapter is a thin, stateless OAuth/OIDC auth adapter for MCP clients. It sits in front of upstream IdP (Keycloak-style) so MCP servers can advertise this adapter as the authorization server instead of the raw IdP URL. It does not issue tokens — all real auth/token work stays on the upstream IdP.
Key responsibilities
- Discovery — Serves
/.well-known/openid-configurationand/.well-known/oauth-authorization-serveras a filtered, MCP-oriented view of upstream OIDC metadata (with optional injection of this app's DCR, authorization, and token proxy URLs). - Dynamic Client Registration (DCR) —
POST /registerreturns an upstreamclient_id(RFC 7591 style, public client). Supports per-MCP-client IdP client mapping viaMCP_PROXY_DCR_CLIENT_NAME_MAP(pattern-basedclient_namematching with optional per-clientallowed_redirect_urisenforced at/authorizeand/tokentime, not at DCR time — the adapter is stateless). Falls back toMCP_PROXY_DCR_CLIENT_IDfor unmatched names. Validatesredirect_urisformat (parseable URI, no fragments per RFC 6749 §3.1.2; any scheme including custom/private-use per RFC 8252 §7.1) and type-checksgrant_types/response_types(must be arrays of strings). Invalid input returns RFC 7591invalid_client_metadataerrors. Access logs includeidpClient,matchedMapping,clientName(truncated to 200 chars), andredirect_uriscount for audit. Auto-enables whenMCP_PROXY_DCR_CLIENT_IDorMCP_PROXY_DCR_CLIENT_NAME_MAPis set. - Authorization adapter —
GET /authorizevalidatesredirect_uriagainst configured patterns, wraps originalredirect_uri+stateinto a signed HMAC state blob, rewritesredirect_urito the adapter's callback, and redirects to upstream. Supports scope filtering, optional CIMD client_id substitution, and RFC 8707resourceparameter validation (format check always active; optional require + allowlist enforcement via config). Auto-enables when scope filtering, CIMD, orMCP_PROXY_AUTH_STATE_SECRETis configured. - Authorization callback (RFC 9207
issinterception) —GET /authorize/callbackreceives the upstream redirect, verifies the signed state blob (HMAC + expiry), validates upstreamissparameter using two-tier logic, then redirects to the original MCP clientredirect_uriwith the adapter'sissvalue. Prevents OAuth mix-up attacks per RFC 9207. - Token proxy —
POST /tokenproxies token requests to the upstream IdP. Forauthorization_codegrants, validatesredirect_uriagainst allowed patterns and rewrites it to the adapter's callback URL. Forrefresh_tokengrants, passes through without redirect_uri modification. Forclient_credentialsandurn:ietf:params:oauth:grant-type:jwt-bearergrants, passes all parameters through without redirect_uri logic (covers both the Client Credentials extension and the Enterprise-Managed Authorization extension). RFC 8707resourceparameter validation is applied to all grant types exceptrefresh_token. Forwards theAuthorizationheader to upstream for non-CIMD requests (supportsclient_secret_basicper RFC 6749 §2.3.1; skipped for CIMD because client_id is rewritten). Always forwardsDPoP/DPoP-Noncerequest headers and relaysDPoP-Nonceresponses. Always active when the authorize proxy is active. - PAR proxy (RFC 9126) —
POST /parapplies the same authorize-time transforms (scopes, CIMD, redirect_uri/state wrapping, resource) and proxies to the upstream PAR endpoint, returning the upstreamrequest_uri(IdP holds PAR state; adapter stays stateless). ForwardsAuthorization/DPoP/DPoP-Noncelike/token.GET /authorizewithrequest_uriforwards onlyclient_id+request_uri(CIMD rewrite only). Auto-enables when the authorize proxy is active and upstream advertisespushed_authorization_request_endpoint— discovery is rewritten to{MCP_BASE_URL}/par; never invented if upstream omits PAR. - CIMD adapter (EXPERIMENTAL) — Accepts CIMD-style
client_idURLs from MCP clients, validates metadata documents, maps them to upstream IdP client_ids, and proxies/authorize,/par, and/tokenwith client_id substitution. Auto-enables whenMCP_PROXY_CIMD_MAPorMCP_PROXY_CIMD_DEFAULT_CLIENT_IDis set.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 384 lines · 5,980 tokens per session scan A 1ac1a7172667
mcp-auth-adapter AGENTS.md is an instructions file published in the GitHub repository velias/mcp-auth-adapter (5 stars, last pushed 4d ago), licensed Apache-2.0. It adds 5,980 tokens to every session, about $0.0299 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.