MCP API Gateway

v1.0.0โ€ขAPIsโ€ขstable

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

ai-toolsclaudedockerjavascriptmcp
Share:
40
Stars
0
Downloads
0
Weekly
0/5

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

API caching and rate limiting
Unified MCP endpoint
Multi-API aggregation
bandageok

Maintainer

LicenseMIT
Languagejavascript
Versionv1.0.0
UpdatedMay 16, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-api-gateway

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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 pyyaml
2

Generate 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-config
3

Edit 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: 3
4

Start the gateway server

Launch the gateway with your configuration file. It will listen on localhost:8080 by default.

python gateway.py -c config.yaml
5

Add 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/health

Troubleshooting 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.

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.

Quick Config Preview

{ "mcpServers": { "mcp-api-gateway": { "command": "npx", "args": ["-y", "mcp-api-gateway"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide โ†’

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides