mcp-proxy: Instructions file for Codex

AGENTS.md

mcp-proxy AGENTS.md is an instructions file for Codex, OpenCode from joshrotenberg/mcp-proxy. It costs 4,729 tokens per session, scanned A, original, Apache-2.0.

A configuration-driven reverse proxy written in Rust for MCP, the protocol used by AI tools to call external services. It combines several MCP backends behind one HTTP address and can add authentication, logging, filtering, tool renaming, and health administration.

In plain words
What is it for?
Configuring backend connections, applying middleware, renaming or filtering tools, checking backend health, reloading configuration, and running the proxy.
Why use it?
It gives clients one endpoint for multiple MCP services and centralizes shared access control, monitoring, and request handling.

Instructions file for CodexOpenCode

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

This is joshrotenberg/mcp-proxy's own configuration. It tells Codex and OpenCode how to work on mcp-proxy 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 mcp-proxy configures →

Reuse

Borrowing it

Nothing to install: this file belongs to joshrotenberg/mcp-proxy. 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/joshrotenberg/mcp-proxy/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/joshrotenberg/mcp-proxy

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 mcp-proxy AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/joshrotenberg/mcp-proxy/agents-md/github.svg)](https://agentmods.dev/instructions/joshrotenberg/mcp-proxy/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/joshrotenberg/mcp-proxy/agents-md"><img src="https://agentmods.dev/badge/instructions/joshrotenberg/mcp-proxy/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 mcp-proxy AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/joshrotenberg/mcp-proxy/agents-md"><img src="https://agentmods.dev/badge/instructions/joshrotenberg/mcp-proxy/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,729 This file is loaded in full into every session.
When invoked 4,729 The same file — it is already loaded in full.
Security scan A 0 findings. 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.04729 $0.04729
Opus 5.5 $0.01892 $0.01892
Sonnet 5.5 $0.00946 $0.00946
Haiku 4.5 $0.00473 $0.00473

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

Security

Grade A, and why

mcp-proxy 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 17d 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.

AGENTS.md · 382 lines

How it starts

The opening of the file, as written. The whole thing — 382 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

Overview

mcp-proxy is a config-driven MCP (Model Context Protocol) reverse proxy built in Rust. It aggregates multiple MCP backends behind a single HTTP endpoint with per-backend middleware, authentication, and observability. Built on tower-mcp and the tower middleware ecosystem.

Package name: mcp-proxy. Binary name: mcp-proxy. Library name: mcp_proxy.

Project structure

src/
  main.rs          # CLI entry point (clap), logging setup
  lib.rs           # Library root, re-exports Proxy and ProxyConfig
  proxy.rs         # Core: builds proxy, middleware stack, and axum router
  lifecycle.rs     # Shared runtime owner, scoped transport cancellation and cleanup leases
  server.rs        # Owned HTTP1/HTTP2 connection/stream tasks and bounded drain
  config.rs        # TOML/YAML config parsing, validation, all config types
  builder.rs       # Fluent programmatic configuration builder
  discovery.rs     # Search index and complete tool schema store
  mcp_json.rs      # Import Claude-style .mcp.json configurations
  ws_transport.rs  # Outbound WebSocket transport
  skills.rs        # Management prompts bundled from src/skills/
  admin.rs         # HTTP admin API (/admin/backends, /admin/health, etc.)
  admin_tools.rs   # MCP admin tools (proxy/ namespace, via ChannelTransport)
  reload.rs        # Owned file watcher and admitted plain backend connections
  reload_policy.rs # Frozen startup policy admission and safe last-attempt status
  test_util.rs     # MockService, ErrorMockService, call_service helper

  # Global middleware (wraps the entire proxy, applied in proxy.rs)
  access_log.rs    # Structured access logging (AccessLogService, target: mcp::access)
  audit.rs         # Audit completion metadata/error codes, excluding private bodies
  alias.rs         # Tool renaming (AliasService)
  filter.rs        # Capability filtering -- allow/deny lists, glob patterns (CapabilityFilterService)
  inject.rs        # Argument injection into tool calls (InjectArgsService)
  mirror.rs        # Traffic mirroring to canary backends (MirrorService)
  cache.rs         # Scoped response caching, shared budgets and generation ownership
  cache/           # Bounded SQLite blocking I/O and Redis indexed storage
  coalesce.rs      # Request deduplication (CoalesceService)
  validation.rs    # Argument size limits (ValidationService)
  metrics.rs       # Scoped/shared Prometheus ownership, bounded namespace attribution
  telemetry.rs     # Privacy-preserving MCP/HTTP spans and explicit OTLP provider factory
  rbac.rs          # Role-based access control (RbacService)
  token.rs         # Legacy identity-only helper; no credential forwarding
  management.rs    # Explicit HTTP/MCP management authority and credential-bound sessions
  invocation.rs    # Search wrapper resolution preserving caller/request context
  bearer_scope.rs  # Per-token tool scoping and claims
  introspection.rs # OAuth token introspection and JWT fallback
  param_override.rs # Tool parameter hiding, renaming, and defaults
  composite.rs     # Composite tool fan-out
  canary.rs        # Weighted canary routing
  failover.rs      # Ordered backend failover

  # Per-backend middleware (applied per-backend in proxy.rs and reload.rs)
  outcome.rs       # Shared response classification, cache admission, hedge adapter
  retry.rs         # tower-resilience retry layer, exponential backoff, budgets
  outlier.rs       # Outlier detection and ejection (OutlierDetectionLayer)

tests/
  integration.rs   # Middleware composition tests with in-process backends via ChannelTransport
  e2e.rs           # Full proxy pipeline tests with in-process backends
  http_e2e.rs      # Real HTTP transport and authentication tests
  configured_sessions.rs # Configured embedding/CLI full-session transport and policy matrix
  support/        # Reusable bounded session/application/backend/OAuth fixtures
  health_probes.rs # Configured proxy process probes and auth boundaries
  replica_sessions.rs # Two real CLIs through NGINX affinity, retirement/loss and reinitialize
  reload_runtime.rs # Watched-file CLI add/replace tests and watcher ownership
  coalesce_runtime.rs # Configured HTTP/MCP capacity, expiry and recovery
  outcome_runtime.rs # Configured cache recovery, breaker state, hedge winners and metrics
  retry_runtime.rs # Configured authenticated sessions and exact volume-budget attempt counts
  outlier_runtime.rs # Competing configured calls and raw backend removal/re-registration
  shutdown_runtime.rs # SIGTERM/SSE, short drain, construction/drop and stdio reap regressions
  cli_logging.rs   # Real CLI JSON/text/OTel request records and privacy regressions
  outbound_headers.rs # Actual HTTP requests and WebSocket handshake headers
  discovery_schemas.rs # Tool schema retrieval and reindex behavior
  chaos.rs         # Fault injection and resilience recovery regressions
  cache_backends.rs # Real Redis containers and temporary SQLite databases
  config_properties.rs # Property tests for config validation
  invariant_properties.rs # Config/authorization/transform properties and paused-clock schedules
  protocol_contracts.rs # Configured library/CLI legacy baseline and modern feature contracts
  examples.rs      # Load and validate every example TOML config

examples/
  *.toml           # Example proxy configs for different deployment patterns
  docker-compose/  # Docker compose example with HTTP backend

Read the full file on GitHub · 382 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. 17d ago Changed · +86 lines · +1,273 tokens per session 92ae585808a3
  2. 18d ago Changed · +65 lines · +899 tokens per session 5612d58999dc
  3. 19d ago Changed · +19 lines · +229 tokens per session 60f92457c760
  4. 1mo ago Changed · +38 lines · +523 tokens per session 226af6dd00f1
  5. 2mo ago First seen · 174 lines · 1,805 tokens per session scan A a186886c1c98

Subscribe to this mod's changes

mcp-proxy AGENTS.md is an instructions file published in the GitHub repository joshrotenberg/mcp-proxy (19 stars, last pushed today), licensed Apache-2.0. It adds 4,729 tokens to every session, about $0.0189 per session on Opus 5.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.

Related

mcp-proxy AGENTS.md compared with instructions from other repositories

mcp-proxy AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mcp-proxy AGENTS.mdjoshrotenberg/mcp-proxyInstructions file19todayApache-2.0A4,729Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file275k3d agoMITA4,313Codex, OpenCode