Borrowing it
Nothing to install: this file belongs to roddutra/agent-mcp-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.
curl -O https://raw.githubusercontent.com/roddutra/agent-mcp-gateway/main/CLAUDE.mdgit clone --depth 1 https://github.com/roddutra/agent-mcp-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/roddutra/agent-mcp-gateway/claude-md)<a href="https://agentmods.dev/instructions/roddutra/agent-mcp-gateway/claude-md"><img src="https://agentmods.dev/badge/instructions/roddutra/agent-mcp-gateway/claude-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.03144 | $0.03144 |
| Opus 5 | $0.01572 | $0.01572 |
| Sonnet 5 | $0.00629 | $0.00629 |
| Haiku 4.5 | $0.00314 | $0.00314 |
Grade B, and why
agent-mcp-gateway CLAUDE.md scanned grade B 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 7d 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.
Reads MCP configurationmediumAgent snooping
mcp.json carries server URLs and auth tokens; reading it lets a mod discover and abuse other integrations.
Gateway auto-detects OAuth-protected downstream servers (Notion, GitHub, etc.) via 401 responses. Zero configuration needed - just add server URL to `.mcp.json`. Browser auth happens once, then tokens are cached. How it starts
The opening of the file, as written. The whole thing — 334 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
Agent MCP Gateway is an MCP server that acts as a proxy/gateway to multiple downstream MCP servers. It enables per-agent/subagent access control, solving Claude Code's context window waste where all MCP tool definitions load upfront instead of being discovered on-demand.
Core Problem: When multiple MCP servers are configured, all tools from all servers (5,000-50,000+ tokens) load into every agent's context at startup. This wastes 80-95% of context on unused tools.
Solution: Gateway exposes only 3 minimal tools (~2k tokens) that allow agents to discover and request specific tools on-demand based on configurable access rules.
Tech Stack
- Python 3.12+ (required)
- FastMCP 2.0 (version 2.13.0.1+) - MCP server framework
- uv - Package and project manager
Development Commands
# Install dependencies
uv sync
# Run gateway
uv run python main.py
# Add dependency
uv add <package-name>
# Add dev dependency
uv add --dev <package-name>
# Update dependencies
uv lock --upgrade
See README.md for production MCP client configuration.
Release Management
CRITICAL: NEVER bump version in pyproject.toml without explicit user approval.
When version is updated:
- Update ALL version files together:
pyproject.toml,server.json(rootversionandpackages[0].version), andCHANGELOG.md - Run
uv lockto sync lockfile - DO NOT release without user approval
To release: See docs/release-process.md for complete workflow. Key: pushing the git tag (not just commits) triggers automated PyPI, MCP Registry, and GitHub release publishing via GitHub Actions.
Architecture
Gateway Model
Agent → Gateway (3 tools, ~2k tokens) → Policy Engine → Downstream MCP Servers (100s of tools)
↓
Audit Log
Traditional MCP: All tools loaded upfront → Agent discovers what's available Gateway MCP: Minimal interface loaded → Agent requests what it needs → Gateway provides filtered access
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.
- 7d ago First seen · 334 lines · 3,144 tokens per session scan B 2c8f8bb7c467
agent-mcp-gateway CLAUDE.md is an instructions file published in the GitHub repository roddutra/agent-mcp-gateway (41 stars, last pushed 9mo ago), licensed MIT. It adds 3,144 tokens to every session, about $0.0157 per session on Opus 5. A static security scan graded it B with 1 finding (reads mcp configuration). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
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.