Agent MCP Gateway
A

Agent MCP Gateway

Agent MCP Gateway is a Model Context Protocol (MCP) gateway used to aggregate multiple downstream MCP servers and provide policy-based access control. Through its on-demand tool discovery mechanism, it solves the problem of context window waste caused by loading all tool definitions at startup in development environments such as Claude Code, reducing context occupation by over 90%.
2.5 points
3.7K

What is Agent MCP Gateway?

Agent MCP Gateway is an intelligent tool management gateway located between AI assistants (such as Claude, Cursor, etc.) and various tool servers. In the traditional way, all tool definitions are loaded into the AI assistant's memory window at once, occupying a large amount of space. This gateway allows AI assistants to discover and use tools on-demand, greatly saving valuable context resources.

How to use Agent MCP Gateway?

It's very simple to use: 1) Install the gateway and configure the tool server list; 2) Set access permission rules for different AI assistants; 3) Add the gateway to your AI assistant configuration. After that, your AI assistant can access various tools on-demand through the gateway.

Applicable scenarios

Suitable for development teams, researchers, and individual users who use multiple AI assistants and various tools. Especially when your AI assistant needs to access multiple tools such as databases, search engines, and API services, this gateway can significantly improve efficiency.

Main features

On-demand tool discovery
AI assistants only load tool definitions when needed instead of loading all tools at startup, saving over 90% of the context space.
Fine-grained permission control
Different tool access permissions can be set for each AI assistant to ensure security and the principle of least privilege.
Unified tool management
Manage all tool servers through one gateway, simplifying configuration and maintenance work.
Real-time configuration update
After modifying the configuration, there is no need to restart the gateway, and the changes take effect immediately.
Detailed audit logs
Record all tool usage for easy monitoring and problem troubleshooting.
Automatic OAuth support
Automatically handle tool servers that require OAuth authentication, simplifying the login process.
Advantages
Significantly save the context window space of AI assistants (over 90%)
Provide fine-grained permission control to ensure tool usage security
Unify the management of multiple tool servers for simpler configuration
Support on-demand loading to improve the response speed of AI assistants
Detailed audit logs facilitate monitoring and optimization
Support hot-reloading configuration without restarting the service
Limitations
Requires additional configuration of the gateway and permission rules
Some OAuth processes need to be handled manually
Initial setup requires an understanding of the tool server concept
When debugging, you need to view the gateway logs instead of directly viewing the tool server

How to use

Install the gateway
Install Agent MCP Gateway using a package management tool and initialize the configuration file.
Configure tool servers
Edit the generated configuration file and add the tool servers you need to use, such as search engines, databases, etc.
Set permission rules
Configure the access permissions of different AI assistants to determine which tools each assistant can use.
Add to AI assistant
Add the gateway configuration to your AI assistant (such as Claude Code).
Configure AI assistant identity
Tell your AI assistant to use the correct identity identifier when calling gateway tools.

Usage examples

Researchers use search engines
The AI researcher assistant needs to search for the latest technical information and accesses the Brave search engine tool through the gateway.
Developers query databases
The backend development assistant needs to query user data and accesses the PostgreSQL database tool through the gateway.
Multi-assistant collaboration project
In a project, different AI assistants are responsible for different tasks and obtain different tool access permissions through the gateway.

Frequently Asked Questions

Why do we need Agent MCP Gateway?
How to set different permissions for different AI assistants?
Will the gateway affect the tool usage speed?
What types of tool servers are supported?
How to view tool usage records?
Do I need to restart after modifying the configuration?

Related resources

Official GitHub repository
Source code, issue feedback, and contribution guidelines
MCP Protocol official website
Official documentation and specifications of the Model Context Protocol
FastMCP framework
A Python framework for building MCP servers
OAuth configuration guide
How to configure tool servers with OAuth authentication
Security guide
Security configuration and best practices

Installation

Copy the following command to your Client for configuration
{
  "mcpServers": {
    "agent-mcp-gateway": {
      "command": "uvx",
      "args": ["agent-mcp-gateway"],
      "env": {
        "GATEWAY_MCP_CONFIG": "~/.config/agent-mcp-gateway/.mcp.json",
        "GATEWAY_RULES": "~/.config/agent-mcp-gateway/.mcp-gateway-rules.json",
        "GATEWAY_DEFAULT_AGENT": "developer"
      }
    }
  }
}

{
  "mcpServers": {
    "brave-search": {
      "description": "Web search via Brave Search API",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-brave-search"],
      "env": {
        "BRAVE_API_KEY": "${BRAVE_API_KEY}"
      }
    },
    "postgres": {
      "description": "PostgreSQL database access and query execution",
      "command": "uvx",
      "args": ["mcp-server-postgres"],
      "env": {
        "DATABASE_URL": "${DATABASE_URL}"
      }
    },
    "remote-server": {
      "description": "Custom remote API integration",
      "url": "https://example.com/mcp",
      "transport": "http",
      "headers": {
        "Authorization": "Bearer ${API_TOKEN}"
      }
    }
  }
}

{
  "mcpServers": {
    "agent-mcp-gateway": {
      "command": "uvx",
      "args": ["agent-mcp-gateway"],
      "env": {
        "BRAVE_API_KEY": "your-actual-key-here",
        "DATABASE_URL": "postgresql://...",
        "GATEWAY_DEFAULT_AGENT": "claude-desktop"
      }
    }
  }
}

{
  "mcpServers": {
    "github": {
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer ${GITHUB_PAT}"
      }
    }
  }
}

{
  "mcpServers": {
    "agent-mcp-gateway": {
      "command": "uvx",
      "args": ["agent-mcp-gateway"],
      "env": {
        "GATEWAY_MCP_CONFIG": "/path/to/custom-mcp.json",
        "GATEWAY_RULES": "/path/to/custom-rules.json"
      }
    }
  }
}
Note: Your key is sensitive information, do not share it with anyone.

Alternatives

A
Acemcp
Acemcp is an MCP server for codebase indexing and semantic search, supporting automatic incremental indexing, multi-encoding file processing, .gitignore integration, and a Web management interface, helping developers quickly search for and understand code context.
Python
8.1K
5 points
B
Blueprint MCP
Blueprint MCP is a chart generation tool based on the Arcade ecosystem. It uses technologies such as Nano Banana Pro to automatically generate visual charts such as architecture diagrams and flowcharts by analyzing codebases and system architectures, helping developers understand complex systems.
Python
7.4K
4 points
M
MCP Agent Mail
MCP Agent Mail is a mail - based coordination layer designed for AI programming agents, providing identity management, message sending and receiving, file reservation, and search functions, supporting asynchronous collaboration and conflict avoidance among multiple agents.
Python
9.4K
5 points
K
Klavis
Klavis AI is an open-source project that provides a simple and easy-to-use MCP (Model Context Protocol) service on Slack, Discord, and Web platforms. It includes various functions such as report generation, YouTube tools, and document conversion, supporting non-technical users and developers to use AI workflows.
TypeScript
13.4K
5 points
M
MCP
The Microsoft official MCP server provides search and access functions for the latest Microsoft technical documentation for AI assistants
11.7K
5 points
A
Aderyn
Aderyn is an open - source Solidity smart contract static analysis tool written in Rust, which helps developers and security researchers discover vulnerabilities in Solidity code. It supports Foundry and Hardhat projects, can generate reports in multiple formats, and provides a VSCode extension.
Rust
10.5K
5 points
D
Devtools Debugger MCP
The Node.js Debugger MCP server provides complete debugging capabilities based on the Chrome DevTools protocol, including breakpoint setting, stepping execution, variable inspection, and expression evaluation.
TypeScript
9.9K
4 points
S
Scrapling
Scrapling is an adaptive web scraping library that can automatically learn website changes and re - locate elements. It supports multiple scraping methods and AI integration, providing high - performance parsing and a developer - friendly experience.
Python
11.5K
5 points
M
Markdownify MCP
Markdownify is a multi-functional file conversion service that supports converting multiple formats such as PDFs, images, audio, and web page content into Markdown format.
TypeScript
28.0K
5 points
N
Notion Api MCP
Certified
A Python-based MCP Server that provides advanced to-do list management and content organization functions through the Notion API, enabling seamless integration between AI models and Notion.
Python
17.4K
4.5 points
G
Gitlab MCP Server
Certified
The GitLab MCP server is a project based on the Model Context Protocol that provides a comprehensive toolset for interacting with GitLab accounts, including code review, merge request management, CI/CD configuration, and other functions.
TypeScript
19.0K
4.3 points
D
Duckduckgo MCP Server
Certified
The DuckDuckGo Search MCP Server provides web search and content scraping services for LLMs such as Claude.
Python
53.8K
4.3 points
F
Figma Context MCP
Framelink Figma MCP Server is a server that provides access to Figma design data for AI programming tools (such as Cursor). By simplifying the Figma API response, it helps AI more accurately achieve one - click conversion from design to code.
TypeScript
50.1K
4.5 points
U
Unity
Certified
UnityMCP is a Unity editor plugin that implements the Model Context Protocol (MCP), providing seamless integration between Unity and AI assistants, including real - time state monitoring, remote command execution, and log functions.
C#
23.4K
5 points
G
Gmail MCP Server
A Gmail automatic authentication MCP server designed for Claude Desktop, supporting Gmail management through natural language interaction, including complete functions such as sending emails, label management, and batch operations.
TypeScript
18.1K
4.5 points
M
Minimax MCP Server
The MiniMax Model Context Protocol (MCP) is an official server that supports interaction with powerful text-to-speech, video/image generation APIs, and is suitable for various client tools such as Claude Desktop and Cursor.
Python
36.7K
4.8 points
AIBase
Zhiqi Future, Your AI Solution Think Tank
© 2025AIBase