apifox
基于MCP协议的获取ApiFox接口信息的服务
claude mcp add --transport stdio wangmhaha-apifox-mcp-server npx -y @wangmhaha/apifox-mcp-server@latest --local \ --env PROJECT_ID="<your-project-id>" \ --env APIFOX_API_KEY="<your-apifox-api-key>"
How to use
This MCP server provides an ApiFox interface provider that exposes ApiFox project data through the MCP (Model Context Protocol) interface. It runs as an HTTP service and can also be invoked via a CLI entry point using npx. The server authenticates with ApiFox using an API key and project ID, fetches interface definitions from ApiFox, and serves them to the cursor or large language model (LLM) through the configured MCP channel. It supports local development with a --local flag and can emit data over SSE for real-time updates. When configured in Cursor, you can point to the server’s SSE endpoint to enable dynamic interface retrieval and guidance for implementing business logic against ApiFox APIs.
How to install
Prerequisites:
- Node.js (recommended LTS) and npm/yarn/pnpm
- Basic familiarity with MCP configuration in Cursor
- Install the MCP server via npx (recommended for quick start):
npx @wangmhaha/apifox-mcp-server@latest --apifox-api-key=<your-apifox-api-key> --project=<your-project-id>
- Alternative local run (build from source):
# Clone or install from npm if you have the package locally
# Install dependencies
pnpm install
# Build the project
pnpm build
# Start the HTTP server (example)
pnpm start:http
- If you prefer using in Cursor configuration, create the MCP entry:
"apifox-mcp-server": {
"command": "npx",
"args": ["-y", "@wangmhaha/apifox-mcp-server@latest", "--local"],
"env": {
"APIFOX_API_KEY": "<your-apifox-api-key>",
"PROJECT_ID": "<your-project-id>"
}
}
- Verify the server is running on the default port (3000) or the port you configured. Access the SSE endpoint at http://localhost:3000/sse.
Additional notes
Tips and common considerations:
- Environment variables APIFOX_API_KEY and PROJECT_ID are required for ApiFox authentication; you can also place them in a .env file in the project root.
- The default port is 3000 unless overridden by PORT in your environment.
- If using the local build, you can run the server with the command mode by pointing to the built index.js, e.g., node ./build/index.js --local.
- Cursor integrations usually connect via SSE at /sse; ensure the URL in your Cursor config matches this endpoint.
- The npm package name to install/upate is @wangmhaha/apifox-mcp-server; you can pin a specific version if needed.
- When using MCP via npx, the server prints prompts or logs to help you confirm connectivity and data retrieval from ApiFox.
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud