mcp-proxy AGENTS.md

mcp-proxy AGENTS.md is an instructions file for Codex, OpenCode from joshrotenberg/mcp-proxy. It costs 1,805 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

Install

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.

agentmods
npx agentmods add instructions/joshrotenberg/mcp-proxy/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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,805 This file is loaded in full into every session.
When invoked 1,805 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.01805 $0.01805
Opus 5 $0.00903 $0.00903
Sonnet 5 $0.00361 $0.00361
Haiku 4.5 $0.00180 $0.00180

Measured 4d ago against content hash a186886c1c98, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

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 · 174 lines

How it starts

The opening of the file, as written. The whole thing — 174 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
  config.rs        # TOML config parsing, all config types
  admin.rs         # HTTP admin API (/admin/backends, /admin/health, etc.)
  admin_tools.rs   # MCP admin tools (proxy/ namespace, via ChannelTransport)
  reload.rs        # Hot reload: file watcher, dynamic backend addition
  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)
  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         # Response caching with TTL (CacheService)
  coalesce.rs      # Request deduplication (CoalesceService)
  validation.rs    # Argument size limits (ValidationService)
  metrics.rs       # Prometheus counters and histograms (MetricsService)
  rbac.rs          # Role-based access control (RbacService)
  token.rs         # Auth token passthrough to backends (TokenPassthroughService)

  # Per-backend middleware (applied per-backend in proxy.rs and reload.rs)
  retry.rs         # Retry with exponential backoff (McpRetryPolicy)
  outlier.rs       # Outlier detection and ejection (OutlierDetectionLayer)

tests/
  integration.rs   # Middleware composition tests with in-process backends via ChannelTransport
  e2e.rs           # Comprehensive E2E test suite (44 tests, 10 tiers)

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

Read the full file on GitHub · 174 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. 4d 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 (9 stars, last pushed 4d ago), licensed Apache-2.0. It adds 1,805 tokens to every session, about $0.0090 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.