AnythingMCP turns any REST API into MCP tools for Claude, ChatGPT and Copilot without code. Import an OpenAPI 3.x or Swagger 2.0 spec, a Postman collection or cURL commands, and every operation becomes a tool on your MCP server, with parameters, auth and endpoint mapping filled in. You can also define tools by hand.
Goal: go from a running AnythingMCP instance to a working MCP tool call against a public API, without writing code.
- Register at
http://localhost:3000(the first account becomes Admin). - Create a connector: Connectors → New Connector → REST. Name it
VIES VAT, Base URLhttps://ec.europa.eu/taxation_customs/vies/rest-api, Auth typeNone. Save. - Import the spec: on the connector page, Import → OpenAPI URL, paste
https://ec.europa.eu/taxation_customs/vies/rest-api/openapi.json. AnythingMCP generates one tool per operation. Toggle the tools you want exposed. - Issue an MCP API key: Profile → MCP API Keys → New Key. Copy the value.
- Point your MCP client at it. For Claude Desktop, add to
claude_desktop_config.json:Restart Claude Desktop, then ask: "Use AnythingMCP to validate VAT number DE123456789." The tool call appears in the audit log at{ "mcpServers": { "anythingmcp": { "url": "http://localhost:4000/mcp", "headers": { "X-API-Key": "<your-mcp-key>" } } } }/audit.
If you'd rather use a pre-built adapter (DHL, DPD, Personio, VIES, …) instead of importing from a spec, see Pre-configured MCP Connectors — those skip steps 2–3.
The REST connector lets you expose HTTP-based APIs as MCP tools. It supports all HTTP methods, authentication types, and can auto-import tool definitions from multiple formats.
Keywords: REST API to MCP, OpenAPI to MCP, Swagger to MCP, Postman to MCP, cURL to MCP, HTTP API MCP bridge
- Go to Connectors > New Connector
- Select REST as the type
- Enter the Base URL (e.g.,
https://api.example.com) - Configure authentication (see Auth Types)
- Click Create
TOKEN=$(curl -s http://localhost:4000/api/auth/login \
-H 'Content-Type: application/json' \
-d '{"email":"admin@example.com","password":"your-password"}' \
| jq -r '.accessToken')
curl -s http://localhost:4000/api/connectors \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"name": "My REST API",
"type": "REST",
"baseUrl": "https://api.example.com",
"authType": "BEARER_TOKEN",
"authConfig": {
"token": "your-api-token"
}
}'Paste the spec URL or JSON/YAML content. Tools are auto-generated for each path + method with:
- Tool name from
operationId - Parameters from path params, query params, and request body
- Endpoint mapping auto-configured
# Import from URL
curl -s http://localhost:4000/api/connectors/$CONNECTOR_ID/import \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"source": "openapi", "url": "https://petstore.swagger.io/v2/swagger.json"}'Supports Postman Collection v2.1 format, including:
- Nested folders (flattened with folder prefixes)
- All auth types (Bearer, Basic, API Key, OAuth2)
- Body modes: raw JSON, form-data, urlencoded
- Variable interpolation (
{{var}}→ tool parameters)
curl -s http://localhost:4000/api/connectors/$CONNECTOR_ID/import \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"source": "postman",
"url": "https://www.getpostman.com/collections/your-collection-id"
}'Paste one or more cURL commands. Supports:
-Xmethod,-Hheaders,-dbody-ubasic auth- Multiline with
\continuation {{var}}patterns auto-detected as tool parameters
curl -X POST https://api.example.com/users \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {{token}}' \
-d '{"name": "{{name}}", "email": "{{email}}"}'This generates a tool with token, name, and email as parameters.
When an API has no OpenAPI spec, no Postman collection and no docs — just a web app that calls it — capture the traffic instead: in your browser's DevTools, open the Network tab, use the app for the flow you want, then right-click → "Save all as HAR". Import that file from the connector's Import Tools panel (source "HAR file (browser capture)"); the UI only accepts a file here, not pasted text.
Only requests to the connector's own base URL are kept; everything else (other
origins, stylesheets, scripts, images, fonts, WebSocket upgrades) is skipped.
Repeated requests to the same path with a different id (/orders/123,
/orders/456) collapse into one tool with an {id} path parameter. Query
parameters and JSON or form bodies become tool parameters.
A HAR carries your browser's session: cookies, bearer tokens and API keys. None
of that is ever uploaded. The browser strips response bodies, cookies and
credential-looking headers before the file leaves it, and the backend parser
drops Cookie, Authorization and any header, query parameter or body field
named like a credential (token, secret, password, api_key, session,
and similar) on top of that — the connector's own configured auth, not
anything recorded in the capture, is what actually authenticates the tool's
calls. A credential-named body field (e.g. a login form's password) still
becomes a parameter, just with no captured default, since the call needs that
value supplied at call time.
Define tools directly as JSON:
{
"tools": [
{
"name": "get_user",
"description": "Get user by ID",
"parameters": {
"type": "object",
"properties": {
"id": { "type": "integer", "description": "User ID" }
},
"required": ["id"]
},
"endpointMapping": {
"method": "GET",
"path": "/users/{id}"
}
}
]
}The endpointMapping defines how MCP tool parameters map to the HTTP request:
{
"method": "POST",
"path": "/users/{user_id}/orders",
"queryParams": {
"page": "$page",
"limit": "$limit"
},
"bodyMapping": {
"productId": "$product_id",
"quantity": "$qty"
},
"headers": {
"X-Request-ID": "$request_id"
}
}| Pattern | Location | Description |
|---|---|---|
{param} in path |
URL path | Replaced in the URL: /users/{id} → /users/123 |
"$param" in queryParams |
Query string | Added as ?param=value |
"$param" in bodyMapping |
JSON body | Included in request body |
"$param" in headers |
HTTP headers | Sent as request header |
Optionally shape the API response before it reaches the AI client. Without it, the raw upstream response is returned unchanged.
APIs routinely return far more than a tool needs — a Datto RMM device carries up to 300 UDF fields, IPs and remote-control URLs when the tool only wants hostname, site, OS and status. Every extra byte is billed to the agent's context window and exposed to a third-party model. A response mapping declares what a tool actually publishes.
{
"responseMapping": {
"transform": {
"select": {
"page": {
"count": "$.pageDetails.count",
"totalCount": "$.pageDetails.totalCount",
"nextPageUrl": "$.pageDetails.nextPageUrl"
},
"devices": {
"$from": "$.devices[*]",
"$select": {
"id": "id",
"hostname": "hostname",
"siteName": "siteName",
"category": "deviceType.category",
"operatingSystem": "operatingSystem",
"online": "online",
"antivirusStatus": "antivirus.antivirusStatus"
}
}
},
"exclude": ["devices[*].udf"]
}
}
}| Key | Meaning |
|---|---|
select |
Output template. Keys are the output names; leaf syntax below. |
include |
Keep only these paths, preserving the original document shape. |
exclude |
Drop these paths. Applied before include / select. |
expression |
A JMESPath expression, with "mode": "jmespath". Use it for computed values (length(devices)) and filters (devices[?online == `false`]). |
mode |
select (default), jmespath, or off to keep the config without applying it. |
fallbackToRaw |
Default true: a mapping that fails returns the raw response and logs a warning rather than failing the call. Set false to surface the error instead. |
maxBytes |
Hard cap on the serialized output. 0 / absent = no cap. On overflow the result is replaced by { "_truncated": true, … }. |
| Leaf | Result |
|---|---|
"$.a.b" / "a.b" |
Value at that path. A leading $. is optional. |
"items[*].id" |
Array of id over items — elements without the field are skipped. |
"items[0].id", "items[-1].id" |
Index access; negative counts from the end. |
"a['weird.key']" |
Quoted segment, for keys containing dots. |
"= my-source" |
Static string literal (= prefix), for constants. |
42, true, null |
Passed through as-is. |
{ "$from": "path[*]", "$select": { … } } |
Reshape every element of an array. Optional $limit caps how many. |
A path that does not resolve leaves its key out of the output rather than
emitting null — that is what keeps mapped responses small.
Response mapping applies to every connector type, not just REST.
{"type": "json", "fields": [...]} is still honoured and behaves as
transform.include.
- UI: Connector → tool → Edit → Response Mapping. "Preview with last real response" maps the most recent recorded response for that tool without calling the API again, and shows the size delta.
- API:
PATCH /api/connectors/:id/tools/:toolId/response-mappingsets or clears it,POST .../preview-mappingdry-runs one. The tool test endpoint returns bothresult(raw) andmapped.
| Auth Type | Config |
|---|---|
| None | "authType": "NONE" |
| API Key | "authType": "API_KEY", "authConfig": {"key": "X-API-Key", "value": "your-key"} |
| Bearer Token | "authType": "BEARER_TOKEN", "authConfig": {"token": "your-token"} |
| Basic Auth | "authType": "BASIC_AUTH", "authConfig": {"username": "user", "password": "pass"} |
| OAuth2 | "authType": "OAUTH2", "authConfig": {"clientId": "...", "clientSecret": "...", "authorizationUrl": "...", "tokenUrl": "...", "scopes": "read write"} |
All credentials are encrypted with AES-256-GCM at rest.
OAuth2 connectors use the Authorization Code + PKCE flow:
- Create the connector with
authType: "OAUTH2"and fill inclientId,clientSecret,authorizationUrl,tokenUrl, and optionallyscopes. - Register
http://localhost:4000/api/mcp-oauth/callbackas the redirect URI in your OAuth provider settings (use yourSERVER_URLin production). - From the connector detail page, click Authorize with Provider — you will be redirected to the provider's login/consent screen.
- After consent, the backend exchanges the authorization code for access and refresh tokens (stored encrypted).
- On 401 responses, the engine automatically refreshes the token using the stored refresh token and retries the request.
By default the client credentials are sent in the body of the token request (client_secret_post).
Some providers — DATEV among them — only accept them as an HTTP Basic header
(Authorization: Basic base64(client_id:client_secret), RFC 6749 §2.3.1) and answer anything else with
401 at the code-exchange step.
Pick the method in the connector form under Token endpoint authentication, or set it directly:
curl -s -X PATCH http://localhost:4000/api/connectors/$CONNECTOR_ID/oauth-config \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"tokenAuthMethod": "client_secret_basic"}'Notes:
- The setting applies to both the initial authorization-code exchange and later refreshes.
PATCH .../oauth-configmerges — it will not drop the tokens already issued or the endpoints captured during authorization. Send""to go back to the default.GET .../oauth-configreturns the current settings; the client secret and tokens are never returned, onlyhasClientSecret/hasAccessToken/hasRefreshTokenbooleans.- After switching the method, re-run Authorize with Provider so a token is fetched the new way.
Some APIs issue a token from stored credentials and expect the client to ask again when it expires,
with no refresh token. Choose the grant under Grant type in the connector form, or set grant:
- Authorization code (default): the flow above, renewed with the refresh token.
- Client credentials (
client_credentials): the client ID and secret alone get the token. - Password (
password, RFC 6749 §4.3): the token request also carries ausernameandpassword.
With the last two there is nothing to authorize: the connector requests a token on its first call, again
shortly before the token expires, and again when the API answers 401. The client is sent as an HTTP Basic
header by default for these grants; pick Client secret in body if the provider wants it in the form.
The username and password, like the client secret, are never returned by GET .../oauth-config, only
hasUsername / hasPassword.
curl -s -X PATCH http://localhost:4000/api/connectors/$CONNECTOR_ID/oauth-config \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"grant": "password", "username": "<API key>", "password": "<API secret>"}'Example — Datto RMM. Its tokens last 100 hours and come with no refresh token, so a connector set up with the authorization-code flow stops working after 100 hours. Use the password grant:
| Field | Value |
|---|---|
| Grant type | Password |
| Username / Password | the API key / API secret key of the technical user |
| Client ID / Secret | public-client / public |
| Token URL | https://<zone>-api.centrastage.net/auth/oauth/token |
| Token endpoint authentication | HTTP Basic header (the default for this grant) |
Some providers issue no client secret. The client registers a public key or certificate and proves who it
is with a short-lived JWT signed by the matching private key (RFC 7523 §2.2). Revolut Business works this
way. Set tokenAuthMethod to private_key_jwt and describe the signature under clientAssertion:
"authConfig": {
"clientId": "{{REVOLUT_CLIENT_ID}}",
"authorizationUrl": "https://business.revolut.com/app-confirm",
"tokenUrl": "https://b2b.revolut.com/api/1.0/auth/token",
"tokenAuthMethod": "private_key_jwt",
"clientAssertion": {
"privateKey": "{{REVOLUT_PRIVATE_KEY}}",
"algorithm": "RS256",
"ttlSeconds": 300,
"keyId": "optional kid header",
"claims": { "iss": "{{REVOLUT_REDIRECT_DOMAIN}}", "aud": "https://revolut.com" }
}
}- A new assertion is signed for every token request (code exchange, refresh,
client_credentials) and sent asclient_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearerplusclient_assertion. No client secret and noclient_idfield are sent; the client id is the assertion'ssub. - Claims default to RFC 7523:
issandsubare the client id,audis the token URL, plusiat,expand a randomjti.claimsoverrides any of them;expis alwaysiat + ttlSeconds(default 300, at most 3600). algorithm:RS256(default),RS384,RS512,PS256,ES256orES384.privateKeytakes a PEM key, PKCS#1 (BEGIN RSA PRIVATE KEY), PKCS#8 (BEGIN PRIVATE KEY) or SEC1 (BEGIN EC PRIVATE KEY). A key pasted into a single-line field, with its line breaks gone, still works. Passphrase-protected keys are refused with a message saying how to export one without a passphrase.
RFC 6749 §5.1 puts access_token, refresh_token and expires_in at the top level of the token answer,
and that is where they are read. A few providers wrap them in an answer of their own. Joom's token and
refresh calls answer:
{ "code": 0, "message": "", "data": { "access_token": "…", "refresh_token": "…", "expires_in": 2592000 } }Name the object that holds the token fields in authConfig.tokenResponsePath, as a dotted path of keys:
"authConfig": {
"grant": "refresh_token",
"authorizationUrl": "https://api-merchant.joom.com/api/v2/oauth/authorize",
"tokenUrl": "https://api-merchant.joom.com/api/v2/oauth/access_token",
"refreshUrl": "https://api-merchant.joom.com/api/v2/oauth/refresh_token",
"tokenResponsePath": "data",
"pkce": false,
"clientId": "{{JOOM_CLIENT_ID}}",
"clientSecret": "{{JOOM_CLIENT_SECRET}}",
"refreshToken": "{{JOOM_REFRESH_TOKEN}}"
}- The setting applies to the authorization-code exchange, to every refresh and to the
client_credentialsandpasswordgrants: the access token, the refresh token and the lifetime are all read from that object. - It is opt-in. Without it nothing changes: the fields are read at the top level and a
dataobject in the answer is not looked into. - When the answer has no object at the path, the sign-in or the renewal fails with a message that names
the path and quotes the provider's own top-level
codeandmessage(how these APIs report a refused code or refresh token inside a200). Nothing else of the answer is quoted. - It is part of the adapter definition (or of a connector's
authConfigset through the API); the connector form has no field for it.scripts/validate-adapters.mjschecks it (ruletoken-response-path): a dotted path of keys, onOAUTH2only.
refreshUrl, in the same example, is for providers that renew at another address than the one that issues
the first token; without it refreshes go to tokenUrl.
Define per-connector environment variables for secrets that should be injected at runtime but hidden from the AI:
curl -s -X PUT http://localhost:4000/api/connectors/$CONNECTOR_ID/env-vars \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"envVars": {
"API_SECRET": "my-secret-value",
"TENANT_ID": "abc-123"
}
}'Use {{VAR_NAME}} in endpoint mappings. Parameters matching env var names are automatically stripped from the tool schema.
Some services put the credential in the address itself: a Bitrix24 inbound webhook
(https://portal.bitrix24.com/rest/1/<code>/), a Slack, Discord, Microsoft Teams, Zapier or Make
webhook URL, a Telegram bot URL (https://api.telegram.org/bot<token>), a key in the query string
(?api_key=…, ?token=…, ?sig=…), or https://user:password@host. Whoever holds such a URL can
use it like a password.
When you save a REST, GraphQL, SOAP, OData or MCP connector with such a base URL, AnythingMCP moves only the secret part into an encrypted variable and stores the rest of the URL with a reference:
typed: https://portal.bitrix24.com/rest/1/k2bx…vqgo/
stored: https://portal.bitrix24.com/rest/1/{{BITRIX_CRM_WEBHOOK_TOKEN}}/
- The variable is named after the connector (
<NAME>_WEBHOOK_TOKEN,<NAME>_PASSWORD,<NAME>_API_KEY,TELEGRAM_BOT_TOKEN) or reuses a variable that already holds the same value. Its value is encrypted at rest and never returned by the connector API, to admins neither (only an admin export with secrets carries it, like every other variable); the dashboard shows it as set. The save answers withsecretsMovedandsecretsNotice, naming the variable, never the secret. - Calls are unchanged: every call replaces
{{VAR}}in the base URL with the variable's value as stored, so the request goes to exactly the URL you typed. To change the secret, edit the variable, or type the full URL again. - The host and the rest of the path stay readable, so the connector page, error hints and logs still show where the connector points.
- Headers and tool paths get the same treatment (
Authorization: Bearer <token>becomesBearer {{<NAME>_TOKEN}}).
Connectors saved before a rule existed keep the secret in the stored base URL until they are
saved again. Until then the API shows it as ********
(https://portal.bitrix24.com/rest/1/********/); saving the form with the URL as shown keeps the
stored secret and moves it into a variable, and a URL edited around ******** is refused, so type
the full address again. The backend also moves these at every start, the same way a save does,
except for long random path segments with no known shape (a save moves those and says so; the
start-up pass leaves them alone). This needs no setting and works the same on AnythingMCP Cloud and
self-hosted. The backend log shows the result with connector ids and counts, never a URL:
Base URL secrets: secrets of 2 connectors moved into encrypted variables (cm1…, cm2…); 0 left as is; 0 failed
"Left as is" are connectors that were saved while the pass ran; the next start checks them again.
"Failed" names connectors whose variables could not be decrypted (a changed ENCRYPTION_KEY) or
written; they stay unchanged, still masked in the API, and the next start tries again.
scripts/secret-literals/report.ts lists what is left, and repair.ts also cleans tool paths,
headers and tool names (dry run by default, with a backup table before --apply).
# 1. Create connector
CONNECTOR_ID=$(curl -s http://localhost:4000/api/connectors \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"name": "JSONPlaceholder",
"type": "REST",
"baseUrl": "https://jsonplaceholder.typicode.com",
"authType": "NONE"
}' | jq -r '.id')
# 2. Bulk create tools
curl -s http://localhost:4000/api/connectors/$CONNECTOR_ID/tools/bulk \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"tools": [
{
"name": "list_posts",
"description": "List all posts, optionally filter by user",
"parameters": {
"type": "object",
"properties": {
"userId": { "type": "integer", "description": "Filter by user ID" }
}
},
"endpointMapping": {
"method": "GET",
"path": "/posts",
"queryParams": { "userId": "$userId" }
}
},
{
"name": "get_post",
"description": "Get a single post by ID",
"parameters": {
"type": "object",
"properties": {
"id": { "type": "integer", "description": "Post ID" }
},
"required": ["id"]
},
"endpointMapping": {
"method": "GET",
"path": "/posts/{id}"
}
},
{
"name": "create_post",
"description": "Create a new blog post",
"parameters": {
"type": "object",
"properties": {
"title": { "type": "string", "description": "Post title" },
"body": { "type": "string", "description": "Post content" },
"userId": { "type": "integer", "description": "Author user ID" }
},
"required": ["title", "body", "userId"]
},
"endpointMapping": {
"method": "POST",
"path": "/posts",
"bodyMapping": {
"title": "$title",
"body": "$body",
"userId": "$userId"
}
}
}
]
}'