apifable
apifable is an MCP server that helps AI agents explore OpenAPI specs and generate TypeScript types for API integration.
Get general OpenAPI spec info: title, version, description, servers, security schemes, and tags with endpoint counts.
List endpoints by tag with pagination support.
Search endpoints by keyword across operationId, path, summary, and description, with exact and fuzzy matching.
Get full endpoint details including parameters, request body, responses, and resolved internal $refs.
Search schemas by name and description.
Get a specific schema with internal component $refs resolved inline.
Generate self-contained TypeScript type declarations for schemas or for all schemas used by an endpoint.
Integrates with OpenAPI 3.0 and 3.1 specifications to allow for endpoint exploration, schema searching, and resolving request/response details.
Generates self-contained TypeScript type definitions from API endpoints and schemas to facilitate type-safe frontend integration.

apifable
Read the spec. Understand the API. Integrate with confidence.
English | 繁體中文
Overview
apifable is an MCP server that helps AI integrate APIs more smoothly into TypeScript frontend projects. It makes it easy to explore API structure, search endpoints, and generate TypeScript types, giving your AI agent the context it needs to write accurate integration code.
Related MCP server: openapi-mcp-proxy
✨ Features
📦 AI-ready API context — give AI the structure it needs to understand and work with your API
📘 OpenAPI 3.0 / 3.1 support — works with standard specs as a reliable source of truth
🤖 MCP server for AI agents — plug into Claude, Cursor, and Windsurf
🔍 API exploration tools — browse endpoints, search by keyword, and inspect full request/response details
🏷️ TypeScript type generation — generate TypeScript type definitions ready to use in frontend code
Getting Started
Installation
Run apifable init to set up your project configuration:
npx apifable@latest initThis creates apifable.config.json in your project root. The config file should be committed to version control so the spec path is shared with your team.
After the command starts, you can choose between Manual file and Remote URL.
1. Manual file
Use this mode if your OpenAPI spec already lives in the project, or if you want to manage spec updates yourself.
init will ask for the local file path, such as openapi.yaml.
This generates the following apifable.config.json:
{
"spec": {
"path": "openapi.yaml"
}
}You then need to place your OpenAPI spec at that path manually. When the backend API changes, you also need to update that file manually.
2. Remote URL
Use this mode if your OpenAPI spec is available from a stable remote URL, such as the OpenAPI spec endpoint provided by your backend API docs.
init will first ask for the remote URL, such as https://api.example.com/openapi.yaml (supports yaml and json files), and then ask for the local output path, such as openapi.yaml.
This generates the following apifable.config.json:
{
"spec": {
"path": "openapi.yaml",
"url": "https://api.example.com/openapi.yaml"
}
}In this mode,init also adds the downloaded local spec path to .gitignore automatically, because the file is intended to be refreshed from the remote source. Of course, you can decide for yourself whether to commit it to version control.
You can then run the following command to download the OpenAPI spec from the remote URL to your local path (spec.url → spec.path). Whenever the spec changes, just run it again to refresh:
npx apifable@latest fetchHeaders
For non-sensitive headers that can be shared with your team, add spec.headers to apifable.config.json:
{
"spec": {
"path": "openapi.yaml",
"url": "https://example.com/openapi.yaml",
"headers": {
"X-Api-Version": "2"
}
}
}Auth Headers (Secret Tokens)
If downloading the remote OpenAPI spec requires authentication (private API), store secret headers in .apifable/auth.json. This file should not be committed to version control:
{
"headers": {
"Authorization": "Bearer YOUR_SECRET_TOKEN"
}
}Both apifable.config.json and .apifable/auth.json support ${ENV_VAR} syntax in header values.
{
"headers": {
"Authorization": "Bearer ${MY_API_KEY}"
}
}Headers Priority (highest to lowest)
.apifable/auth.jsonheaders (overrides same-named keys)apifable.config.jsonspec.headers
Claude Code
Add the following to your .mcp.json:
{
"mcpServers": {
"apifable": {
"command": "npx",
"args": ["-y", "apifable@latest", "mcp"]
}
}
}For other AI agents such as Cursor and Windsurf, you can follow the same approach to configure apifable as an MCP server.
Usage
Here are some example prompts you can use to explore APIs and build features.
Explore the API
List all APIsShow me APIs related to postsList APIs under the Post tagShow me the API details for post commentsShow me the API details for GET /posts/{id}/commentsShow me the API details for postCommentsBuild a feature
Implement the post comments feature
Post page: src/pages/posts/[id].tsx
Related APIs:
- GET /posts/{id}/comments (list post comments)
- POST /posts/{id}/comments (create a post comment)When writing a prompt to build a feature, include relevant context: page paths, component locations, related APIs, and any patterns or examples to follow.
AI Agent Guidance
Add the following to your project's AGENTS.md to help AI agents use apifable more effectively:
## API Integration
- **Apifable-first:** MUST use Apifable MCP tools to obtain OpenAPI metadata, endpoint details and TypeScript types; MUST NOT read `openapi.yaml` directly.The above is a recommended starting point. Feel free to adjust the prompt as needed.
MCP Tools Reference
get_spec_info
Returns the API title, version, description, servers, and all tags with their endpoint counts. Start here to understand the shape of an unfamiliar spec.
list_endpoints_by_tag
Inputs:
tag(string): The tag name to filter bylimit(number, optional): Max endpoints to returnoffset(number, optional): Number of endpoints to skip (default: 0)
Returns all endpoints belonging to the given tag. The response includes total, offset, and hasMore fields for pagination. Includes a warning when results exceed 30 items and no limit is specified.
search_endpoints
Inputs:
query(string): Keyword to search fortag(string, optional): Restrict search to a specific taglimit(number, optional): Max results to return (default: 10)
Keyword search across operationId, path, summary, and description. Results are ranked by relevance. If no exact matches are found, automatically falls back to fuzzy search. The response includes a matchType field ("exact" or "fuzzy"); fuzzy results also include a score field per result.
get_endpoint
Inputs (choose one):
method(string) +path(string): HTTP method and endpoint path (e.g.get+/users/{id})operationId(string): Operation ID (e.g.listUsers)
Returns the full endpoint object, including parameters, requestBody, and responses, with supported internal component $refs resolved inline.
search_schemas
Inputs:
query(string): Keyword to search forlimit(number, optional): Max results to return (default: 10)
Keyword search across schema name and description. Results are ranked by relevance. If no exact matches are found, automatically falls back to fuzzy search. The response includes a matchType field ("exact" or "fuzzy"); fuzzy results also include a score field per result. Empty results may also include a message field with guidance for the next step.
get_schema
Inputs:
name(string): Schema name fromcomponents/schemas
Returns the full schema with supported internal component $refs resolved.
get_types
Inputs (choose one mode):
schemas(string[]): Array of schema names fromcomponents/schemasmethod(string) +path(string): HTTP method and endpoint pathoperationId(string): Operation ID (e.g.listUsers)
Generates self-contained TypeScript declarations as code text. In endpoint mode it follows supported internal component $refs before collecting schema dependencies. It automatically includes transitive dependencies and does not include import statements.
Mode rules:
Use exactly one mode per call:
schemas,method+path, oroperationIdDo not mix modes in the same call
Limitations
External
$refs (e.g. references to other files or URLs) are not supported.OpenAPI 2.0 (Swagger) is not supported. Only OpenAPI 3.0 and 3.1 specs are supported.
Sponsor
If you think this package has helped you, please consider Becoming a sponsor to support my work~ and your avatar will be visible on my major projects.
Credits
@reapi/mcp-openapi — for the initial inspiration
License
Star History
Available Tools
7 toolsget_endpointA
Get full details of a specific endpoint including parameters, request body, responses, and security requirements. Supported internal component $refs are resolved inline. Provide either "method" + "path" or "operationId". Use get_types to get TypeScript type declarations for the endpoint.
Inputs: path, method, operationId.
get_schemaA
Get a specific schema from components/schemas by name. Supported internal component $refs are resolved inline. Use get_types to convert schemas to TypeScript type declarations.
Inputs: name (required).
get_spec_infoA
Get general information about the OpenAPI spec: title, version, description, servers, security schemes, and available tags with endpoint counts. Start here to understand an unfamiliar API. Then use list_endpoints_by_tag or search_endpoints to explore specific areas.
Inputs: no named parameters.
get_typesA
Generate self-contained TypeScript type declarations for specified schemas or for all schemas used by a specific endpoint. Endpoint mode follows supported internal component $refs before collecting schema dependencies. Provide exactly one of: "schemas" (array of schema names), "method" + "path" (endpoint), or "operationId". Transitive dependencies are included automatically.
Inputs: path, method, schemas, operationId.
list_endpoints_by_tagA
List all endpoints belonging to a specific tag. Use get_spec_info first to see available tags. Supports pagination via limit and offset. Then use get_endpoint to inspect a specific endpoint in detail.
Inputs: tag (required), limit, offset.
search_endpointsA
Search endpoints by keyword across operationId, path, summary, and description. Results are ranked by relevance. If no exact matches are found, automatically falls back to fuzzy search. The response includes a matchType field ("exact" or "fuzzy"); fuzzy results also include a score field per result. After finding the target endpoint, use get_endpoint for full details or get_types for TypeScript types.
Inputs: query (required), tag, limit.
search_schemasA
Search schemas by keyword across schema name and description. Results are ranked by relevance. If no exact matches are found, automatically falls back to fuzzy search. Empty results may include a guidance message suggesting next steps. Use get_schema to inspect a specific schema in detail.
Inputs: query (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct action: spec overview, endpoint search/list/detail, schema search/detail, and TypeScript generation. No two tools overlap in purpose, and cross-references between them make selection clear.
All tools use a consistent lowercase snake_case verb_noun pattern: get_, search_, and list_. Even the longer list_endpoints_by_tag follows the same predictable convention.
Seven tools is well-scoped for an OpenAPI exploration and type-generation server. Each tool fills a distinct role without redundancy or bloat.
The surface covers the core exploration workflow well: discover spec info, find endpoints/schemas, inspect details, and generate TypeScript types. Minor gaps exist such as no way to list all schemas or all endpoints globally, but these are workable through tags and search.
Maintenance
Related MCP Connectors
MCP server for AI access to Swagger by SmartBear.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that loads multiple OpenAPI specifications and exposes them to LLM-powered IDE integrations, enabling AI to understand and work with your APIs directly in development tools like Cursor.790MIT
- AlicenseAqualityDmaintenanceAn MCP server that provides tools for exploring large OpenAPI schemas without loading entire schemas into LLM context. Perfect for discovering and analyzing endpoints, data models, and API structure efficiently.914MIT
- AlicenseBqualityDmaintenanceMCP server that enables AI assistants to explore and generate code for type-safe OpenAPI clients from various cloud APIs like DigitalOcean, Hetzner Cloud, and Ory.714 npm19MIT
- AlicenseAqualityDmaintenanceA TypeScript-based MCP server that integrates with Swagger/OpenAPI specifications to expose API endpoints as tools for Large Language Models (LLMs), enabling natural language interaction with any OpenAPI-compliant API.49MIT