Any-API MCP Server
Supports OpenAPI/Swagger specification discovery and can automatically generate tools from OpenAPI definitions to interact with REST APIs
Click on "Deploy 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., "@Any-API MCP Server probe the /users endpoint to see what methods are available"
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.
Any-API MCP Server Template
A minimal, configurable Model Context Protocol (MCP) server you can use to adapt any HTTP API into an MCP toolset. It focuses on safety, clarity, and fast onboarding.
What You Get
Generic HTTP tools:
api_probe,api_get,api_post,api_put,api_deletePluggable auth (header, bearer, basic, query param)
Safe defaults: retries for GET only, rate-limit awareness (Retry-After), STDERR logging with redaction
Zero-boilerplate startup via STDIO (MCP)
TypeScript, strict mode, ESM
Related MCP server: ControlAPI-MCP
Quick Start
Use this repo as your starting point:
This repository root is the template — there is no separate
templates/subdirectory to copy from.Clone it, then rename/fork it for your own project (e.g.
mcp-any-api).
Install and build
npm ci
npm run buildConfigure environment (two simple options) Option A — API key/token you already have: Create
.env.local(auto-loaded by scripts) with your API details:
API_BASE=https://api.example.com/v1
AUTH_MODE=bearer # one of: none|bearer|header|basic|query
AUTH_TOKEN=YOUR_TOKEN # bearer token or header value depending on mode
AUTH_HEADER=Authorization # used if AUTH_MODE=header (default Authorization)
AUTH_QUERY_KEY=api_key # used if AUTH_MODE=query
ALLOW_DESTRUCTIVE=false # guard writesOption B — OAuth 2.0 (automated helpers):
Client Credentials (service-to-service):
TOKEN_URL=https://auth.example.com/oauth/token \
CLIENT_ID=... CLIENT_SECRET=... SCOPE="api.read api.write" \
npm run oauth2:clientThis writes AUTH_MODE/AUTH_TOKEN into .env.local.
Device Code (user sign-in on a second device):
DEVICE_AUTH_URL=https://auth.example.com/oauth/device/code \
TOKEN_URL=https://auth.example.com/oauth/token \
CLIENT_ID=... SCOPE="api.read" \
npm run oauth2:deviceFollow the printed verification URL and code. Upon success, the script updates .env.local.
4) Run in dev
```bash
npm run devAdd to your MCP client (example Claude Desktop)
{
"mcpServers": {
"any-api": {
"command": "node",
"args": ["/absolute/path/to/dist/server.js"],
"env": {
"API_BASE": "https://api.example.com/v1",
"AUTH_MODE": "bearer",
"AUTH_TOKEN": "YOUR_TOKEN",
"ALLOW_DESTRUCTIVE": "false"
}
}
}
}Tools
api_probe(safe):Inputs:
path(string),method(string), optionalheaders(record)Executes a single request and returns status, content-type, body preview (first N bytes)
api_get(safe):Inputs:
path, optionalquery(record), optionalheadersRetries on
429/502/503/504with backoff; honorsRetry-After
api_post(guarded),api_put(guarded),api_delete(guarded):Inputs:
path, optionalpayload(any), optionalheadersDELETE supports optional payload if API expects a body
All tools auto-join API_BASE with path and attach auth based on AUTH_MODE.
Auth Modes
none: no auth headerbearer:Authorization: Bearer <AUTH_TOKEN>header:<AUTH_HEADER>: <AUTH_TOKEN>basic:Authorization: Basic <AUTH_TOKEN>(you provide base64)query: appends?<AUTH_QUERY_KEY>=<AUTH_TOKEN>(or&when query exists)
Rate Limiting
GETs retry on
429/502/503/504using exponential backoff with jitterRetry-Afterheader is honored when presentScripts accept
PROBE_DELAY_MSto pace probes
Examples
Probe a path safely:
{
"path": "/users",
"method": "OPTIONS"
}GET with query:
{
"path": "/search",
"query": { "q": "widgets", "page": 2 }
}POST (guarded):
{
"path": "/widgets",
"payload": { "name": "Example", "price": 100 }
}Customizing
Add typed, domain-specific tools by creating new handlers in
src/server.tsKeep
ALLOW_DESTRUCTIVE=falseuntil you’re ready to allow writesTo support OAuth2 flows, fetch tokens outside the server and set
AUTH_MODE=bearerwithAUTH_TOKEN
Scripts
npm run validate:endpoints(safe): probes a set of paths/methods via GET/OPTIONS; pacing + Retry-After; dynamic delay adaptationnpm run probe:get(safe): throttled GET probe for a given listnpm run discover:openapi(safe): tries common OpenAPI/Swagger URLs, lists endpoints/methods, and saves raw specnpm run scan:wordlist(safe): OPTIONS-scan using a small default wordlist or a provided file; dynamic delay adaptationnpm run inventory:api(safe): one-command inventory; tries OpenAPI first, then wordlist; writes JSON toreports/npm run openapi:to:tools(safe): converts an OpenAPI JSON file totools.jsonfor dynamic tool registrationnpm run scan:to:tools(safe): converts a wordlist scan report totools.jsonnpm run oauth2:client/npm run oauth2:device: obtain OAuth tokens and update.env.local
Environment knobs:
PROBE_DELAY_MS: pacing between requests (default 800–1500ms)OUTPUT/OUTPUT_DIR: where to save reportsWORDLIST: path to a custom wordlist (forscan:wordlist)
All scripts auto-load .env.local.
Dynamic Tools (No Code Changes)
This server auto-registers tools from tools.json (if present in the working directory). You can generate tools.json from discovery output:
From OpenAPI:
OPENAPI_FILE=reports/openapi_*.json TOOLS_FILE=tools.json npm run openapi:to:toolsFrom wordlist scan:
SCAN_FILE=reports/wordlist_*.json TOOLS_FILE=tools.json npm run scan:to:toolsOnce tools.json exists, restart the server and the generated tools are available automatically. GET tools are safe; mutating tools are guarded (require ALLOW_DESTRUCTIVE=true).
Example: Hexnode API
Use the provided example tools file and Hexnode credentials:
Copy example to working tools file
cp examples/hexnode.tools.json tools.jsonConfigure Hexnode env in
.env.local(header auth)
API_BASE=https://<portal>.hexnodemdm.com/api/v1
AUTH_MODE=header
AUTH_HEADER=Authorization
AUTH_TOKEN=<your-hexnode-api-key>
ALLOW_DESTRUCTIVE=falseStart the server
npm run build && npm startNote: Some Hexnode tenants use singular policy paths (/policy/…) and others plural (/policies/…). The example includes both; use whichever works for your tenant or remove non-applicable entries from tools.json.
File Layout
src/server.ts: MCP entrypointsrc/lib/*.ts: helpers (qs, retry, logger)scripts/*: verification probesdist/*: compiled output
License
MIT — see LICENSE.
Available Tools
5 toolsapi_deleteC
Generic DELETE against API_BASE (guarded).
Inputs: path (required), headers, payload.
api_getB
Generic GET against API_BASE (safe).
Inputs: path (required), query, headers.
api_postC
Generic POST against API_BASE (guarded).
Inputs: path (required), headers, payload.
api_probeC
Probe an API path with any method (safe).
Inputs: path (required), method, headers, max_bytes.
api_putC
Generic PUT against API_BASE (guarded).
Inputs: path (required), headers, payload.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
The five tools map cleanly to distinct HTTP operations (probe, GET, POST, PUT, DELETE), so an agent can generally tell them apart. The only mild overlap is api_probe with any method potentially covering the same requests as the specific verb tools, but its 'safe probe' intent separates it clearly enough.
All tools follow a consistent api_<verb> pattern, with lowercase snake_case throughout. The verbs are standard HTTP operations, making the naming predictable and easy to infer.
Five tools is well-scoped for a generic API interaction server. Each tool covers a necessary HTTP operation without redundancy or bloat.
The common HTTP methods are covered, along with a safe probing option, which handles most API interaction needs. The surface has a minor gap: PATCH is missing, and the descriptions don't explicitly show how custom paths, headers, or bodies are specified.
Maintenance
Related MCP Connectors
Host any HTTP API as a standard MCP server; auto-distribute to 12+ mainstream agent platforms.
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
Find, document and execute authenticated API calls across 1000+ apps via one MCP server
Host any HTTP API as MCP tools with a tamper-evident cross-agent settlement ledger.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA generic MCP server that dynamically converts OpenAPI-defined REST APIs into tools for LLMs like Claude. It supports multiple authentication methods and transport protocols, enabling seamless interaction with any OpenAPI-compliant API.18 npmMIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that dynamically converts any OpenAPI or REST API into MCP tools, allowing for real-time server switching and schema reloading. It supports variable substitution for headers and bodies, enabling seamless authentication and interaction with multiple API environments.MIT
- AlicenseAqualityDmaintenanceA generic MCP server that dynamically exposes any OpenAPI-documented REST API to LLMs by auto-discovering endpoints. It provides tools for exploring API capabilities and making authenticated requests directly through natural language interfaces.211 npmMIT
- AlicenseNot gradedqualityCmaintenanceA dynamic MCP server that automatically discovers and generates tools from any REST API using OpenAPI/Swagger specifications, enabling instant endpoint access with zero manual configuration.MIT