Repository navigation
[Show and tell] newapi-operator:给自建 New API 的管理 MCP,47 个工具 + 全量接口透传 #8134
Ruanyuxi1337
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
自建 New API 之后,日常运维基本都在点面板:加渠道、测活、发 Key、改额度、查日志。我把它包成了一个 MCP,让 Claude Code、Codex、Cursor 这类客户端可以直接接管这些操作。
项目:https://github.com/Ruanyuxi1337/newapi-operator
它能做什么
api_endpoints+api_request透传其余全部管理接口(当前v1.0.0-rc.47是 312 条),没有封装不到的角落;router/*.go生成,每周跟 release 对一次,上游加删接口时不会悄悄落后;/api/*路径白名单、错误信息凭据脱敏;实现时踩过的六个坑
HTTP 200+{"success": false}。只看状态码会把所有报错当成功。{"mode": "single", "channel": {...}},平铺 body 会被拒。PUT /api/channel,id 放在 body 里;PUT /api/channel/:id是 404。models、model_mapping是逗号分隔字符串,不是数组。base_url不能带/v1,否则请求会打到/v1/v1/chat/completions。安装
也可以直接下载 release 里的 Linux/macOS/Windows 二进制。中文 README:
https://github.com/Ruanyuxi1337/newapi-operator/blob/main/README.zh-CN.md
如果你也在跑 New API,欢迎试试。尤其是渠道池比较大、或者多租户的场景,哪些运维动作现在还需要点面板、用起来别扭,直接回帖告诉我,我加工具。
All reactions