Back to MCP directory
publicPublicdnsLocal runtime

autonome-mcp

一个基于Rust的MCP服务器,通过AppleScript为Claude Desktop提供自主唤醒、心跳和分布式任务执行功能,支持macOS定时调度与状态管理。

article

README

🚀 autonome-mcp

autonome-mcp 是一个基于 Rust 的 MCP 服务器,它使 Claude Desktop 能够在 macOS 系统上进行唤醒、心跳监测以及联合任务执行等操作。

🚀 快速开始

git clone <repo-url>
cd autonome-mcp
cargo build --release

运行服务器

cargo run -- serve

MCP 服务器会通过标准输入输出与 Claude Desktop 进行通信。

初始化调度(macOS)

cargo run -- init --hour 1 --minute 0 --data-dir ~/.local/share/autonomy-mcp

此命令会创建 autonomy.db,安装 launchd 配置文件以实现每日唤醒功能,并启用默认的心跳监测。

手动操作

  • cargo run -- run-wake — 立即发送唤醒消息。
  • cargo run -- run-heartbeat — 若已启用,则发送心跳消息。
  • cargo run -- status — 显示持久化状态和心跳配置。
  • cargo run -- test "MESSAGE" — 用于调试的临时 AppleScript 发送命令。

✨ 主要特性

  • 通过 AppleScript 向 Claude Desktop 发送唤醒和心跳消息。
  • 提供 Launchd 安装程序,可按配置的时间进行定时唤醒和心跳监测。
  • 采用 SQLite 状态存储(WAL),支持优雅的模式升级。
  • 具备联合任务队列,可查看标准输出、标准错误输出和退出信息。

📚 详细文档

项目结构

  • src/ — 核心模块(applescriptfederationlaunchdmcpstatetasksmain.rs)。
  • docs/ — 设计文档(FEDERATION-TOOLS-SPEC.md)。
  • scripts/ — 辅助自动化脚本(例如 WakeClaude.applescriptbuild_trampoline.sh)。
  • target/ — 构建输出目录。

开发相关

  • 代码格式化:cargo fmt
  • 代码检查:cargo clippy -- -D warnings
  • 测试:cargo test
  • 发布构建:cargo build --release

编码风格遵循 Rust 2021 规范,使用 anyhow::Result 处理应用流程,避免在运行时路径中使用 unwrap,并使用 tracing 记录丰富的上下文信息。

🔧 技术细节

数据与安全注意事项

  • 默认数据目录:~/.local/share/autonomy-mcp/autonomy.db。可使用 --data-dir 参数在测试时进行覆盖。
  • Launchd 和 AppleScript 假定系统为安装了 Claude Desktop 的 macOS,请勿在不支持的主机上运行。
  • 避免在日志中记录令牌和个人数据,本项目不会嵌入敏感信息。

🤝 贡献指南

有关贡献者指南(包括结构、命令、风格、测试和 PR 要求),请参阅 AGENTS.md

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client