apifox-import-mcp
Imports OpenAPI YAML/JSON documents into an Apifox project, creating or updating APIs and folders, with configurable overwrite modes and optional deletion of unmatched resources.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
apifox-import-mcp
A Model Context Protocol (MCP) server for importing OpenAPI documents to Apifox.
Features
Import OpenAPI to Apifox: Directly import OpenAPI YAML/JSON files to your Apifox project
Validate OpenAPI Files: Validate and extract statistics from OpenAPI documents
Easy Configuration: Configure via environment variables in
.mcp.jsonAsync Operations: Built with async/await for optimal performance
Error Handling: Comprehensive error messages for troubleshooting
Related MCP server: APIMatic Validator MCP Server
Installation
Using uvx (Recommended)
uvx apifox-import-mcpUsing pip
pip install apifox-import-mcpFrom Source
git clone https://github.com/hexonal/apifox-import-mcp.git
cd apifox-import-mcp
pip install -e .Configuration
Add to your .mcp.json:
{
"mcpServers": {
"apifox-import": {
"command": "uvx",
"args": ["apifox-import-mcp"],
"env": {
"APIFOX_PROJECT_ID": "your-project-id",
"APIFOX_ACCESS_TOKEN": "your-access-token"
}
}
}
}Environment Variables
Variable | Required | Description | Default |
| Yes | Apifox project ID | - |
| Yes | Apifox access token | - |
| No | API base URL |
|
Tools
import_openapi
Import OpenAPI document to Apifox project.
Parameters:
file_path(required): Absolute path to OpenAPI YAML/JSON filedelete_unmatched(optional): Whether to delete unmatched resources (default:true)api_overwrite_mode(optional): API overwrite mode (default:"methodAndPath")Options:
"methodAndPath","ignore","all"
schema_overwrite_mode(optional): Schema overwrite mode (default:"title")Options:
"title","ignore","all"
Returns:
{
"status": "success",
"data": {
"api": {
"created": 5,
"updated": 2,
"errors": 0,
"ignored": 0
},
"folder": {
"created": 3,
"updated": 1
}
}
}Example Usage:
User: Import the OpenAPI file at /path/to/openapi.yaml to Apifox
Claude: Calling import_openapi tool...validate_openapi
Validate OpenAPI file and extract statistics.
Parameters:
file_path(required): Absolute path to OpenAPI YAML/JSON file
Returns:
{
"status": "success",
"data": {
"file": "/path/to/openapi.yaml",
"size": "25.3 KB",
"format": "YAML",
"version": "3.0.3",
"endpoints": 5,
"schemas": 12,
"tags": ["Tag1", "Tag2"]
}
}Example Usage:
User: Validate the OpenAPI file at /path/to/openapi.yaml
Claude: Calling validate_openapi tool...Troubleshooting
Error: "APIFOX_PROJECT_ID not set"
Make sure your .mcp.json includes the APIFOX_PROJECT_ID environment variable.
Error: "File not found: /path/to/file.yaml"
Verify the file path is correct and the file exists. Use absolute paths, not relative paths.
Error: "Invalid OpenAPI format"
Ensure your file is valid YAML or JSON and conforms to the OpenAPI specification.
Error: "HTTP 401: Invalid access token"
Check that your APIFOX_ACCESS_TOKEN is correct and has not expired.
Error: "HTTP 404: Project not found"
Verify your APIFOX_PROJECT_ID is correct.
Development
Setup
git clone https://github.com/hexonal/apifox-import-mcp.git
cd apifox-import-mcp
pip install -e ".[dev]"Run Tests
pytest tests/ -vCode Formatting
black .
isort .Type Checking
mypy apifox_import_mcp/License
MIT License - see LICENSE for details.
Contributing
Contributions are welcome! Please open an issue or pull request on GitHub.
Links
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Validate OpenAPI and JSON Schema, convert specs, curl to code, JSONPath, and free test data.
Detect breaking changes, generate changelogs, diff, and validate OpenAPI specs.
Scores how well AI agents will use your API, 0-100, from its OpenAPI spec. Free and read-only.
Validate oh-my-posh configurations and segment snippets against the official schema.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to automatically manage Apifox API documentation by importing OpenAPI/Swagger specifications and exporting existing API structures. Supports batch operations, intelligent deprecation marking, and smart scope detection for partial module imports.23MIT
- AlicenseBqualityDmaintenanceEnables validation of OpenAPI 2.0 and 3.0 specifications in JSON or YAML format using APIMatic's comprehensive API validation service through the Model Context Protocol.17ISC
- FlicenseNot gradedqualityDmaintenanceEnables users to import OpenAPI 3 and Swagger 2 formatted JSON data directly into Apifox projects. It provides a tool for automating API documentation management and synchronization through Model Context Protocol clients.-
- AlicenseNot gradedqualityCmaintenanceEnables LLMs to manage Apifox API projects, including listing, creating, updating, and deleting API endpoints and schemas via natural language.31MIT