Purpose: apifable is an MCP server whose goal is to make it smoother for AI agents to integrate APIs into TypeScript frontend projects. It provides AI with accurate API context to help write correct integration code.
Main capabilities:
- Supports OpenAPI 3.0 / 3.1 specifications as a reliable source of truth.
- Connects as an MCP server to AI agents such as Claude, Cursor, and Windsurf.
- API exploration: browse endpoints, search by keyword, and view complete request/response details.
- Generates TypeScript type definitions that can be used directly in frontend code.
Usage:
- Run apifable init to initialize the project configuration, which generates apifable.config.json in the project root directory; it is recommended to commit it to version control to share the spec path.
- During initialization, you can choose Manual file (the specification is already in the project, manually placed and maintained/updated) or Remote URL (downloaded from a stable remote address, supporting yaml and json; this mode automatically adds the local download path to .gitignore).
- In remote mode, you can use a command to download spec.url to spec.path; when the specification changes, rerun it to refresh.
- Non-sensitive request headers that team members can share go in spec.headers in apifable.config.json; private request headers that require authentication go in .apifable/auth.json and should not be committed to version control. The request header values in both files support ${ENV_VAR} syntax.
- Add the configuration in .mcp.json to connect; other agents such as Cursor and Windsurf can be configured in the same way.
MCP tools: get_api_overview returns the title, version, description, servers, and the number of endpoints for each tag; list_endpoints_by_tag returns endpoints paginated by tag; search_endpoints performs keyword search in operationId, path, summary, and description, and when there is no exact match, falls back to fuzzy search and returns matchType/score; get_endpoint returns the complete endpoint with parameters by method+path or operationId and resolves internal $ref; search_schemas searches schema names and descriptions; get_schema returns the complete schema; generate_types generates self-contained TypeScript declarations from one of schemas, method+path, or operationId (including transitive dependencies and excluding import statements).
Limitations: only one generate_types mode can be used per call, and they cannot be mixed; external $ref (other files or URLs) is not supported, OpenAPI 2.0 (Swagger) is not supported, and only 3.0 and 3.1 are supported.