eatingDream ClamGuard

macOS Clamshell & Thermal GuardmacOS 合盖与温控护卫 · macOS · Apple Silicon & IntelmacOS · Apple Silicon / Intel

ClamGuard

eatingDream-antigravity-plugins/mac-clamshell-mcp

Keep your closed MacBook cool, quiet, and predictable during heavy builds and autonomous agent runs.让合盖运行的 MacBook 在重负载编译与 Agent 长跑期间保持低温、安静且完全可控。

A native Rust macOS MCP server, SEP-1865 live dashboard, and CLI wrapper that monitors lid state, power source, and thermal pressure to throttle heavy builds and guard closed-lid displays.原生 Rust 编写的 macOS MCP 服务、SEP-1865 实时面板与 CLI 包装器:感知合盖、供电与热压力,自动节流重型构建并守护合盖屏幕状态。 Not a fan-curve writer, kernel extension, or global pmset modifier—it never asks for sudo and leaves dedicated fan managers untouched.不是风扇曲线写入器、内核扩展或全局 pmset 篡改工具——全程无需 sudo,绝不干扰第三方风扇管理软件。

Zero sudo免 sudo
Privileges权限要求
Read-Only只读遥测
SMC ModeSMC 策略
4 Profiles四档策略
Throttle Tiers节流档位
Offline纯离线
Network网络外联
CLAMGUARD · APPLESMC READ-ONLYCLAMGUARD · APPLESMC 只读遥测 UTILITY · 4 JOBS实用档 · 4 并发
Nominal温控正常 thermal pressure热压力状态 nice 10 · ACnice 10 · 交流电
Lid State合盖状态
Closed · Dock合盖 · 外接
Fan Telemetry风扇转速
2,140 RPM
Wake Target唤醒亮度
68% queued68% 待恢复
External Display外接显示器preserved · no sleep保持常亮 · 零误休眠
Macs Fan Controldetected · yielding已检测 · 自动礼让
SMC WritesSMC 写入次数0 · zero sudo0 次 · 免 sudo

01 · QUICK START01 · 快速启用

Install in one line, or hand to your agent.一行命令安装,或直接交由 Agent 接管

Copy the verified installer or attach the portable skill to Antigravity, Claude Code, Codex, or Cursor.一键复制经校验的安装脚本,或为 Antigravity、Claude Code、Codex、Cursor 挂载可移植技能。

Install Plugin & Native Binary安装插件与原生二进制 mac-clamshell-mcp
$curl -fsSL https://raw.githubusercontent.com/eatingDream-antigravity-plugins/mac-clamshell-mcp/main/scripts/install.sh | sh

Reload Antigravity after installing to open the side panel, or inspect verified releases on GitHub.安装完成后重载 Antigravity 即可在侧边栏启用,也可在 GitHub Releases 手动校验包体。

Add Portable Agent Skill加载便携 Agent Skill agentskills.io
$npx skills add eatingDream-antigravity-plugins/mac-clamshell-mcp

Full MCP tool schemas, flags, and operational rules live in docs/ai-guide.md and llms.txt.完整 MCP 工具定义、配置项与操作规程均收录于 docs/ai-guide.md 与 llms.txt。

02 · CAPABILITIES02 · 核心能力

Precision controls without hidden side effects.精准可控,零隐蔽副作用

External-Display Safe Lid Guard外接显示器安全的合盖守护

Sleeps the panel cleanly on standalone lid close and restores saved brightness on open. When docked, protects external monitors without triggering displaysleepnow.无外接屏合盖时优雅休眠内屏并在开盖时恢复亮度;外接显示器扩展模式下绝不误触发全局息屏,准确区分内屏离线与系统休眠。

Read-Only AppleSMC & Fan-Manager Yield只读 AppleSMC 与第三方风扇礼让

Reads live fan RPM and SMC mode (auto, manual, unknown) with zero SMC writes. Detects Macs Fan Control, TG Pro, and smcFanControl separately from read-only monitors.零 SMC 写入读取实时转速与控制模式,准确区分 Macs Fan Control、TG Pro 等控制类应用与纯监控工具,从不抢夺风扇控制权。

Adaptive Build Throttling自适应重负载构建节流

Wraps cargo, make, or test commands with CPU QoS (taskpolicy, nice) and parallel job caps tuned dynamically to lid state, power source, and thermal pressure.依据合盖状态、电源与 macOS 热压力动态调整 CPU QoS(taskpolicy / nice)与并发任务上限,兼顾续航与温控。

Built-In Brightness & Wake-Restore Queue内建屏亮度与合盖唤醒目标队列

Adjusts built-in panel brightness via reversible DisplayServices user-space APIs—or safely queues your wake-restore target while closed without touching a sleeping panel.通过可逆用户态 DisplayServices API 调节内建屏亮度;合盖时自动排队记录唤醒目标亮度,严禁向已休眠面板硬写入。

Session-Verified Screen Lock会话状态核验的安全锁屏

Locks via SACLockScreenImmediate without sleeping background agent tasks, polls CGSSessionScreenIsLocked, and explicitly distinguishes verified vs submitted.优先调用 SACLockScreenImmediate 在不中断后台任务的前提下即时锁屏,并轮询 CGSSessionScreenIsLocked 核验真实锁定结果。

Silent When Open & Cool开盖凉爽时保持静默零打扰

Emits zero hook output under normal open-lid thermals; surfaces gentle wrap hints only when closed or thermally constrained, with an optional 24/7 LaunchAgent.开盖且温度正常时零 Hook 噪音;仅在合盖或热压力上升时提醒 Agent 自动套用节流包装,可选安装 24/7 LaunchAgent。

03 · OPERATIONAL MATRIX03 · 运行机制对照

Dynamic Thermal & Clamshell Throttle Profiles动态温控与合盖节流档位

Profile节流档位 Trigger Condition触发条件 QoS & Concurrency Cap调度优先级与并发上限
NormalNormal(常规) Lid open & nominal thermal pressure开盖且温度正常 Full speed — zero throttling全速运行,零限流
UtilityUtility(实用) Lid closed on AC power合盖且连接电源 Utility QoS (nice 10), E-core cap (2–4 jobs)Utility QoS(nice 10),并发限 2–4
EcoEco(节能) Lid closed on battery合盖且使用电池 Background QoS (nice 15), max 2 jobs (1 at <=20%)后台 QoS(nice 15),最多 2 任务(电量 <=20% 限 1)
StrictStrict(严格) Serious or critical thermal pressure严重或临界热压力 Lowest priority (taskpolicy -b, nice 19), 1 job最低优先级(taskpolicy -b / nice 19),单并发

04 · SAFETY & PRIVACY04 · 安全与隐私边界

Hard boundaries enforced in code.由代码硬性守护的信任边界

01

Zero root & zero SMC writes: never requires sudo, never writes SMC/NVRAM/kexts, and stores state in owner-only 0700/0600 files.零 root 与零 SMC 写入:绝不索要 sudo,不修改 SMC/NVRAM/内核扩展,本地状态严格采用 0700/0600 权限。

02

Hardware-confirmed brightness guard: refuses brightness writes unless hardware confirms the lid is open and internal display is awake.硬件确认式亮度守卫:仅当硬件确认已开盖且内屏唤醒时才写入亮度,避免异常状态误操作。

03

Compile-time #[cfg(test)] hardware refusal: unit and integration tests can never lock your screen, sleep displays, or spawn daemons.编译期 #[cfg(test)] 硬件隔离:自动化测试绝不会锁屏、息屏或拉起真实守护进程。

04

Zero outbound network traffic: 100% local Rust binary communicating exclusively over local MCP stdio.零外部网络流量:纯本地原生 Rust 二进制,仅通过本地 MCP stdio 通信。