Apifox MCP Server
Lets Cursor or Cline read your Apifox project's API docs, or any OpenAPI file, so the AI writes code that matches your real endpoints.
This is Apifox's own server for giving your AI coding assistant your API docs. It runs on your computer, downloads the docs for one Apifox project, and lets the AI read them when it writes models, request code or comments. It only reads docs and keeps a local copy, so ask the AI to refresh after you change the API in Apifox. Apifox still calls it a beta, and users report that very large or multi-module projects are not read in full.
Good for
- Developers who keep their API design in Apifox and code in Cursor or VS Code with Cline
- Front-end teams generating request types and models from the backend's API docs
- Anyone with a Swagger or OpenAPI file who wants the AI to read it directly
- Teams on a self-hosted Apifox server
Works in
1 supported · 1 with issues · 9 should work
Tap an app to see how to set it up and any known problems.
Apifox's README covers it: open the Cline panel, choose MCP Servers, then Configure and paste the entry. GitHub
Apifox's README covers it: add the entry to ~/.cursor/mcp.json or .cursor/mcp.json with your token and project ID.
Known problems
- Open
Log output from the server can make Cursor report invalid JSON
Since May 2025 · GitHub
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Not in Apifox's docs. Users said it failed to start in Codex, and the thread was closed with no fix posted.
Known problems
- Closed
Fails to start in Codex with a setup that works in Claude Code and Cursor
Reported Nov 2025 · GitHub
Client does not support this transport.
Client does not support this transport.
Install Apifox MCP
Claude Code
- 1
Copy this prompt.
Add the Apifox MCP server to Claude Code. Run this command: claude mcp add apifox-api-docs -e APIFOX_ACCESS_TOKEN=<APIFOX_ACCESS_TOKEN> -- npx -y apifox-mcp-server@latest --project-id=<project-id> Ask me for APIFOX_ACCESS_TOKEN and only put the values in that config, nowhere else. Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js 18 or newer, Apifox access token and project ID.
Read-only mode: It only reads your API docs, so there is nothing to turn off.
Replace <project-id> with the ID from Project settings > Basic settings in Apifox. For a Swagger or OpenAPI file, swap --project-id=<project-id> for --oas=<url-or-path> and drop the token. Self-hosted Apifox: add --apifox-api-base-url=<your server API address>. For several projects, add one entry per project. On Windows, if npx does not start, run it through cmd /c npx.
Built from the package data we hold. Not yet tested by us.
Tools
Reads your project's API docs
Reads the OpenAPI spec of your Apifox project or OpenAPI file, so the AI knows your endpoints, parameters and response shapes. The name gets a project suffix when you connect more than one project.
Try: “Read the API docs and generate TypeScript types for the /users endpoints”
Network ·
read_project_oasDownloads the latest API docs again
Throws away the local copy and downloads the latest API docs, so the AI sees changes you made in Apifox.
Try: “Refresh the API docs, I just added new fields in Apifox”
Network ·
refresh_project_oasUsed by the assistant behind the scenes
Opens the linked parts of the API docs, such as shared models
Reads the parts of the spec that other sections point to, such as shared data models or individual endpoint files, several at a time.
Try: “Show me the full Product model the order endpoints use”
Network ·
read_project_oas_ref_resources
Read from the source code
Pros and cons
Good
- Official server from Apifox.
- Read-only, so it cannot change your API project.
- Works with an Apifox project, published docs or a plain OpenAPI file.
- Supports self-hosted Apifox servers.
- Keeps a local copy of the docs, so it does not download them for every question.
Watch out
- Still labelled beta by Apifox.
- Users report large projects being cut off and only the first module showing.
- Endpoints inside folders can be missing.
- Tool names can change on each start when reading an OpenAPI file.
- Does not work behind some corporate proxies.
- Cannot push changes back to Apifox.
Permissions
low risk · 3 things to watch
Low risk
It only reads your API docs, so the main risk is your Apifox token leaking from a shared config file. Keep the token in an environment variable on your own machine.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only modeHow to turn it on
Watch out for
Your access token can leak through shared config
Apifox advises setting the token as an environment variable on each machine instead of committing it in a shared MCP config file. github.com
Your full API docs go to your AI provider
The AI reads the project's whole spec, including internal endpoints. Only connect projects you are happy to share with your AI provider. docs.apifox.com
The current code is not on GitHub
npm has releases up to October 2026, but the public repo was last updated in March 2025. You cannot review the code you run. registry.npmjs.org
Security advisories
No published security advisories as of Nov 1, 2026.
Technical details
| Turning on read-only | The server only reads and refreshes API docs; it has no tools that change your Apifox project. |
|---|---|
| Talks to | Apifox API (or your self-hosted Apifox server). Any OpenAPI URL you give it |
| Sign-in and keys | Your Apifox access token sits in the MCP config or an environment variable on your computer. |
| Scopes |
|
Alternatives
Use Apifox's own server unless your project is too big for it. A community server that fetches only the endpoints you ask for is the pick for large or multi-module projects.
| Server | Official | Runs | Sign-in | Tools | Weekly downloads |
|---|---|---|---|---|---|
| For Apifox | |||||
| Apifox MCP ServerThis page | Official | Local | Access token | 3 | 1.8K/wk |
| Other tools for the same job | |||||
| apifox-filter-mcp-server | Community | Local | Access token | – | 45/wk |
What people say
People like having the AI read their real API docs, and complain that big projects are read only in part.
What people like
- Gives the AI your real API definitions when it writes models and request code
- Same setup works in Claude Code and Cursor
Common complaints
- Large projects are cut off or read only in part
- Only the first module of a multi-module project shows up
- Endpoints in folders are missed
- Tool names change between restarts when reading an OpenAPI file
- Fails to start in Codex
- Breaks behind corporate HTTP proxies
In their words
“接口文档太大了吧,这个mcp很难用,我本来想用来自动化生成前端接口类型,结果读取接口这一步都一堆问题,经常读不全或读错”chen-ziwenGitHub issueNov 2025
“同样的配置和ak在 claude code , cursor下都正常,只有codex内无法初始化,codex内其他mcp工具都正常。”TivonJJGitHub issueMar 2026
“In an internal network environment with a Squid proxy, it cannot connect through the proxy and will throw errors, which causes apifox-mcp-server to be unusable in a Squid proxy network environment.”Ronald-Huang-CS
Questions
Do I need an Apifox account?
Only to read docs from an Apifox project, which needs a personal access token. Published docs and OpenAPI files work without one.
Why does the AI see old API docs?
The server keeps a local copy. Ask the AI to refresh the API docs after you change them in Apifox.
Can it change or sync my API docs in Apifox?
No. It only reads and refreshes docs, so it cannot edit your project.
Why are some endpoints missing?
Users report large projects being cut off, only the first module showing, and endpoints inside folders missing. These reports are still open on GitHub.
Why do I get a 401 or permission error?
Check your access token first. One user fixed it by making sure their account had at least Editor access to the project.
Can I use it with a Swagger or OpenAPI file?
Yes. Give it a local path or URL instead of a project ID, and no Apifox account is needed.
How do I use several Apifox projects?
Add one server entry per project, each with its own project ID. Apifox suggests a name like "API docs" rather than "Apifox" so the AI knows what it is for.
Does it work with self-hosted Apifox?
Yes. Add your server's API address with the base URL option shown in the install box.
Does it work in Codex or Claude Code?
Apifox only documents Cursor and Cline. Users say the same setup works in Claude Code but fails to start in Codex.
Examples
Generate model code from the API docs
Get the API docs through MCP, then generate the Product model and related model definitions
SourceAdd newly documented fields to a DTO
Based on the API docs, add the new fields to the Product DTO
SourceComment every field from the docs
Based on the API docs, add a comment to every field of the Product class
SourceGenerate all MVC code for one endpoint
Based on the API docs, generate all the MVC code for the /users endpoints
Source
Information
updated Nov 1, 2026
- Publisher
- Official
- Package
apifox-mcp-server- Registry
- npm
- Transport
- stdio
- Auth
- token in env
- Version
- 0.0.18
- License
- ISC
- Last commit
- Mar 26, 2025
Other Apifox MCP servers
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 13Hide
- apifox/apifox-mcp-server · github.com
- Apifox MCP Server · docs.apifox.com
- 项目中多个模块,只能查找到第一个模块的接口 · github.com
- 为什么接口总是被截取? · github.com
- apifox-mcp-server on npm · registry.npmjs.org
- 在codex中使用报错,无法初始化成功! · github.com
- 同步接口 · github.com
- 服务打印了日志导致cursor报错非法json · github.com
- mcp只能请求到根目录到接口 · github.com
- 每次加载MCP服务都会随机重置Tool名字 · github.com
- Squid proxy error · github.com
- npm weekly downloads · api.npmjs.org
- apifox-filter-mcp-server on npm · registry.npmjs.org