ActivityWatch MCP Server
Connects AI assistants to ActivityWatch for real-time computer activity awareness and time tracking analysis. Enables natural language queries about app usage, browsing history, and productivity patterns through high-level tools without requiring AQL syntax knowledge.
README
<p align="center"> <a href="./README.md">English</a> | <a href="./README_zh.md">中文</a> </p>
<h1 align="center">🔍 ActivityWatch MCP Server</h1>
<p align="center"> <strong>Let your AI companion see what you do, not just what you say.</strong> </p>
<p align="center"> <a href="https://github.com/JM-404/activitywatch-mcp/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a> <img src="https://img.shields.io/badge/Node-%3E%3D20-3C873A" alt="Node >= 20"> <img src="https://img.shields.io/badge/MCP-stdio-f4a261" alt="MCP stdio"> <a href="https://activitywatch.net/"><img src="https://img.shields.io/badge/ActivityWatch-compatible-7B68EE" alt="ActivityWatch"></a> </p>
An MCP server that gives AI assistants real-time awareness of your computer activity through ActivityWatch. No raw queries. No AQL syntax. Just ask your AI "what did I do today?" and get a human-readable answer.
Why this one?
There are other ActivityWatch MCPs out there. Here's how this one is different:
| This project | Others | |
|---|---|---|
| Query interface | Pre-aggregated, high-level tools | Raw AQL queries |
| User needs to know AQL? | No | Yes |
| Built-in categories | ✅ coding, browsing, communication, etc. | ❌ |
| Ready-to-use tools | get_day_summary, get_current_activity, etc. |
run_query(aql_string) |
| Designed for | AI companions & chat interfaces | Developer debugging |
TL;DR: Other MCPs give your AI a database console. This one gives your AI eyes.
What can your AI do with this?
Once connected, your AI companion can answer questions like:
- 🕐 "What am I working on right now?"
- 📊 "How did I spend my time today?"
- 💻 "How many hours did I code this week?"
- 🌙 "What time did I stop working last night?"
- 🔍 "Show me everything I did between 2pm and 5pm yesterday."
- 🌐 "What websites did I spend the most time on?"
- 📁 "Which projects did I work on this week?"
- 🏷️ "Add Cursor to my coding category."
Your AI knows what you do, not just what you say. It can notice patterns you miss — like when you've been coding for 5 hours straight without a break.
Quick Start
1. Prerequisites
- ActivityWatch installed and running
- Node.js >= 20
2. Install
git clone https://github.com/JM-404/activitywatch-mcp.git
cd activitywatch-mcp
npm install && npm run build
3. Configure
Add to your Claude Desktop / Claude Code MCP config:
{
"mcpServers": {
"activitywatch": {
"command": "node",
"args": ["/absolute/path/to/activitywatch-mcp/dist/index.js"]
}
}
}
4. Try it
Open Claude and ask: "What have I been doing on my computer today?"
That's it. No AQL. No bucket IDs. Just conversation.
Tools
get_current_activity
"What am I doing right now?"
Returns the currently active app, window title, duration, and AFK status.
get_day_summary
"How did I spend my time today?"
Top apps by usage time, total active/AFK hours, first and last active timestamps.
Parameters: date (optional, defaults to today)
get_category_time
"How many hours did I code this week?"
Aggregated time for a category or specific app over a date range, with daily breakdown.
Parameters: category (required), start_date, end_date (optional)
Built-in categories:
| Category | Apps |
|---|---|
coding |
VS Code, PyCharm, Terminal, iTerm2, Cursor, Warp, Xcode |
browsing |
Chrome, Safari, Firefox, Arc, Edge |
communication |
WeChat, Slack, Discord, Telegram, Messages, Zoom, Teams |
entertainment |
Bilibili, YouTube, Spotify, Netflix |
writing |
Obsidian, Notion, Typora, Word, Pages |
design |
Figma, Sketch, Canva, Photoshop |
Customize categories with AW_CATEGORIES_FILE env var pointing to your own JSON.
get_timeline
"Walk me through my afternoon."
Chronological list of app switches with window titles and durations.
Parameters: date, start_time, end_time, min_duration_seconds
get_browser_history
"What websites did I visit today?"
Top domains by time spent. Requires the ActivityWatch browser extension.
Parameters: date, domain (optional filter)
manage_categories
"Add Cursor to my coding category."
View and modify activity category mappings at runtime. Changes persist to ~/.activitywatch-mcp/categories.json.
Parameters: action (list | add | remove | update), category, apps
get_project_time
"Which projects did I work on this week?"
Coding time broken down by project/repository. Extracts project names from IDE window titles (VS Code, Cursor, PyCharm, Xcode, Terminal).
Parameters: start_date, end_date (optional)
Natural language dates
All date parameters accept natural language in addition to YYYY-MM-DD:
today, yesterday, this_week, last_week, this_month, last_month, last_7_days, last_30_days
Environment Variables
| Variable | Default | Description |
|---|---|---|
AW_HOST |
http://localhost:5600 |
ActivityWatch API address |
AW_TITLE_MAX_LENGTH |
80 |
Truncate window titles for privacy |
AW_CATEGORIES_FILE |
built-in | Path to custom category mapping JSON |
Privacy
🔒 Your data never leaves your machine.
- ActivityWatch stores everything locally
- This MCP server runs locally
- Data flows:
ActivityWatch (local) → MCP Server (local) → Your AI conversation - Window titles are truncated to prevent accidental exposure of sensitive content
- No telemetry, no external API calls, no cloud storage
Roadmap
- [ ] macOS Screen Time integration (iPhone + Mac data from
knowledgeC.db) - [ ] Auto-generated daily/weekly reports
- [ ] Proactive alerts (e.g., "You've been coding for 4 hours — take a break")
- [ ] Productivity scoring and trend analysis
- [ ] SSE transport for remote access
Contributing
PRs and issues welcome. If you have ideas for new tools or categories, open an issue.
License
MIT
<p align="center"> Built with ❤️ for the AI companion community.<br> <em>Because your AI should know you, not just answer you.</em> </p>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。