Agent GatewayCAUTION
Provides per-subagent MCP access controls to Claude Code (or any MCP client) across all your MCPs and prevents context window bloat. Loads only 3 tools instead of all your MCP Server's tool definitions. Agents discover tools on-demand, only when needed. Control which servers and individual tools eac
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
A Model Context Protocol (MCP) gateway that aggregates multiple MCP servers and provides policy-based access control for agents and subagents. Solves Claude Code's MCP context window waste by enabling on-demand tool discovery instead of loading all tool definitions upfront.
Status
- ✅ M0: Foundation - Configuration, policy engine, audit logging,
list_serverstool - ✅ M1: Core - Proxy infrastructure,
get_server_tools,execute_tool, middleware, metrics, hot reload, OAuth support - 🚧 M2: Production - HTTP transport, health checks (planned)
- 🚧 M3: DX - Single-agent mode, config validation CLI, Docker (planned)
Current Version: M1-Core Complete (with OAuth)
Table of Contents
- Overview
- Installation
- Quick Start
- Command-Line Options
- Configuration File Discovery
- Configuration
- Usage
- Gateway Tools
- Security Considerations
- Troubleshooting
- Testing
- Development
- Architecture
- Future Features
- Documentation
- Contributing
- License
- Support
- Acknowledgments
Overview
The Problem
When multiple MCP servers are configured in development environments (Claude Code, Cursor, VS Code), all tool definitions from all servers load into every agent's and subagent's context window at startup:
- 5,000-50,000+ tokens consumed upfront
- 80-95% of loaded tools never used by individual agents
- Context ne
1f7e6b2cb957OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add agent-mcp-gateway -- None agent-mcp-gateway==0.2.5
Exposed tools (16)
10 read · 4 write · 2 destructive. Blast radius: 2 tools can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.
| Tool | Risk | Description |
|---|---|---|
brave_local_search | read | Search local businesses |
brave_web_search | read | Search the web using Brave |
complex_tool | read | A tool with many parameters |
create_user | write | Create a new user |
delete_user | destructive | Delete a user |
drop_table | destructive | Drop a database table |
get_user | read | Get user by ID |
get_users | read | List all users |
list_directory | read | List directory contents |
list_tables | read | List database tables |
query | write | Execute SQL query |
read_file | read | Read file contents |
simple | read | |
update_user | write | Update user details |
write_file | write | Write file contents |
x | read |
Trust audit
CAUTIONgrade C · trust 75/100 Install with care. The audit found things worth knowing before you trust its output.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | FAIL |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | WARN |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (1 observation(s))
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- found
Findings (20)
POSTGRES_URL=postgresql://postgres:password@localhost:5432/mydb
delete_user, drop_table
.mcp-gateway-rules.json.example
.mcp.json.example
.mcp.test.json
.mcp-gateway-rules.json.example
.mcp.json.example
mcp_url="http://127.0.0.1:8000/mcp",
url="http://127.0.0.1:8000/mcp",
and not origin.startswith("http://127.0.0.1"):base_url = "http://127.0.0.1:8000"
4. **admin** - Full access to all servers and tools
5. Gateway checks rules: developer agent has full access (configured as `"*"`)
### Example 1: Admin with Full Access
- An "admin" agent exists with full access
If you use `${VAR_NAME}` syntax in `.mcp.json`, note that macOS GUI applications run in isolated environments without access to your shell's environment variables. For Claude Desktop and similar apps,**Note on GUI Applications:** macOS GUI applications (Claude Desktop, etc.) run in isolated environments without access to shell environment variables. If using `${VAR_NAME}` syntax in `.mcp.json`, ad**Load environment variables:**
export $(cat .env | xargs)
If using `${VAR_NAME}` syntax in `.mcp.json`, macOS GUI applications don't access shell environment variables. Add API keys to the gateway's `env` object in your MCP client configuration instead. SeeGates applied: no_behavioural_pass.
1f7e6b2cb957full audit observations/trust-audit/mcp-server/roddutra__agent-gateway.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | 1f7e6b2cb957 | CAUTION | C | 75 | first audit |
Questions
What is the Agent Gateway MCP server?
Provides per-subagent MCP access controls to Claude Code (or any MCP client) across all your MCPs and prevents context window bloat. Loads only 3 tools instead of all your MCP Server's tool definitions. Agents discover tools on-demand, only when needed. Control which servers and individual tools eac
What tools does Agent Gateway expose?
16 in total: 10 read-only, 4 that write, and 2 that can delete or overwrite (delete_user, drop_table). Every one is listed on this page with its risk.
Is Agent Gateway safe to connect to an agent?
With care. The audit graded it C (75/100) and found 20 things worth knowing before you trust this server, listed below with the exact line each was found on. Separately from the audit: 2 of its tools can destroy data, so scope the token you give it to what you actually need.
What credentials does Agent Gateway need?
No credential environment variables were found in its source, so it appears to need none.
How does Agent Gateway run?
It speaks stdio and streamable-http, so it runs as a local process your client starts. It is published on PyPI as agent-mcp-gateway.
How current is this page?
The grade is for one exact copy of the source (1f7e6b2cb957), read on 2026-10-08. The repository is watched and re-audited when it changes.