在 Claude Code 中连接 CompShare MCP
Claude Code 可以直接连接远程 HTTP MCP,并在交互界面中完成 OAuth 登录。
让 Claude Code 自动配置
把下面这段话粘贴给 Claude Code:
Read https://www.compshare.cn/docs/mcp-guide/claude-code and add CompShare MCP at user scope. When browser OAuth is required, pause and ask me to complete it. Then verify the connection and explain what CompShare MCP can do.浏览器中的登录和授权仍需由你本人完成。
手动配置
在终端执行:
claude mcp add --transport http --scope user compshare https://mcp.compshare.cn/mcp--scope user 表示在所有项目中可用。如果只希望当前项目使用,可改为 --scope project。
接着启动 Claude Code:
claude在 Claude Code 中输入:
/mcp选择 compshare,点击或选择认证操作。浏览器打开后,登录 CompShare 并确认授权,再返回 Claude Code。
验证连接
向 Claude Code 发送:
检查我的 CompShare MCP 登录状态,然后列出当前 GPU 实例;不要执行任何写操作。连接成功后,Claude Code 可以看到 compshare_auth_status、compshare_read 和 compshare_execute 三个工具。
整个过程不需要在聊天、命令或配置中填写 CompShare Token。CompShare MCP 服务端使用的 OAuth client_id/client_secret 也不需要发给 Claude Code。
Last updated on