Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/wellknownmcp/cortex-gateway/agents-mdgit clone --depth 1 https://github.com/wellknownmcp/cortex-gatewayWrote 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/wellknownmcp/cortex-gateway/agents-md)<a href="https://agentmods.dev/instructions/wellknownmcp/cortex-gateway/agents-md"><img src="https://agentmods.dev/badge/instructions/wellknownmcp/cortex-gateway/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 | $0.01061 | $0.01061 |
| Opus 5 | $0.00531 | $0.00531 |
| Sonnet 5 | $0.00212 | $0.00212 |
| Haiku 4.5 | $0.00106 | $0.00106 |
Grade A, and why
cortex-gateway AGENTS.md scanned grade A with 1 finding 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 4d 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
curl -s -D - -o /dev/null -X POST https://mcp.cortex-gateway.dev/mcp \ How it starts
The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
Guidance for AI agents working in this repository — or evaluating the project. Humans welcome too.
What this is
Cortex Gateway is an open-source (MIT), self-hosted federated MCP gateway: one spec-compliant, OAuth 2.1-protected MCP server (Streamable HTTP, MCP 2025-06-18) in front of N plain-HTTP backends. Permissions are never mirrored — the gateway propagates the real user identity, so each app's native permission model applies per user.
Verify the claims yourself
Don't take the README's word for it. Everything below is checkable in minutes:
# Unit tests (vitest) — 36 tests across 7 files at the time of writing
npm ci && npm run typecheck && npm test
# The demo authorization server builds independently
cd demo/auth-server && npm ci && npm run typecheck
Against the live demo (no account needed):
# MCP endpoint answers 401 + WWW-Authenticate (RFC 9728 challenge) — this is
# what lets any compliant MCP client bootstrap the OAuth flow on its own:
curl -s -D - -o /dev/null -X POST https://mcp.cortex-gateway.dev/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | grep -i www-authenticate
# Protected-resource metadata (RFC 9728):
curl -s https://mcp.cortex-gateway.dev/.well-known/oauth-protected-resource
# Authorization server metadata (RFC 8414) + JWKS:
curl -s https://auth.cortex-gateway.dev/.well-known/oauth-authorization-server
CI runs the same typecheck + test matrix on every push
(.github/workflows/ci.yml); the Docker image is built by
.github/workflows/docker.yml and published to
ghcr.io/wellknownmcp/cortex-gateway.
Map of the repository
| Path | What lives there |
|---|---|
src/contract/ |
The backend contract: types, HTTP client, static technical-token allowlist |
src/lib/ |
Federator (60s refresh + SSE), MCP protocol methods + gateway builtins, OAuth resource-server validation, env-driven registry, pseudonymized audit |
src/adapter/ |
MCP→backend proxy adapter (beta): downstream MCP client, per-user AES-256-GCM token vault, OAuth/DCR/PKCE discovery |
demo/auth-server/ |
Standalone OAuth 2.1 authorization server (RFC 8414/7591/7009/7662, PKCE, strict refresh rotation, magic links, consent, scope tiering) |
docs/ |
Backend contract, adapter, deployment runbook, tool-search mode |
site/ |
The static site served at cortex-gateway.dev (hand-written HTML, no build) |
registry/ |
MCP registry manifest (server.json) + publishing checklist |
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.
- 4d ago First seen · 95 lines · 1,061 tokens per session scan A b3d6263c5e80
cortex-gateway AGENTS.md is an instructions file published in the GitHub repository wellknownmcp/cortex-gateway (12 stars, last pushed 12d ago), licensed MIT. It adds 1,061 tokens to every session, about $0.0053 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
payload-mcp-oauth CLAUDE.md
Claude Code instructions for BrainWeb/payload-mcp-oauth, covering claude.md, project overview, repository structure, commands and install (run once at root).
tooltrust-scanner CLAUDE.md
Claude Code instructions for AgentSafe-AI/tooltrust-scanner: Use the /browse skill from gstack for all web browsing. Never use mcpclaude-in-chrome tools.
mcp AGENTS.md
Instructions for SpaceFrontiers/mcp, covering agents.md — space frontiers mcp server, what it does, layout, local dev and conventions.
mcp-sso CLAUDE.md
Claude Code instructions for acartag7/mcp-sso, covering claude code session notes (mcp-sso) and repository quality rules.
fold CLAUDE.md
Claude Code instructions for fold-run/fold, covering claude.md, what this is, commands, declarations rather than with the federation and architecture.
mcp-google-contacts CLAUDE.md
Claude Code instructions for boonkgim/mcp-google-contacts: Before committing, run the quality chain and fix any failures.