Generate narrative summaries from ActivityWatch data using the Model Context Protocol (MCP).
ActivityWatch Narrator is an MCP server that exposes ActivityWatch activity tracking data to AI assistants like Claude. It allows you to query, analyze, and generate narrative summaries of your computer usage patterns.
- MCP Server Integration - Connect your ActivityWatch data to Claude Desktop and other MCP clients
- Activity Querying - Fetch raw events and enriched activities from any time range
- Narrative Summaries - Generate human-readable summaries of your activities
- Bucket Management - List and query all ActivityWatch data buckets
- Time Range Analysis - Analyze activities across custom time periods
- ActivityWatch running on
http://localhost:5600 - Python 3.11 or later
- pip or another Python package manager
Run directly without installation:
# From PyPI (once published)
uvx aw-narrator
# From local directory
uvx --from . aw-narrator
# From Git repository
uvx --from git+https://github.com/activitywatch/aw-narrator aw-narrator# Clone the repository
git clone https://github.com/activitywatch/aw-narrator.git
cd aw-narrator
# Install dependencies
pip install -e .
# Or using development dependencies
pip install -e ".[dev]"# Using uvx (if installed via pip or uvx)
aw-narrator-mcp
# Or using Python module
python -m aw_narrator.mcp
# Using uvx without installation
uvx --from . aw-narrator-mcp
# Server will start on http://127.0.0.1:8001Verify it's running:
curl http://127.0.0.1:8001/healthSee MCP Setup Guide for detailed configuration instructions.
Quick config - Add to your Claude Desktop config file:
{
"mcpServers": {
"activitywatch-narrator": {
"command": "python",
"args": ["-m", "aw_narrator.mcp"],
"cwd": "/path/to/activitywatch-narrator",
"env": {
"AW_MCP_ACTIVITYWATCH_URL": "http://localhost:5600"
}
}
}
}The MCP server provides these tools to AI assistants:
- get_activitywatch_status - Check ActivityWatch server availability
- list_activitywatch_buckets - List all available data buckets
- get_bucket_events - Fetch events from a bucket within a time range
- get_enriched_activities - Get processed activity data
- generate_activity_summary - Create narrative summaries
Once connected through Claude Desktop, you can ask:
- "What did I work on today?"
- "Show me my most used applications this week"
- "Generate a summary of my activities from 9am to 5pm yesterday"
- "What ActivityWatch buckets do I have available?"
Configure via environment variables:
AW_MCP_HOST- Server host (default:127.0.0.1)AW_MCP_PORT- Server port (default:8001)AW_MCP_ACTIVITYWATCH_URL- ActivityWatch URL (default:http://localhost:5600)
Example:
AW_MCP_PORT=8002 python -m aw_narrator.mcp# Run all tests
pytest
# With coverage
pytest --cov=aw_narrator
# Run specific test file
pytest tests/integration/test_activitywatch_integration.py# Format code
black src/ tests/
# Sort imports
isort src/ tests/
# Lint
ruff check src/ tests/
# Type check
mypy src/activitywatch-narrator/
├── src/aw_narrator/
│ ├── adapters/ # External service adapters (ActivityWatch)
│ ├── cli/ # Command-line interface
│ ├── core/ # Domain models and business logic
│ └── mcp/ # MCP server implementation
├── tests/
│ ├── integration/ # Integration tests
│ └── unit/ # Unit tests
├── docs/ # Documentation
│ ├── MCP_SETUP.md # MCP configuration guide
│ └── adr/ # Architecture decision records
└── pyproject.toml # Project configuration
- MCP Setup Guide - Complete MCP configuration instructions
- Architecture Decisions - ADRs and technical decisions
- Design Document - System architecture and design
- Project Plan - User stories and roadmap
Contributions are welcome! Please:
- Follow the existing code style (black, isort, ruff)
- Add tests for new features
- Update documentation as needed
- Create an ADR for significant architectural changes
MIT License - see LICENSE file for details
- Issues: GitHub Issues
- ActivityWatch Forum: forum.activitywatch.net