AnyAPI MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "API_KEY=${API_KEY}" anyapi-mcp-server -- npx -y anyapi-mcp-server --name your-api --spec path/to/openapi.json --base-url https://api.example.com --header "Authorization: Bearer ${API_KEY}"
Required:API_KEY
README.md

If it has an API, you can MCP it.

anyapi-mcp-server

If it has an API, you can MCP it.

Traditional MCP servers hand-pick a handful of endpoints and call it a day — locking you into whatever subset someone decided was "enough." Why settle for a fraction of an API when you can have all of it?

anyapi-mcp-server is a universal MCP server that connects any REST API to AI assistants like Claude, Cursor, and other LLM-powered tools — just point it at an OpenAPI spec or Postman collection. Every endpoint the API provides becomes available instantly, with GraphQL-style field selection and automatic schema inference. No custom server code, no artificial limits.

Quick start

1. Install

npm install -g anyapi-mcp-server

2. Add to your MCP client (Cursor, Claude Desktop, etc.)

{
  "mcpServers": {
    "your-api": {
      "command": "npx",
      "args": [
        "-y",
        "anyapi-mcp-server",
        "--name", "your-api",
        "--spec", "path/to/openapi.json",
        "--base-url", "https://api.example.com",
        "--header", "Authorization: Bearer ${API_KEY}"
      ],
      "env": {
        "API_KEY": "your-api-key"
      }
    }
  }
}

3. Use the tools — discover endpoints with list_api, inspect schemas with call_api, fetch data with query_api.

Provider examples

Ready-to-use configurations for popular APIs:

Provider Auth
Cloudflare API Token or Key + Email
Datadog API Key + App Key
GitHub Personal Access Token
Google Workspace OAuth 2.0
Metabase API Key
PostHog Personal API Key
Slack Bot/User Token

These work with any API that has an OpenAPI or Postman spec — the above are just examples. Stripe, Twilio, Shopify, HubSpot, and anything else with a REST API will work the same way.

CLI reference

Required flags

Flag Description
--name Server name (e.g. cloudflare)
--spec Path or HTTPS URL to an OpenAPI spec (JSON/YAML) or Postman Collection. Remote URLs are cached locally. Supports ${ENV_VAR}.
--base-url API base URL (e.g. https://api.example.com). Supports ${ENV_VAR}.

Optional flags

Flag Description
--header HTTP header as "Key: Value" (repeatable). Supports ${ENV_VAR} in values.
--log Path to NDJSON request/response log. Sensitive headers are masked automatically.

OAuth flags

For APIs that use OAuth 2.0 instead of static tokens. If any of the three required flags is provided, all three are required. All flags support ${ENV_VAR}.

Flag Required Description
--oauth-client-id Yes* OAuth client ID
--oauth-client-secret Yes* OAuth client secret
--oauth-token-url Yes* Token endpoint URL
--oauth-auth-url No Authorization endpoint (auto-detected from spec if available)
--oauth-scopes No Comma-separated scopes
--oauth-flow No authorization_code (default) or client_credentials
--oauth-param No Extra token parameter as key=value (repeatable)

See the Google Workspace guide for a complete OAuth example.

Tools

The server exposes four tools (plus auth when OAuth is configured):

`list_api` — Browse endpoints

Discover what the API offers. Call with no arguments to see all categories, provide category to list endpoints in a tag, or search to find endpoints by keyword.

`call_api` — Inspect an endpoint

Makes a real HTTP request and returns the inferred GraphQL schema (SDL) — not the data itself. Use this to discover the response shape and get suggestedQueries you can copy into query_api. Also returns per-field token costs (fieldTokenCosts) and a dataKey for cache reuse. For PUT/PATCH requests, automatically creates a pre-write backup (returns backupDataKey). Supports bodyFile for large payloads and blocks requests with detected placeholder values.

`query_api` — Fetch data

Fetches data and returns only the fields you select via a GraphQL query. Supports both reads and writes (mutations for POST/PUT/DELETE/PATCH). Pass a dataKey from call_api to reuse cached data with zero HTTP calls.

# Read
{ items { id name status } _count }

# Write
mutation { post_endpoint(input: { name: "example" }) { id } }

Key parameters:

  • maxTokens — token budget for the response (default 4000). Arrays are truncated to fit.
  • dataKey — reuse cached data from a previous call_api or query_api response.
  • jsonFilter — d

Tools (3)

list_apiDiscover what the API offers by browsing endpoints.
call_apiInspect an endpoint by making an HTTP request and returning an inferred GraphQL schema.
query_apiFetch data or perform mutations using GraphQL-style field selection.

Environment Variables

API_KEYrequiredAPI authentication key or token

Configuration

claude_desktop_config.json
{"mcpServers": {"your-api": {"command": "npx", "args": ["-y", "anyapi-mcp-server", "--name", "your-api", "--spec", "path/to/openapi.json", "--base-url", "https://api.example.com", "--header", "Authorization: Bearer ${API_KEY}"], "env": {"API_KEY": "your-api-key"}}}}

Try it

List all available endpoints for the connected API to understand what I can interact with.
Inspect the schema for the user profile endpoint to see what fields are available.
Fetch the latest 5 items from the API using a GraphQL query to select only the id and name fields.
Perform a mutation to update the status of the item with ID 123.

Frequently Asked Questions

What are the key features of AnyAPI MCP Server?

Connects any REST API to AI assistants using OpenAPI or Postman specifications.. Provides GraphQL-style field selection for efficient data retrieval.. Automatic schema inference for all API endpoints.. Supports both read operations and write mutations (POST/PUT/DELETE/PATCH).. Built-in caching mechanism with dataKey reuse to minimize HTTP calls..

What can I use AnyAPI MCP Server for?

Integrating internal company APIs into Claude for automated data reporting.. Managing cloud infrastructure resources via AI by connecting to provider APIs like Cloudflare or Datadog.. Interacting with SaaS platforms like GitHub or Slack directly through natural language commands.. Rapidly prototyping AI-driven workflows for APIs that lack native MCP support..

How do I install AnyAPI MCP Server?

Install AnyAPI MCP Server by running: npm install -g anyapi-mcp-server

What MCP clients work with AnyAPI MCP Server?

AnyAPI MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep AnyAPI MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare