cortex-gateway: Instructions file for Codex

AGENTS.md

cortex-gateway AGENTS.md is an instructions file for Codex, OpenCode from wellknownmcp/cortex-gateway. It costs 1,098 tokens per session, scanned A, original, MIT.

Project instructions for Cortex Gateway, a self-hosted server that places one protected MCP endpoint in front of multiple backend servers. OAuth 2.1 is a standard way to authenticate users and grant limited access.

In plain words
What is it for?
Use them when developing, testing, or evaluating the gateway and its authorization server.
Why use it?
They explain how user permissions, authentication, transports, and verification checks work in the gateway.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is wellknownmcp/cortex-gateway's own configuration. It tells Codex and OpenCode how to work on cortex-gateway itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cortex-gateway configures →

Reuse

Borrowing it

Nothing to install: this file belongs to wellknownmcp/cortex-gateway. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/wellknownmcp/cortex-gateway/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/wellknownmcp/cortex-gateway

Made for: Codex, OpenCode.

Wrote 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.

agentmods badge for cortex-gateway AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/wellknownmcp/cortex-gateway/agents-md/github.svg)](https://agentmods.dev/instructions/wellknownmcp/cortex-gateway/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/wellknownmcp/cortex-gateway/agents-md"><img src="https://agentmods.dev/badge/instructions/wellknownmcp/cortex-gateway/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cortex-gateway AGENTS.md

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,098 This file is loaded in full into every session.
When invoked 1,098 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.01098 $0.01098
Opus 5.5 $0.00439 $0.00439
Sonnet 5.5 $0.00220 $0.00220
Haiku 4.5 $0.00110 $0.00110

Measured 10d ago against content hash 8eb3026010d8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 10d 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 \
AGENTS.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 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 2026-07-28, 2025-11-25 and 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)
npm ci && npm run typecheck && npm test

# The demo authorization server builds independently
cd demo/auth-server && npm ci && npm run typecheck

# Official MCP conformance suite against the production build (known gaps:
# scripts/conformance/baseline.yml)
npm run build && node scripts/conformance/run.mjs

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

Read the full file on GitHub · 99 lines

Changes

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.

  1. 10d ago Changed · +4 lines · +37 tokens per session 8eb3026010d8
  2. 2mo ago First seen · 95 lines · 1,061 tokens per session scan A b3d6263c5e80

Subscribe to this mod's changes

cortex-gateway AGENTS.md is an instructions file published in the GitHub repository wellknownmcp/cortex-gateway (12 stars, last pushed 11d ago), licensed MIT. It adds 1,098 tokens to every session, about $0.0044 per session on Opus 5.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.

Related

cortex-gateway AGENTS.md compared with instructions from other repositories

cortex-gateway AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cortex-gateway AGENTS.mdwellknownmcp/cortex-gatewayInstructions file1211d agoMITA1,098Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode