Clockify MCP Server

Clockify MCP Server

Enables AI assistants to interact with the Clockify API for managing time entries, timers, and team management tasks. It provides tools for searching time records, tracking project hours, and performing high-level analysis like overtime detection and weekly summaries.

Category
访问服务器

README

WARNING

⚠️ THIS HAS MOSTLY BEEN CODED VIA AI - PROCEED AT YOUR OWN RISK⚠️

Clockify MCP Server

A Model Context Protocol (MCP) server that provides seamless integration with the Clockify time tracking API. This server enables AI assistants to interact with Clockify for time tracking, reporting, and team management tasks.

Features

Core Functionality

  • 🔍 Find time entries by user, project, or search phrase
  • ⏱️ Start and stop timers with project association
  • Add time entries for any user with flexible parameters
  • 📊 High-level analysis tools for team management
  • 📈 Weekly summaries and overtime detection

High-Level Tools

  • Find overtime users: Identify team members working >40 hours/week
  • Find undertime users: Identify team members logging <20 hours/week
  • Weekly summaries: Get detailed breakdowns of hours by week
  • Project analytics: See who's working on what and for how long

Installation

Prerequisites

Quick Install with uvx

The easiest way to use this server is with uvx (bundled with uv):

# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Run the server directly (it will be cached)
uvx clockify-mcp-server

Manual Installation

# Clone the repository
git clone https://github.com/yourusername/clockify-mcp-server.git
cd clockify-mcp-server

# Install with pip
pip install -e .

# Or install from PyPI (once published)
pip install clockify-mcp-server

Configuration

Environment Variables

Set your Clockify API key as an environment variable:

export CLOCKIFY_API_KEY="your_api_key_here"

You can get your API key from Clockify User Settings under "API" section.

MCP Client Configuration

Add this to your MCP client configuration file:

For Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "clockify": {
      "command": "uvx",
      "args": ["clockify-mcp-server"],
      "env": {
        "CLOCKIFY_API_KEY": "your_api_key_here"
      }
    }
  }
}

For Opencode

{
  "mcp": {
    "clockify": {
      "command": ["uvx", "clockify-mcp-server"]
      "environment": {
        "CLOCKIFY_API_KEY": "your_api_key_here"
      }
    }
  }
}

Available Tools

1. find_user_time_entries

Find all time entries for a specific user.

Parameters:

  • user_name (required): Name of the user (partial match, case-insensitive)
  • start_date (optional): Start date in YYYY-MM-DD format (default: 30 days ago)
  • end_date (optional): End date in YYYY-MM-DD format (default: today)
  • limit (optional): Maximum entries to display (default: 50, use 0 for unlimited)
  • workspace_id (optional): Workspace ID (default: user's default workspace)

Example:

Find all time entries for John Doe from the last 30 days

2. find_project_time_entries

Find all time entries for a specific project.

Parameters:

  • project_name (required): Name of the project (partial match, case-insensitive)
  • start_date (optional): Start date in YYYY-MM-DD format (default: 30 days ago)
  • end_date (optional): End date in YYYY-MM-DD format (default: today)
  • limit (optional): Maximum entries to display (default: 30, use 0 for unlimited)
  • workspace_id (optional): Workspace ID

Example:

Show me all time logged to the "Website Redesign" project this month

3. search_time_entries

Search time entries by description phrase.

Parameters:

  • search_phrase (required): Phrase to search for in descriptions
  • user_name (optional): Limit search to specific user
  • start_date (optional): Start date in YYYY-MM-DD format (default: 30 days ago)
  • end_date (optional): End date in YYYY-MM-DD format (default: today)
  • limit (optional): Maximum entries to display (default: 50, use 0 for unlimited)
  • workspace_id (optional): Workspace ID

Example:

Find all time entries containing "meeting" in the description

4. add_time_entry

Add a time entry for a specific user.

Parameters:

  • user_name (required): Name of the user
  • description (required): Description of the work
  • start_time (required): Start time in ISO format (e.g., 2024-01-29T09:00:00)
  • end_time (required): End time in ISO format (e.g., 2024-01-29T17:00:00)
  • project_name (optional): Project to associate with
  • task_name (optional): Task within the project (requires project_name)
  • billable (optional): Whether time is billable (default: true)
  • workspace_id (optional): Workspace ID

Example:

Add a time entry for Jane Smith: 8 hours today on "Client Project" for meetings

5. start_timer

Start a timer for the current user.

Parameters:

  • description (required): What you're working on
  • project_name (optional): Project to associate with
  • task_name (optional): Task within the project (requires project_name)
  • workspace_id (optional): Workspace ID

Example:

Start a timer for "Writing documentation" on the "Internal Tools" project

6. stop_timer

Stop the currently running timer.

Parameters:

  • workspace_id (optional): Workspace ID

Example:

Stop my current timer

7. find_overtime_users

Find users working more than specified hours per week.

Parameters:

  • hours_threshold (optional): Hours per week threshold (default: 40)
  • weeks (optional): Number of weeks to analyze (default: 4)
  • workspace_id (optional): Workspace ID

Example:

Show me team members who worked more than 40 hours in any week this month

8. find_undertime_users

Find users who didn't log minimum hours per week.

Parameters:

  • hours_threshold (optional): Minimum hours threshold (default: 20)
  • weeks (optional): Number of weeks to analyze (default: 1)
  • workspace_id (optional): Workspace ID

Example:

Who didn't log at least 20 hours last week?

9. get_user_weekly_summary

Get a weekly breakdown of hours for a user.

Parameters:

  • user_name (required): Name of the user
  • weeks (optional): Number of weeks to analyze (default: 4)
  • workspace_id (optional): Workspace ID

Example:

Show me John's weekly hours for the past month

Usage Examples

With Claude Desktop

Once configured, you can ask Claude natural language questions:

"Find all time entries for Sarah Johnson from last week"

"Show me everyone who logged time to the Mobile App project this month"

"Start a timer for code review on the Backend API project"

"Who on the team worked more than 45 hours in the past month?"

"Add a time entry for Mike: 4 hours yesterday on Client Presentation"

Programmatic Usage

from clockify_mcp import ClockifyClient
import asyncio

async def main():
    client = ClockifyClient(api_key="your_api_key")
    
    # Get current user
    user = await client.get_current_user()
    print(f"Logged in as: {user['name']}")
    
    # Get default workspace
    workspace = await client.get_default_workspace()
    
    # Find a user
    user = await client.find_user_by_name(workspace['id'], "John")
    
    # Get their time entries
    entries = await client.get_time_entries(
        workspace_id=workspace['id'],
        user_id=user['id']
    )
    
    print(f"Found {len(entries)} time entries")
    
    await client.close()

asyncio.run(main())

Development

Setup Development Environment

# Clone the repository
git clone https://github.com/KeithHanson/clockify-mcp
cd clockify-mcp-server

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install in development mode
pip install -e ".[dev]"

Running Tests

pytest tests/

Code Formatting

# Format code
black src/

# Lint code
ruff check src/

Project Structure

clockify-mcp-server/
├── src/
│   └── clockify_mcp/
│       ├── __init__.py
│       ├── client.py      # Clockify API client
│       └── server.py      # MCP server implementation
├── docs/                   # Full API documentation
│   ├── 00_INDEX.md
│   ├── 01_USER_API.md
│   ├── 02_WORKSPACE_API.md
│   ├── 03_TIME_ENTRY_API.md
│   ├── 04_PROJECT_API.md
│   ├── 05_REPORTS_API.md
│   ├── 06_WEBHOOKS_API.md
│   └── 07_QUICK_REFERENCE.md
├── tests/                  # Test suite
├── pyproject.toml         # Project configuration
├── README.md              # This file
└── LICENSE                # MIT License

API Documentation

Complete API documentation is available in the docs/ directory:

  • 00_INDEX.md - Overview and quick reference
  • 01_USER_API.md - User management endpoints
  • 02_WORKSPACE_API.md - Workspace configuration
  • 03_TIME_ENTRY_API.md - Time tracking operations
  • 04_PROJECT_API.md - Project management
  • 05_REPORTS_API.md - Reporting and analytics
  • 06_WEBHOOKS_API.md - Webhook configuration (not implemented in MCP server)
  • 07_QUICK_REFERENCE.md - Code snippets and examples

Limitations

  • User-specific operations: Some operations (like adding time entries for other users) may require workspace admin permissions
  • Rate limiting: The server respects Clockify's rate limits (50 requests/second for addon tokens)
  • Workspace selection: Defaults to user's default workspace if not specified
  • Webhooks: Not implemented (not needed for MCP use case)

Troubleshooting

"CLOCKIFY_API_KEY environment variable is required"

Make sure you've set the API key in your environment or MCP configuration:

export CLOCKIFY_API_KEY="your_key_here"

"User not found"

User names are matched using partial, case-insensitive search. Try:

  • Using just the first or last name
  • Checking spelling
  • Using the email address instead

"No workspaces found"

Ensure your API key is valid and you have access to at least one workspace in Clockify.

Connection Issues

If you're having connection issues:

  1. Check your internet connection
  2. Verify your API key is correct
  3. Ensure you're not behind a proxy that blocks API requests

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Acknowledgments

Support

Changelog

v0.1.0 (Initial Release)

  • Core time entry operations
  • User and project search
  • Timer start/stop functionality
  • High-level analysis tools
  • Overtime/undertime detection
  • Weekly summaries

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选