基本能力
产品定位
ActivityWatch MCP Server 是一个模型上下文协议(MCP)服务器,用于连接 ActivityWatch 时间追踪工具,使像 Claude 这样的 LLM 能够与用户的时间追踪数据进行交互。
核心功能
- List Buckets: 查看所有可用的 ActivityWatch 存储桶
- Run Queries: 执行强大的 AQL(ActivityWatch 查询语言)查询
- Get Raw Events: 直接从任何存储桶中检索事件
- Get Settings: 访问 ActivityWatch 配置设置
适用场景
- 查看应用程序使用情况
- 分析浏览历史
- 检查生产力
- 访问和修改 ActivityWatch 设置
工具列表
- list-buckets: 列出所有可用的 ActivityWatch 存储桶,支持按类型过滤。
- run-query: 运行 ActivityWatch 查询语言(AQL)查询。
- get-events: 从 ActivityWatch 存储桶中获取原始事件。
- get-settings: 获取 ActivityWatch 服务器设置。
常见问题解答
- ActivityWatch 未运行: 确保 ActivityWatch 正在运行并可访问 http://localhost:5600。
- 查询错误: 检查查询语法、存储桶 ID 和时间段是否正确。
- Claude/MCP 查询格式问题: 确保查询遵循正确的格式,所有查询语句应在一个字符串中。
使用教程
使用依赖
- ActivityWatch 已安装并运行
- Node.js(v14 或更高版本)
- Claude for Desktop(或任何其他 MCP 客户端)
安装教程
从 npm 安装(即将推出)
```bash
全局安装
npm install -g activitywatch-mcp-server
或本地安装
npm install activitywatch-mcp-server
```
从源代码构建
-
克隆仓库:
bash
git clone https://github.com/8bitgentleman/activitywatch-mcp-server.git
cd activitywatch-mcp-server -
安装依赖:
bash
npm install -
构建项目:
bash
npm run build
调试方式
- 打开 Claude for Desktop 配置文件:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
-
macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
-
添加 MCP 服务器配置:
json
{
"mcpServers": {
"activitywatch": {
"command": "activitywatch-mcp-server",
"args": []
}
}
}
如果从源代码构建,使用:
json
{
"mcpServers": {
"activitywatch": {
"command": "node",
"args": ["/path/to/activitywatch-mcp-server/dist/index.js"]
}
}
}
- 重启 Claude for Desktop
- 在 Claude 界面中查找 MCP 图标以确认其正常工作