REST API MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@REST API MCP Serverget all users from the API"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
REST API MCP Server
A dynamic Model Context Protocol (MCP) server that automatically discovers and generates tools from any REST API using OpenAPI/Swagger specifications. Point it at any OpenAPI spec and it instantly exposes every endpoint as an MCP tool — zero manual configuration.
Documentation
For full documentation, guides, and examples, visit:
https://nife.io/mcp_opensource
Installation
pip install nife-restapi-mcp-serverConfiguration
There are four ways to configure the server. They are applied in priority order — higher entries win:
Priority | Method | Best for |
1 | CLI arguments | One-off runs, testing |
2 | Environment variables | Docker, CI/CD, shell scripts |
3 |
| Local development |
4 | Defaults | Nothing required by default |
Method 1 — CLI Arguments
restapi-mcp-server --base-url https://api.example.com --spec-url https://api.example.com/openapi.json --token mytokenAll available flags:
--base-url URL REST API base URL (required if not set via env)
--spec-url URL OpenAPI/Swagger spec URL or local file path (required if not set via env)
--token TOKEN API access token for bearer authentication
--auth-type TYPE Authentication type: bearer, apikey, basic, none (default: bearer)
--mode stdio|http Server mode (default: stdio)
--port PORT HTTP port, only used in http mode (default: 8080)
--host HOST HTTP host, only used in http mode (default: 0.0.0.0)
--log-level LEVEL Logging level: DEBUG, INFO, WARNING, ERROR (default: INFO)
--env-file PATH Path to a custom .env file
--version Show version and exitMethod 2 — Environment Variables
export REST_API_BASE_URL=https://api.example.com
export OPENAPI_SPEC_URL=https://api.example.com/openapi.json
export API_ACCESS_TOKEN=your_token_here
export MCP_MODE=stdio
restapi-mcp-serverMethod 3 — .env File
Create a .env file in your working directory:
REST_API_BASE_URL=https://api.example.com
OPENAPI_SPEC_URL=https://api.example.com/openapi.json
API_ACCESS_TOKEN=your_token_here
AUTH_TYPE=bearer
MCP_MODE=stdio
LOG_LEVEL=INFOThen just run:
restapi-mcp-serverMethod 4 — Claude Desktop Config (most common for MCP use)
No .env file needed. Pass everything via the env block in claude_desktop_config.json:
{
"mcpServers": {
"restapi": {
"command": "restapi-mcp-server",
"env": {
"REST_API_BASE_URL": "https://api.example.com",
"OPENAPI_SPEC_URL": "https://api.example.com/openapi.json",
"API_ACCESS_TOKEN": "your_token_here",
"MCP_MODE": "stdio",
"ENABLE_HTTP_ENDPOINT": "false"
}
}
}
}Claude Desktop injects the env block values directly into the process — this is the standard MCP pattern.
Environment Variable Reference
Variable | Required | Default | Description |
| Yes | — | REST API base URL |
| Yes | — | OpenAPI/Swagger spec URL or local file path |
| No |
| Auth method: |
| No | — | Bearer token for auth |
| No |
| Header name for API key auth |
| No | — | API key value |
| No | — | Username for basic auth |
| No | — | Password for basic auth |
| No |
|
|
| No |
| Enable HTTP health/metrics endpoints |
| No |
| HTTP server port |
| No |
| HTTP server host |
| No |
| Logging verbosity |
| No |
| Request timeout in seconds |
| No |
| Schema cache TTL in seconds |
Operating Modes
MCP Mode (stdio) — for Claude Desktop, Cursor, MCP clients
restapi-mcp-server --base-url https://api.example.com --spec-url https://api.example.com/openapi.json --mode stdioCommunicates via stdin/stdout. No HTTP server is started. This is the default.
HTTP Mode — for Docker, Kubernetes, server deployments
restapi-mcp-server --base-url https://api.example.com --spec-url https://api.example.com/openapi.json --mode http --port 8080Starts an HTTP server with health and metrics endpoints:
GET /— server infoGET /health— health checkGET /metrics— server metricsGET /schema— OpenAPI schema summaryGET /tools— all generated toolsGET /api/endpoints— all API endpoints
Authentication Methods
Bearer Token
AUTH_TYPE=bearer
API_ACCESS_TOKEN=your_tokenAPI Key
AUTH_TYPE=apikey
API_KEY_HEADER=X-API-Key
API_KEY_VALUE=your_keyBasic Authentication
AUTH_TYPE=basic
BASIC_AUTH_USERNAME=username
BASIC_AUTH_PASSWORD=passwordNo Authentication
AUTH_TYPE=noneDocker
docker build -t restapi-mcp-server .
docker run -p 8080:8080 \
-e REST_API_BASE_URL=https://api.example.com \
-e OPENAPI_SPEC_URL=https://api.example.com/openapi.json \
-e API_ACCESS_TOKEN=your_token \
-e MCP_MODE=http \
restapi-mcp-serverOr with Docker Compose:
cp .env.example .env # fill in your values
docker-compose upAvailable Tools
The server dynamically generates the following tool types:
Endpoint Tools
Named by HTTP method and path: <method>_<path_parts>
Examples:
get_userspost_usersget_users_by_iddelete_users_by_idput_users_by_id
Utility Tools
list_available_endpoints— list all endpoints (filterable by method or path)get_endpoint_info— detailed info about a specific endpointget_schema_info— OpenAPI schema summary or specific model detailsexecute_custom_request— run any HTTP request with full controlhealth_check— server health and schema status
OpenAPI Specification Support
OpenAPI 3.x (full support)
Swagger 2.0 (backward compatible)
Supported spec sources:
Remote JSON URL
Remote YAML URL
Local JSON file
Local YAML file
Key Features
Zero config endpoints — auto-parses any OpenAPI/Swagger spec and generates MCP tools
Dual mode — stdio for MCP clients, HTTP for server deployments
Flexible config — CLI args, env vars, .env file, or Claude Desktop env block
Multiple auth methods — Bearer, API key, Basic, or none
Production ready — Docker, Kubernetes, AWS ECS, Google Cloud Run compatible
Self-documenting —
list_available_endpoints,get_endpoint_info,get_schema_infotools built inDocumentation — https://nife.io/mcp_opensource
Troubleshooting
[ERROR] REST API base URL not configured
Set REST_API_BASE_URL via any method above. The most common fix:
restapi-mcp-server --base-url https://your-api.com[ERROR] OpenAPI spec URL not configured
Set OPENAPI_SPEC_URL via any method above:
restapi-mcp-server --spec-url https://your-api.com/openapi.jsonPort already in use
Change the port:
restapi-mcp-server --mode http --port 9090Docker container exits immediately
Make sure you're using HTTP mode:
docker run -e MCP_MODE=http -e REST_API_BASE_URL=... -e OPENAPI_SPEC_URL=... restapi-mcp-serverSchema not loading
Verify the spec URL is reachable
Check the format is valid JSON or YAML
Ensure the spec is OpenAPI 3.x or Swagger 2.0
License
MIT
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nifetency/nife-mcp-restapi'
If you have feedback or need assistance with the MCP directory API, please join our Discord server