{"id":51611972,"url":"https://github.com/nifetency/nife-mcp-restapi","last_synced_at":"2026-07-12T09:02:18.904Z","repository":{"id":365255777,"uuid":"1105824180","full_name":"nifetency/nife-mcp-restapi","owner":"nifetency","description":"Dynamic MCP server that auto-generates tools from OpenAPI/Swagger specs","archived":false,"fork":false,"pushed_at":"2026-04-14T12:21:02.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-16T15:34:23.658Z","etag":null,"topics":["mcp","mcpserver","nife","nife-io","openapi","rest-api"],"latest_commit_sha":null,"homepage":"https://nife.io/mcp_opensource","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nifetency.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-28T08:01:25.000Z","updated_at":"2026-04-15T05:47:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nifetency/nife-mcp-restapi","commit_stats":null,"previous_names":["nifetency/nife-mcp-restapi"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nifetency/nife-mcp-restapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nifetency%2Fnife-mcp-restapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nifetency%2Fnife-mcp-restapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nifetency%2Fnife-mcp-restapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nifetency%2Fnife-mcp-restapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nifetency","download_url":"https://codeload.github.com/nifetency/nife-mcp-restapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nifetency%2Fnife-mcp-restapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35387177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-12T02:00:06.386Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mcp","mcpserver","nife","nife-io","openapi","rest-api"],"created_at":"2026-07-12T09:02:18.034Z","updated_at":"2026-07-12T09:02:18.899Z","avatar_url":"https://github.com/nifetency.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# REST API MCP Server\n\n![Python](https://img.shields.io/badge/python-3.11+-blue)\n![License](https://img.shields.io/badge/license-MIT-green)\n![MCP](https://img.shields.io/badge/MCP-compatible-purple)\n\nA 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.\n\n---\n\n## Documentation\n\nFor full documentation, guides, and examples, visit:\n\nhttps://nife.io/mcp_opensource\n\n---\n\n\n## Installation\n\n```bash\npip install nife-restapi-mcp-server\n```\n\n---\n\n## Configuration\n\nThere are **four ways** to configure the server. They are applied in priority order — higher entries win:\n\n| Priority | Method | Best for |\n|----------|--------|----------|\n| 1 | CLI arguments | One-off runs, testing |\n| 2 | Environment variables | Docker, CI/CD, shell scripts |\n| 3 | `.env` file | Local development |\n| 4 | Defaults | Nothing required by default |\n\n### Method 1 — CLI Arguments\n\n```bash\nrestapi-mcp-server --base-url https://api.example.com --spec-url https://api.example.com/openapi.json --token mytoken\n```\n\nAll available flags:\n\n```\n--base-url URL       REST API base URL (required if not set via env)\n--spec-url URL       OpenAPI/Swagger spec URL or local file path (required if not set via env)\n--token TOKEN        API access token for bearer authentication\n--auth-type TYPE     Authentication type: bearer, apikey, basic, none (default: bearer)\n--mode stdio|http    Server mode (default: stdio)\n--port PORT          HTTP port, only used in http mode (default: 8080)\n--host HOST          HTTP host, only used in http mode (default: 0.0.0.0)\n--log-level LEVEL    Logging level: DEBUG, INFO, WARNING, ERROR (default: INFO)\n--env-file PATH      Path to a custom .env file\n--version            Show version and exit\n```\n\n### Method 2 — Environment Variables\n\n```bash\nexport REST_API_BASE_URL=https://api.example.com\nexport OPENAPI_SPEC_URL=https://api.example.com/openapi.json\nexport API_ACCESS_TOKEN=your_token_here\nexport MCP_MODE=stdio\n\nrestapi-mcp-server\n```\n\n### Method 3 — `.env` File\n\nCreate a `.env` file in your working directory:\n\n```env\nREST_API_BASE_URL=https://api.example.com\nOPENAPI_SPEC_URL=https://api.example.com/openapi.json\nAPI_ACCESS_TOKEN=your_token_here\nAUTH_TYPE=bearer\nMCP_MODE=stdio\nLOG_LEVEL=INFO\n```\n\nThen just run:\n\n```bash\nrestapi-mcp-server\n```\n\n### Method 4 — Claude Desktop Config (most common for MCP use)\n\nNo `.env` file needed. Pass everything via the `env` block in `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"restapi\": {\n      \"command\": \"restapi-mcp-server\",\n      \"env\": {\n        \"REST_API_BASE_URL\": \"https://api.example.com\",\n        \"OPENAPI_SPEC_URL\": \"https://api.example.com/openapi.json\",\n        \"API_ACCESS_TOKEN\": \"your_token_here\",\n        \"MCP_MODE\": \"stdio\",\n        \"ENABLE_HTTP_ENDPOINT\": \"false\"\n      }\n    }\n  }\n}\n```\n\nClaude Desktop injects the `env` block values directly into the process — this is the standard MCP pattern.\n\n---\n\n## Environment Variable Reference\n\n| Variable | Required | Default | Description |\n|----------|----------|---------|-------------|\n| `REST_API_BASE_URL` | Yes | — | REST API base URL |\n| `OPENAPI_SPEC_URL` | Yes | — | OpenAPI/Swagger spec URL or local file path |\n| `AUTH_TYPE` | No | `bearer` | Auth method: `bearer`, `apikey`, `basic`, `none` |\n| `API_ACCESS_TOKEN` | No | — | Bearer token for auth |\n| `API_KEY_HEADER` | No | `X-API-Key` | Header name for API key auth |\n| `API_KEY_VALUE` | No | — | API key value |\n| `BASIC_AUTH_USERNAME` | No | — | Username for basic auth |\n| `BASIC_AUTH_PASSWORD` | No | — | Password for basic auth |\n| `MCP_MODE` | No | `stdio` | `stdio` or `http` |\n| `ENABLE_HTTP_ENDPOINT` | No | `true` | Enable HTTP health/metrics endpoints |\n| `MCP_SERVER_PORT` | No | `8080` | HTTP server port |\n| `MCP_SERVER_HOST` | No | `0.0.0.0` | HTTP server host |\n| `LOG_LEVEL` | No | `INFO` | Logging verbosity |\n| `REQUEST_TIMEOUT` | No | `30` | Request timeout in seconds |\n| `SCHEMA_CACHE_TTL` | No | `3600` | Schema cache TTL in seconds |\n\n---\n\n## Operating Modes\n\n### MCP Mode (`stdio`) — for Claude Desktop, Cursor, MCP clients\n\n```bash\nrestapi-mcp-server --base-url https://api.example.com --spec-url https://api.example.com/openapi.json --mode stdio\n```\n\nCommunicates via stdin/stdout. No HTTP server is started. This is the default.\n\n### HTTP Mode — for Docker, Kubernetes, server deployments\n\n```bash\nrestapi-mcp-server --base-url https://api.example.com --spec-url https://api.example.com/openapi.json --mode http --port 8080\n```\n\nStarts an HTTP server with health and metrics endpoints:\n- `GET /` — server info\n- `GET /health` — health check\n- `GET /metrics` — server metrics\n- `GET /schema` — OpenAPI schema summary\n- `GET /tools` — all generated tools\n- `GET /api/endpoints` — all API endpoints\n\n---\n\n## Authentication Methods\n\n### Bearer Token\n\n```env\nAUTH_TYPE=bearer\nAPI_ACCESS_TOKEN=your_token\n```\n\n### API Key\n\n```env\nAUTH_TYPE=apikey\nAPI_KEY_HEADER=X-API-Key\nAPI_KEY_VALUE=your_key\n```\n\n### Basic Authentication\n\n```env\nAUTH_TYPE=basic\nBASIC_AUTH_USERNAME=username\nBASIC_AUTH_PASSWORD=password\n```\n\n### No Authentication\n\n```env\nAUTH_TYPE=none\n```\n\n---\n\n## Docker\n\n```bash\ndocker build -t restapi-mcp-server .\n\ndocker run -p 8080:8080 \\\n  -e REST_API_BASE_URL=https://api.example.com \\\n  -e OPENAPI_SPEC_URL=https://api.example.com/openapi.json \\\n  -e API_ACCESS_TOKEN=your_token \\\n  -e MCP_MODE=http \\\n  restapi-mcp-server\n```\n\nOr with Docker Compose:\n\n```bash\ncp .env.example .env   # fill in your values\ndocker-compose up\n```\n\n---\n\n## Available Tools\n\nThe server dynamically generates the following tool types:\n\n### Endpoint Tools\nNamed by HTTP method and path: `\u003cmethod\u003e_\u003cpath_parts\u003e`\n\nExamples:\n- `get_users`\n- `post_users`\n- `get_users_by_id`\n- `delete_users_by_id`\n- `put_users_by_id`\n\n### Utility Tools\n- `list_available_endpoints` — list all endpoints (filterable by method or path)\n- `get_endpoint_info` — detailed info about a specific endpoint\n- `get_schema_info` — OpenAPI schema summary or specific model details\n- `execute_custom_request` — run any HTTP request with full control\n- `health_check` — server health and schema status\n\n---\n\n## OpenAPI Specification Support\n\n- OpenAPI 3.x (full support)\n- Swagger 2.0 (backward compatible)\n\nSupported spec sources:\n- Remote JSON URL\n- Remote YAML URL\n- Local JSON file\n- Local YAML file\n\n---\n\n## Key Features\n\n- **Zero config endpoints** — auto-parses any OpenAPI/Swagger spec and generates MCP tools\n- **Dual mode** — stdio for MCP clients, HTTP for server deployments\n- **Flexible config** — CLI args, env vars, .env file, or Claude Desktop env block\n- **Multiple auth methods** — Bearer, API key, Basic, or none\n- **Production ready** — Docker, Kubernetes, AWS ECS, Google Cloud Run compatible\n- **Self-documenting** — `list_available_endpoints`, `get_endpoint_info`, `get_schema_info` tools built in\n- **Documentation** — https://nife.io/mcp_opensource\n---\n\n## Troubleshooting\n\n**`[ERROR] REST API base URL not configured`**\n\nSet `REST_API_BASE_URL` via any method above. The most common fix:\n```bash\nrestapi-mcp-server --base-url https://your-api.com\n```\n\n**`[ERROR] OpenAPI spec URL not configured`**\n\nSet `OPENAPI_SPEC_URL` via any method above:\n```bash\nrestapi-mcp-server --spec-url https://your-api.com/openapi.json\n```\n\n**Port already in use**\n\nChange the port:\n```bash\nrestapi-mcp-server --mode http --port 9090\n```\n\n**Docker container exits immediately**\n\nMake sure you're using HTTP mode:\n```bash\ndocker run -e MCP_MODE=http -e REST_API_BASE_URL=... -e OPENAPI_SPEC_URL=... restapi-mcp-server\n```\n\n**Schema not loading**\n\n- Verify the spec URL is reachable\n- Check the format is valid JSON or YAML\n- Ensure the spec is OpenAPI 3.x or Swagger 2.0\n\n---\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnifetency%2Fnife-mcp-restapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnifetency%2Fnife-mcp-restapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnifetency%2Fnife-mcp-restapi/lists"}