MCP server for authenticated REST API calls with automatic login, token caching, 2FA, Swagger discovery, and endpoint search.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
We ran the install command below but it didn't respond within our test window โ this can mean a slow first-time install rather than a real problem.
npx -y rest-api-mcpNo response to initialize.
This is an experimental automated check and can have false negatives โ missing environment variables, a slow cold install, etc. It doesnโt necessarily mean somethingโs wrong. Last checked 1mo ago.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Rest API MCP.
search_endpointsFuzzy-search the API spec by keyword. Returns matching endpoints with method, path, summary, tags, and required parameters. **Use this before `request` when you don't know the exact path.**
describe_endpointReturns the full OpenAPI schema for a **single endpoint**: parameters, request body schema (with types, required flags, enums, examples), response schemas, and a **generated example request body**. Use this before `request()` when you need to know exactly what fields to include in the body or whatโฆ
requestMake an authenticated API call. Handles login automatically โ re-logins transparently if the token is expired.
inspect_loginPerforms the login flow (and optional 2FA verify) and returns the **raw server responses** without extracting a token. Also returns **heuristic suggestions** for:
fetch_specFetch the full OpenAPI/Swagger JSON spec for schema inspection, DTO discovery, or understanding available endpoints.
A Model Context Protocol (MCP) server for authenticated REST APIs.
Drop it into any project, point it at your API, and let AI agents call endpoints โ with auto-login, 2FA support, Swagger spec fetch, and fuzzy endpoint search โ all without writing a single line of auth code.
| Capability | Description |
|---|---|
| Auto-login | Logs in automatically before every request; re-logins when token expires |
| Token caching | 20-second TTL cache โ survives rapid sequential calls |
| Auto-discovery | Finds the login endpoint by scanning the Swagger spec (no config needed) |
| Auto token detection | Tries 9 common token paths (data.access_token, accessToken, token, โฆ) |
| AI-driven token detection | inspect_login tool exposes raw responses + heuristic suggestions so the AI can pick the exact token path |
| 2FA / OTP support | Two-step auth: login โ verify-otp, session identifiers forwarded automatically |
| Custom session fields | Override hardcoded session candidates via verify_session_fields in request() |
| Extra login fields | source, userRole, channel, device_id โ any field, via JSON env var |
| Fuzzy endpoint search | Find endpoints by keyword across path, summary, description, tags, operationId |
| Swagger spec fetch | Retrieve and inspect the full OpenAPI spec |
| SSL bypass | Optional for staging/dev environments with self-signed certs |
| Response truncation | Configurable size limit to keep responses in context |
No installation needed. Add this to your project's .vscode/mcp.json and VS Code will download and run the package automatically:
This always uses the latest published version from npm. See VS Code mcp.json Examples for a full config.
Then point VS Code at the local build:
Add this to your project's .vscode/mcp.json:
That's it. The agent can now:
All configuration is done via environment variables in mcp.json. No code changes required.
| Variable | Description |
|---|---|
REST_BASE_URL | Base URL of the API (no trailing slash) |
API_EMAIL | Login email |
API_PASSWORD | Login password |
| Variable | Description |
|---|---|
API_SWAGGER_URL | OpenAPI/Swagger JSON URL โ enables fetch_spec, search_endpoints, and auto-login-endpoint discovery |
See Environment Variables Reference for the full list.
search_endpointsFuzzy-search the API spec by keyword. Returns matching endpoints with method, path, summary, tags, and required parameters. Use this before request when you don't know the exact path.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
query | string | โ | Keywords to search for |
limit | number | โ | Max results (default: 10) |
Example โ Find order-related endpoints:
Response:
describe_endpointReturns the full OpenAPI schema for a single endpoint: parameters, request body schema (with types, required flags, enums, examples), response schemas, and a generated example request body. Use this before request() when you need to know exactly what fields to include in the body or what response shape to expect.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
method | string | โ | GET, POST, PUT, PATCH, DELETE |
endpoint | string | โ | Path relative to REST_BASE_URL, e.g. /inspections |
Example โ Inspect a POST endpoint before calling it:
Response:
The AI can now call request() with the exact body shape, no guessing required.
requestMake an authenticated API call. Handles login automatically โ re-logins transparently if the token is expired.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
method | string | โ | GET, POST, PUT, PATCH, DELETE |
endpoint | string | โ | Path relative to REST_BASE_URL, e.g. /users/profile |
body | object | โ | Request body for POST/PUT/PATCH |
headers | object | โ | Extra headers to merge |
skip_auth | boolean | โ | Set true to skip the Authorization header |
token_path | string | โ | Dot-notation path to the token in the login/verify response (e.g. data.result.accessToken). Overrides auto-detection and is cached for re-logins. |
verify_session_fields | object | โ | Map of verify-body field names โ dot-notation paths in the step-1 login response. Example: {"sessionId": "data.result.sessionId"}. Overrides hardcoded candidates and is cached for re-logins. |
Response shape:
login_datacontains the full login response โ useful for IDs likeuserId,orgId,tenantIdreturned at login that you need for subsequent requests.
Example โ GET current user profile:
Example โ POST with filters:
Example โ PATCH to update a resource:
Example โ Public endpoint (no auth):
Example โ Custom token path (when auto-detection fails):
Example โ Custom 2FA session fields:
inspect_loginPerforms the login flow (and optional 2FA verify) and returns the raw server responses without extracting a token. Also returns heuristic suggestions for:
Use this when auto-detection fails so the AI can identify the correct token_path and verify_session_fields to pass to request().
No input required.
Example โ when request() fails with "Could not find token":
Response:
Factual signals from GitHub, npm, and our automated checks โ not a rating.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/muhammed-abdelghany-rest-api-mcp)<a href="https://allmcps.com/mcp/muhammed-abdelghany-rest-api-mcp"><img src="https://allmcps.com/api/badge/muhammed-abdelghany-rest-api-mcp?style=directory" alt="Rest API MCP on AllMCPs" /></a>