Repository navigation
MCP 技能支持 OAuth 授权,由节点上的 CLI 完成登录 - #131
Merged
Merged
Conversation
Figma 官方 MCP 等远程服务只认 OAuth,且只放行登记过的客户端(Codex、Claude Code), CoreMan 自己注册会被拒。改为让员工所在实例的 CLI 登录,令牌留在 CLI 的凭据存储: - skills.mcp_oauth 标记需要 OAuth 的远程 MCP;仓库同步时无请求头的远程服务自动标记 - 标记的技能按员工命名写入 .mcp.json(<技能名>-<员工 ID 前 8 位>),同节点员工各自授权 - 节点新增 mcp-login-start / complete / logout:pty 里运行 mcp login --no-browser, 取回授权链接;回调地址校验主机、端口、路径和 state 后送到 CLI 的回环端口 - 员工技能列表显示授权状态,授权对话框引导打开链接、粘贴回调地址;换实例需重新授权 - 迁移 0063 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
有的远程 MCP 服务只能 OAuth 登录,例如 Figma 官方 MCP(
https://mcp.figma.com/mcp)。按设计稿高还原写代码需要它的设计上下文、变量和 Code Connect。实测下来:mcp login --no-browser会打印授权链接,同时在本机回环端口等待回调。在无界面的服务器节点上,把浏览器停住的回调地址交回去,就能完成登录。所以授权交给 AI 员工所在实例上的 CLI 完成,令牌留在 CLI 自己的凭据存储里,CoreMan 不保存令牌。
改动
skills.mcp_oauth(迁移 0063),只能用于 http/sse 服务。技能编辑器加了「需要 OAuth 授权」开关;仓库同步时,没有headers的远程服务自动打上这个标记。<技能名>-<员工 ID 前 8 位>写入.mcp.json,并删掉同名旧条目。这样同一节点上的员工各用各的授权;Codex 下的挂载名是skill_<该名字>。mcp-login-start / mcp-login-complete / mcp-logout,节点通过ping返回mcp_oauth: 1表示支持:claude mcp login不接受未经交互批准的.mcp.json服务。state都要一致。只把查询串送到 CLI 的回环端口,成败看 CLI 的退出码。POST|DELETE /api/admin/bots/{bot}/skills/{skill}/mcp-login,以及POST …/mcp-login/complete,仅限员工创建者和员工管理员调用。授权成功后记录授权人、时间和实例(bot_skills.mcp_authorized_*),并写审计skill.mcp_authorized、skill.mcp_revoked。授权码不进审计。节点版本过旧时,提示先升级。验证
发布
需要迁移 0063。运行时节点要升级。节点升级后,已安装的 OAuth 技能需要点「升级」或重新安装,才会换成按员工命名的服务名。
🤖 Generated with Claude Code