RescueTime MCP Server
Enables comprehensive access to RescueTime productivity data and features through the Model Context Protocol. Supports analytics retrieval, focus session management, highlights creation, and offline time tracking through natural language interactions.
README
RescueTime MCP Server
A comprehensive FastMCP server for integrating with the RescueTime API, providing tools to access productivity data, manage focus sessions, and interact with all RescueTime features through the Model Context Protocol (MCP).
Table of Contents
- Features
- Supported RescueTime APIs
- Installation
- Configuration
- Usage
- Development
- Contributing
- License
Features
- Complete RescueTime API Coverage: Access all major RescueTime APIs including analytic data, daily summaries, alerts, highlights, focus sessions, and offline time tracking
- FastMCP Integration: Built on the FastMCP framework for robust MCP server functionality
- Async Support: Full asynchronous support for high-performance operations
- Type Safety: Comprehensive type hints and Pydantic models for data validation
- Error Handling: Robust error handling with custom exceptions and logging
- Comprehensive Testing: Full test suite including unit tests, integration tests, and performance tests
Supported RescueTime APIs
1. Analytic Data API
- Get detailed productivity analytics with customizable time ranges and filters
- Support for different perspectives (rank, interval, member) and resolutions
2. Daily Summary Feed API
- Access daily productivity summaries and pulse scores
- Filter by date ranges
3. Alerts Feed API
- Retrieve and manage productivity alerts
- Dismiss unwanted alerts
4. Highlights Feed/POST API
- View existing highlights
- Create new productivity highlights
5. FocusTime APIs
- Start and end focus sessions
- Monitor current focus session status
- Set custom focus duration
6. Offline Time POST API
- Log offline work time
- Add descriptions for offline activities
Installation
Prerequisites
- Python 3.9 or higher
- RescueTime account with API access
- RescueTime API key
Install from Source
# Clone the repository
git clone https://github.com/ebowman/rescuetime-mcp.git
cd rescuetime-mcp
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# For users - install basic package
pip install -e .
# For developers - install with development tools
pip install -e ".[dev]"
Configuration
Environment Variables
Set your RescueTime API key as an environment variable:
export RESCUETIME_API_KEY="your_rescuetime_api_key_here"
Alternatively, create a .env file in the project root:
RESCUETIME_API_KEY=your_rescuetime_api_key_here
Getting Your API Key
- Log in to your RescueTime account
- Go to https://www.rescuetime.com/anapi/manage
- Generate or copy your existing API key
Usage
Running the MCP Server
# Run directly
rescuetime-mcp
# Or using Python module
python -m rescuetime_mcp.server
# Check version
rescuetime-mcp --version
Available MCP Tools
get_analytic_data- Get detailed productivity analytics with filtersget_daily_summary_feed- Access daily productivity summariesget_alerts_feed- Retrieve productivity alertsdismiss_alert- Dismiss specific alertsget_highlights_feed- View productivity highlightspost_highlight- Create new highlightsstart_focus_session- Start FocusTime sessionsend_focus_session- End current focus sessionget_focus_session_status- Check focus session statuspost_offline_time- Log offline work timehealth_check- Verify API connection
Development
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install with development dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=rescuetime_mcp --cov-report=html
# Run only unit tests
pytest tests/test_client.py tests/test_server.py
# Run integration tests (requires real API key)
export RESCUETIME_API_KEY_REAL="your_real_api_key"
pytest tests/test_integration.py -m integration
# Run performance tests
pytest tests/test_integration.py -m slow
Code Quality
# Format code
black src tests
# Sort imports
isort src tests
# Lint code
ruff check src tests
# Type checking
mypy src
Project Structure
rescuetime-mcp/
├── src/rescuetime_mcp/
│ ├── __init__.py # Package initialization
│ ├── client.py # RescueTime API client
│ └── server.py # FastMCP server implementation
├── tests/
│ ├── conftest.py # Test configuration
│ ├── test_client.py # Client tests
│ ├── test_server.py # Server tests
│ └── test_integration.py # Integration tests
└── pyproject.toml # Project configuration
Contributing
See CONTRIBUTING.md for development setup, code standards, and contribution guidelines.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright © 2025 Eric Bowman
Acknowledgments
- Built with FastMCP framework
- Uses RescueTime API
- Powered by Pydantic for data validation
- HTTP client powered by httpx
Special thanks to the FastMCP community and RescueTime for providing robust APIs.
Support
Getting Help
- Documentation: This README and inline code documentation
- Bug Reports: Use GitHub Issues
- Feature Requests: Create an issue with detailed use cases
- Questions: Use GitHub Discussions
- Security: Email ebowman@boboco.ie for security-related issues
Project Status
This project is actively maintained. We aim to respond to issues and pull requests promptly.
- Latest Version: v0.1.0
- Python Support: 3.9+
- Status: Beta Release
Changelog
See CHANGELOG.md for detailed version history and changes.
Made with ❤️ by Eric Bowman
If this project helps you, please consider giving it a ⭐ on GitHub!
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。