mycc
Skill28 starsChanged yesterdayMITView on GitHub
启动 mycc 后端服务(后台运行),通过飞书机器人远程操控 Claude Code。触发词:"/mycc"、"启动 mycc"、"启动 mycc 后端"、"检查 mycc 状态
- Reads credentials
- Installs packages
2 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- Aster110/myccedited, first seen Aug 6, 2026
- zjl4616/feishu-claude-codeedited, first seen Mar 13, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- Aster110/mycc★ 16538% same
- zjl4616/feishu-claude-code★ 225% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository3 other files it gives its agents.
- sentinel-minimalSkill
- sentinelSkill
- skill-assistantSkill
The file
Files
mycc
启动和管理 mycc 本地后端。不是 mycc 的开发。
启动 mycc 本地后端,通过飞书机器人(websocket 长连接)远程操控本地 Claude Code。
环境要求
| 要求 | 说明 |
| Claude Code | 必须是官方原版,fork 版本可能不兼容 |
| Node.js | 18+ |
| 飞书 | 一个自建应用(机器人),App ID + App Secret 填入 .env |
| 系统 | ✅ macOS、✅ Linux、✅ Windows |
💡 关于第三方 Claude Code:目前仅测试了官方原版,第三方 fork 版本的兼容性支持在规划中。
触发词
- "/mycc"
- "启动 mycc"
- "启动 mycc 后端"
- "检查 mycc 状态"
执行步骤
1. 安装依赖(首次)
cd .claude/skills/mycc/scripts && npm install && cd -2. 启动后端
.claude/skills/mycc/scripts/node_modules/.bin/tsx .claude/skills/mycc/scripts/src/index.ts start -dstart -d(守护模式)会自动脱离 CC 进程树并把日志追加到 .claude/skills/mycc/mycc.log,关掉 CC 窗口也不会挂。不要用 run_in_background: true,不要手拼 nohup。
其他命令(同一个入口,换子命令即可):
| 命令 | 作用 |
status | 探测 /health,显示运行/配对状态(未运行时退出码 1) |
ps | 列出注册的后端进程(短 id / pid / 端口 / 启动时间) |
stop | 停止所有后端进程(先 SIGTERM 优雅退出,超时 SIGKILL 兜底) |
restart | stop + start -d |
kill <id|pid|序号> | 干掉指定进程(id 用 ps 查看) |
service start | 注册为系统服务并启动(推荐长期使用:开机自启 + 崩溃自动重启) |
service status / stop / uninstall | 服务状态 / 停止 / 移除,详见 service help |
代码会自动检测项目根目录(向上查找
.claude/或claude.md),无需手动指定 cwd。
守护模式(推荐):service start 会把后端注册成 OS 托管服务——macOS 用 launchd(KeepAlive)、Linux 用 systemd 用户级 unit(Restart=always)、Windows 用计划任务 + watchdog 巡检。进程崩溃自动拉起,开机自动启动,无需额外脚本。
3. 读取连接信息
等待几秒后读取:
sleep 5 && cat .claude/skills/mycc/current.json4. 告知用户
展示:
- 飞书通道状态(配置
FEISHU_APP_ID等环境变量后自动启动,websocket 模式无需公网地址) - 不展示 Web URL,不打开浏览器(网页端已移除)
关键说明
- 后台运行:后端会在后台持续运行,不阻塞当前会话
- 自动检测 cwd:会向上查找项目根目录,确保 hooks 能正确加载
- 连接信息:保存在
.claude/skills/mycc/current.json - 停止服务:
.claude/skills/mycc/scripts/node_modules/.bin/tsx .claude/skills/mycc/scripts/src/index.ts stop - Agent Teams 支持:后端已完整支持 Agent Teams(建队、派成员、通信、关队),CLI 2.1.63+ 原生支持,settingSources patch 仍需保留
- 改代码后必须重启:tsx 不热更新,修改
scripts/src/下的代码后必须用restart子命令重启后端,否则跑的还是旧代码。若 AI 自己跑在这个后端里,要用延迟脚本(macOS 没有 setsid,用nohup bash -c 'sleep 5 && <restart 命令>' >> mycc.log 2>&1 & disown),先把回复发完;不要吞错误输出,布置完用ps/日志确认真的执行了
遇到问题?
让 AI 自己解决。 代码都在 scripts/src/ 目录下,AI 可以:
- 读取错误日志
- 检查代码逻辑
- 修复问题并重试
常见问题:
- 端口被占用:跑一次
stop子命令(注册表为空时会按端口兜底清理) - 飞书连不上:检查
.env里FEISHU_APP_ID/FEISHU_APP_SECRET是否正确、文件是否为 Unix 换行符(CRLF 会导致 secret 带\r报 invalid param)
连接信息格式
启动后保存在 .claude/skills/mycc/current.json:
{
"routeToken": "XXXXXX",
"pairCode": "XXXXXX",
"cwd": "/path/to/project",
"startedAt": "2026-01-27T06:00:00.000Z"
}API 端点
| 端点 | 方法 | 说明 |
/{token}/health | GET | 健康检查 |
/{token}/pair | POST | 配对验证 |
/{token}/chat | POST | 发送消息 |
/{token}/history/list | GET | 历史记录列表 |
/{token}/history/{sessionId} | GET | 对话详情 |
/{token}/chat/rename | POST | 会话重命名 |
/{token}/skills/list | GET | Skills 列表 |
/{token}/events | GET | SSE 实时广播 |
/{token}/status | GET | 运行状态快照 |
边界
- 资源预算:启动时间 ≤ 10 秒(含 npm install 首次除外)
- 产出格式:
[mycc] 后端已启动,飞书通道 {N} 个在线
不做的事
- 不修改 mycc 后端代码
- 不推送代码到 GitHub(需用户确认)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

