Import an API Spec
APIFold converts OpenAPI specifications into MCP tool definitions. This page covers the import process in detail.
Supported Formats
| Format | Versions | File Types |
|---|---|---|
| OpenAPI | 3.0.x, 3.1.x | .json, .yaml, .yml |
| Swagger | 2.0 | .json, .yaml, .yml |
Import Methods
Import via URL
Provide a publicly accessible URL pointing to your raw spec file. APIFold will:
- Fetch the spec over HTTPS
- Validate the format and version
- Parse all operations (paths + methods)
- Generate MCP tool definitions
URLs must use http:// or https:// protocols. Private network URLs are blocked for security.
Upload File
Upload your spec file directly from your computer. Drag and drop into the upload zone, or click to browse.
Limits:
- Maximum file size: 10MB
- Accepted extensions:
.json,.yaml,.yml
What Happens During Import
- Parsing — The spec is validated against the OpenAPI/Swagger schema
- Operation Extraction — Each path + method combination becomes a tool
- Tool Naming — Tools are named using
operationIdif available, otherwise generated from the path - Schema Mapping — Request parameters and body schemas become the tool's
inputSchema - Storage — The raw spec and generated tools are saved to your account
Reviewing Generated Tools
After import, you'll see a preview table with:
- HTTP method and path
- Generated tool name
- Operation summary (if provided in the spec)
Review the tools before confirming the import. You can enable or disable individual tools later from the server's Tools page.
Troubleshooting
Import fails with "Invalid spec"
- Ensure your file is valid JSON or YAML
- Check that the spec declares a supported version (
openapi: "3.0.0"orswagger: "2.0")
Missing operations
- Verify your spec has paths defined under the
pathskey - Only
GET,POST,PUT,PATCH, andDELETEmethods are extracted
Circular references
- APIFold resolves
$refreferences automatically - Deeply nested circular schemas may be truncated to prevent infinite recursion