Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
You run one by typing its /name in Claude Code.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
从 Apifox 自动生成 API 客户端代码的 Claude Code 插件。支持多语言、智能推荐、项目级配置。
首先设置 APIFOX_ACCESS_TOKEN 环境变量:
# 1. 获取 Token
# 访问 https://app.apifox.com/ → 账号设置 → API 访问令牌
# 2. 永久生效(添加到 shell 配置文件)
echo 'export APIFOX_ACCESS_TOKEN="APS-xxxxxxxxxxxxxxxx"' >> ~/.zshrc
source ~/.zshrc
# 💡 Bash 用户请将 ~/.zshrc 替换为 ~/.bashrc
配置环境变量后,完全退出并重启 Claude Code 以加载配置。
在你的项目根目录运行:
/apifox-init
这会创建以下配置文件:
.mcp.json - MCP Server 配置(包含 Project ID)apifox.config.json - API 配置文件/apifox-generate game-api
完成!代码已生成到 src/api/game 目录。
| 命令 | 说明 | 示例 |
|---|---|---|
/apifox-init | 初始化项目配置 | /apifox-init |
/apifox-generate | 生成新的 API 客户端 | /apifox-generate game-api |
/apifox-update | 更新已有的 API 客户端 | /apifox-update game-api |
/apifox-list | 列出所有已配置的 API | /apifox-list |
https://app.apifox.com/project/{PROJECT_ID}/...https://app.apifox.com/project/5384026/apis → ID 是 5384026/apifox-init 时输入此 ID使用 shell 环境变量配置 Access Token:
# macOS / Linux
echo 'export APIFOX_ACCESS_TOKEN="APS-xxxxxxxxxxxxxxxx"' >> ~/.zshrc
source ~/.zshrc
# Windows (PowerShell 管理员)
[System.Environment]::SetEnvironmentVariable('APIFOX_ACCESS_TOKEN', 'APS-xxxxxxxxxxxxxxxx', 'User')
优势:
Project ID 配置:
/apifox-init 写入 .mcp.json 文件.mcp.json 可以提交到 Git,团队共享| 生成器 | 语言 | 说明 |
|---|---|---|
typescript-axios | TypeScript | Axios HTTP 客户端(推荐) |
typescript-fetch | TypeScript | 原生 Fetch API |
typescript-node | TypeScript | Node.js 客户端 |
java | Java | Java 客户端 |
go | Go | Go 客户端 |
python | Python | Python 客户端 |
kotlin | Kotlin | Kotlin 客户端 |
swift | Swift | Swift 客户端 |
初始化后的项目结构:
my-project/
├── .mcp.json # MCP Server 配置(提交 Git,包含 Project ID)
├── apifox.config.json # API 配置(提交 Git)
└── src/
└── api/
├── game/ # 生成的 game-api 客户端
└── user/ # 生成的 user-api 客户端
错误: 401 Unauthorized
解决:
APIFOX_ACCESS_TOKEN 是否正确设置错误: Project not found
解决:
.mcp.json 中的 Project ID 是否正确(纯数字)/apifox-init错误: APIFOX_ACCESS_TOKEN is not set
解决:
echo $APIFOX_ACCESS_TOKENsource ~/.zshrc错误: Cannot connect to the Docker daemon
解决:
# macOS
open -a Docker
# 验证
docker ps
提交到 Git:
.mcp.json - MCP 配置(包含 Project ID)apifox.config.json - API 配置不要提交:
# 1. 克隆仓库
git clone <repo-url>
cd <project>
# 2. 配置环境变量(一次性设置)
# 获取 Token: https://app.apifox.com/ → 账号设置 → API 访问令牌
echo 'export APIFOX_ACCESS_TOKEN="APS-xxxxx"' >> ~/.zshrc
source ~/.zshrc
# 3. 重启 Claude Code
# 4. 验证配置
/apifox-list
# 5. 开始工作
/apifox-generate
MIT
Generated from the plugin's indexed repository (lcpmarvel/apifox-generator-plugin) — no native marketplace selected
npx claudepluginhub p/lcpmarvel-apifox-generatorBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground