1.9K
Universal Model Context Protocol (MCP) server to connect any REST API (with Swagger/OpenAPI) to Claude Desktop.
No manual API calls, no Postman — just chat!
docker run --rm -i \
-e API_1_NAME=petstore \
-e API_1_SWAGGER_URL=https://petstore.swagger.io/v2/swagger.json \
-e API_1_BASE_URL=https://petstore.swagger.io/v2 \
rflpazini/mcp-api-gateway:latest
In your claude_desktop_config.json:
{
"mcpServers": {
"petstore": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "API_1_NAME=petstore",
"-e", "API_1_SWAGGER_URL=https://petstore.swagger.io/v2/swagger.json",
"-e", "API_1_BASE_URL=https://petstore.swagger.io/v2",
"rflpazini/mcp-api-gateway:latest"
]
}
}
}
API_1_*, API_2_*, ...)Retry-After supportcheck_api_health tool to verify API connectivitynpx mcp-api-gateway| Variable | Description | Required |
|---|---|---|
API_N_NAME | Unique API name | Yes |
API_N_SWAGGER_URL | Swagger/OpenAPI spec URL | Yes |
API_N_BASE_URL | API base URL (overrides spec) | No |
API_N_HEADER_* | Custom headers (e.g., API_1_HEADER_AUTHORIZATION) | No |
API_N_HEADERS | JSON object with multiple headers | No |
| Variable | Description | Default |
|---|---|---|
API_N_TOOL_MODE | individual or grouped (group by resource/tag) | individual |
API_N_SCHEMA_MODE | full or compact (strip enums, flatten optional params) | full |
API_N_PATH_PREFIX | Comma-separated path prefixes to include | All |
API_N_TAGS | Comma-separated OpenAPI tags to include | All |
API_N_EXCLUDE_PARAMS | Comma-separated param names to strip | None |
| Variable | Description | Default |
|---|---|---|
API_N_TIMEOUT | Request timeout in ms | 30000 |
API_N_MAX_RETRIES | Max retries for 429/5xx errors | 3 |
MAX_RESPONSE_SIZE | Max response bytes before truncation | 102400 |
Tested with a 925-endpoint enterprise API:
| Configuration | Tools | Payload | Reduction |
|---|---|---|---|
| No optimization | 1093 | 2,269 KB | — |
SCHEMA_MODE=compact | 1093 | 633 KB | 72% |
TOOL_MODE=grouped | 53 | 184 KB | 92% |
PATH_PREFIX + compact | 94 | 50 KB | 98% |
Tip: Use API_N_TOOL_MODE=grouped for any API with more than 50 endpoints.
Content type
Image
Digest
sha256:11e2844c6…
Size
54 MB
Last updated
6 months ago
docker pull rflpazini/mcp-api-gateway