MCP API Gateway
A unified local API gateway providing caching, rate limiting, and full Model Context Protocol compatibility for AI agent integration. It enables users to aggregate multiple API endpoints into a single gateway with built-in observability and customiza
What is MCP API Gateway?
MCP API Gateway is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to unified local api gateway providing caching, rate limiting, and full model context protocol compatibility for ai agent integration. it enables users to aggregate multiple api endpoints into a single g...
A unified local API gateway providing caching, rate limiting, and full Model Context Protocol compatibility for AI agent integration. It enables users to aggregate multiple API endpoints into a single gateway with built-in observability and customiza
This server falls under the APIs category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A unified local API gateway providing caching, rate limiting
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-api-gatewayConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MCP API Gateway
MCP API Gateway is a locally hosted API proxy that aggregates multiple external REST API endpoints behind a single MCP-compatible interface with built-in caching, rate limiting, and request observability. It implements the Model Context Protocol's tools/list and tools/call endpoints so AI agents can invoke any configured API endpoint as an MCP tool, while the gateway handles retries, LRU/LFU caching, and metrics collection transparently. Developers who want to expose a curated set of external APIs to AI agents without repeatedly implementing authentication, caching, and error handling in each tool will find this gateway a practical foundation.
Prerequisites
- Python 3.9+ with pip
- aiohttp and pyyaml Python packages
- A config.yaml file defining the API endpoints to proxy
- An MCP-compatible client such as Claude Desktop or Claude Code
Clone the repository and install dependencies
Clone the mcp-api-gateway repository and install the required Python packages.
git clone https://github.com/bandageok/mcp-api-gateway.git
cd mcp-api-gateway
pip install aiohttp pyyamlGenerate a starter configuration file
Run the built-in config generator to create a config.yaml with example settings for host, caching, rate limiting, and an example API endpoint.
python gateway.py --create-configEdit config.yaml to add your API endpoints
Open the generated config.yaml and add entries under the apis key for each external API you want to proxy. Each entry needs a name, url, method, and optional headers and timeout.
# Example config.yaml snippet
host: localhost
port: 8080
cache:
enabled: true
max_size: 1000
ttl: 300
strategy: lru
rate_limit:
enabled: true
requests_per_minute: 60
apis:
- name: github-api
url: https://api.github.com
method: GET
headers:
Authorization: "Bearer your_token"
timeout: 10
retry_count: 3Start the gateway server
Launch the gateway with your configuration file. It will listen on localhost:8080 by default.
python gateway.py -c config.yamlAdd the gateway to your MCP client configuration
Register the running gateway as an MCP server in your claude_desktop_config.json using its local URL.
{
"mcpServers": {
"api-gateway": {
"url": "http://localhost:8080/mcp"
}
}
}MCP API Gateway Examples
Client configuration
Claude Desktop configuration pointing to the locally running MCP API Gateway.
{
"mcpServers": {
"api-gateway": {
"url": "http://localhost:8080/mcp"
}
}
}Prompts to try
After connecting, test the gateway with these prompts or direct curl commands.
- "Call the github-api tool to fetch the profile for user bandageok"
- "Check the gateway stats to see cache hit rate and total requests served"
- "List all available API tools registered in the gateway"
- Direct test: curl http://localhost:8080/api/github-api/users/bandageok
- Health check: curl http://localhost:8080/healthTroubleshooting MCP API Gateway
Gateway starts but MCP client cannot connect
Confirm the gateway is running on the expected host and port with curl http://localhost:8080/health. Check that the URL in your MCP client config ends with /mcp, not just the base URL.
API endpoint returns 502 or connection refused
Check the url field in your config.yaml for the failing API. Verify the external endpoint is reachable with a direct curl from the same machine. Also check that headers and authentication tokens are correctly configured.
Cache not reducing API calls as expected
Confirm cache.enabled is set to true in config.yaml and that ttl is set to a value greater than 0. GET requests are cached by default; POST requests are not. Check /stats to see the current cache hit rate.
Frequently Asked Questions about MCP API Gateway
What is MCP API Gateway?
MCP API Gateway is a Model Context Protocol (MCP) server that unified local api gateway providing caching, rate limiting, and full model context protocol compatibility for ai agent integration. it enables users to aggregate multiple api endpoints into a single gateway with built-in observability and customiza It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MCP API Gateway?
Follow the installation instructions on the MCP API Gateway GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with MCP API Gateway?
MCP API Gateway works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MCP API Gateway free to use?
Yes, MCP API Gateway is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
MCP API Gateway Alternatives โ Similar APIs Servers
Looking for alternatives to MCP API Gateway? Here are other popular apis servers you can use with Claude, Cursor, and VS Code.
Kong
โ 43.4k๐ฆ The API and AI Gateway
API Mega List
โ 5.4kThis GitHub repo is a powerhouse collection of APIs you can start using immediately to build everything from simple automations to full-scale applications. One of the most valuable API lists on GitHubโperiod. ๐ช
Fetch
โ 5.4kFetch web content and convert to markdown for AI consumption
Fusio
โ 2.1kSelf-Hosted API Management for Builders
Korean Law
โ 1.8k๊ตญ๊ฐ๋ฒ๋ น์ ๋ณดMCP v4.0 | ๋ฒ์ ์ฒ 41๊ฐ API โ 17๊ฐ MCP ๋๊ตฌ. ๋ฒ๋ นยทํ๋กยท์กฐ๋ก ๊ฒ์ + LLM ํ๊ฐ ๋ฐฉ์ง ์ธ์ฉ๊ฒ์ฆ + ์กฐ๋ฌธ ์ํฅ ๊ทธ๋ํ(impact_map) + ์์ ๋น๊ต ์๋ diff(time_travel) + ์๋ฏผ 5๋จ๊ณ ์คํ ๊ฐ์ด๋(action_plan) | 41 Korean legal APIs โ 17 MCP tools
RuleGo
โ 1.5kโ๏ธRuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.
Browse More APIs MCP Servers
Explore all apis servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up MCP API Gateway in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use MCP API Gateway?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.