roddutra avatar

Agent MCP Gateway

roddutra/agent-mcp-gateway

Solves a real problem if you're running multiple MCP servers in Claude Code or similar environments: instead of dumping every tool definition into context at startup (often 5k to 50k tokens), this gateway loads just three tools that let agents discover and request specific capabilities on demand. You configure downstream MCP servers in one file and access policies in another, then agents call list_servers to see what's available, get_server_tools to fetch definitions, and execute_tool to run them. Supports wildcard patterns for tool matching, per-agent access control with deny-before-allow rules, audit logging, and hot config reloads. Most useful when you have lots of MCP servers configured but each agent or subagent only needs a subset, cutting context usage by 90% or more.

GitHub stars
41
tools
4
transport
STDIO
env vars
4
last updated
Dec 2, 2025

Tools

4 tools

Public tool metadata for what this MCP can expose to an agent.

list_serversLists MCP servers available to the calling agent based on policy rules.

Lists MCP servers available to the calling agent based on policy rules.

No parameter schema in public metadata yet.

get_server_toolsRetrieves tool definitions from a specific MCP server, filtered by agent permissions.

Retrieves tool definitions from a specific MCP server, filtered by agent permissions.

No parameter schema in public metadata yet.

execute_toolExecutes a tool on a downstream MCP server with transparent result forwarding.

Executes a tool on a downstream MCP server with transparent result forwarding.

No parameter schema in public metadata yet.

get_gateway_statusReturns comprehensive gateway health and diagnostics information.

Returns comprehensive gateway health and diagnostics information.

No parameter schema in public metadata yet.

Sponsors

Configuration

GATEWAY_MCP_CONFIG

Path to MCP servers configuration file (default: .mcp.json)

GATEWAY_RULES

Path to gateway access control rules file (default: .mcp-gateway-rules.json)

GATEWAY_DEFAULT_AGENT

Default agent ID when not provided in tool calls

GATEWAY_DEBUG

Enable debug mode and expose diagnostic tools (default: false)

Readme

Agent MCP Gateway

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.

badge

Status

  • βœ… M0: Foundation - Configuration, policy engine, audit logging, list_servers tool
  • βœ… 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


View the full README on GitHub

Details

Repository
github.com/roddutra/agent-mcp-gateway
Category
AI & LLM Tools
Package
agent-mcp-gateway
Transport
STDIO
Registry
MCP registry, active

Related AI & LLM Tools MCP servers

View all
1auscahq avatarAuscaauscahq/auscaPay-per-call APIs and MCP services for agents, no accounts or keys, with verifiable receipts.38stars
2msjsc001 avatarOmniClip RAGmsjsc001/omniclip-ragRead-only local-first MCP server for private Markdown, PDF, and Tika-backed search on Windows.37stars
3skynetcmd avatarM3 Memoryskynetcmd/m3-memoryLocal-first, cloud-friendly memory β€” 100+ tools, 99.2% LongMemEval-S retrieval@8, hybrid search.30stars
4theagenttimes avatarAgent News by The Agent Timestheagenttimes/agent-newsVerified, sourced, real-time intelligence layer for AI agents.25stars
5alphaonedev avatarAi Memoryalphaonedev/ai-memory-mcpPersistent memory for any AI β€” zero token cost until recall24stars
6chaixueyuan avatarWeapp Agent Mcpchaixueyuan/weapp-agent-mcpAgent-first MCP server for WeChat Mini Program debugging & automation via WeChat DevTools.23stars