timecamp-mcp-server

timecamp-mcp-server

Integrates TimeCamp time tracking into AI assistants, enabling real-time timer control, time entry management, smart search, and reporting.

Category
访问服务器

README

TimeCamp MCP Server

A Model Context Protocol (MCP) server that integrates TimeCamp time tracking directly into AI assistants like Claude, Cline, and Continue.

Features

  • ⏱️ Real-time Timer Control - Start, stop, and check timer status
  • 📊 Time Entry Management - Create manual time entries for past work
  • 🔍 Smart Search - Fuzzy search across projects and tasks
  • 📈 Reporting - Daily summaries, weekly reports, and time tracking insights
  • 🚀 Intelligent Caching - Fast response times with built-in cache management
  • 📝 Rich Prompts - Pre-built prompts for standup reports and analytics

Quick Start

Prerequisites

  • TimeCamp account with API access
  • MCP-compatible client (Claude Desktop, Cline, Continue, etc.)
  • uv installed (required by MCP clients)

Get your TimeCamp API token

  1. Log into TimeCamp
  2. Navigate to Profile
  3. Scroll down to Your programming API token
  4. Copy your API token

Installation

Simply add the TimeCamp MCP server to your client configuration. The server will be automatically downloaded from PyPI when needed.

Client Configuration

Claude Desktop

Add to ~/.claude/claude_desktop_config.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "timecamp": {
      "command": "uvx",
      "args": ["timecamp-mcp-server"],
      "env": {
        "TIMECAMP_API_TOKEN": "YOUR_API_TOKEN_HERE"
      }
    }
  }
}

VS Code (Cline, Continue, etc.)

For VS Code extensions that support MCP, add to your settings:

{
  "cline.mcp.servers": {
    "timecamp": {
      "command": "uvx",
      "args": ["timecamp-mcp-server"],
      "env": {
        "TIMECAMP_API_TOKEN": "YOUR_API_TOKEN_HERE"
      }
    }
  }
}

Alternative: Manual Installation

If you prefer to install from source:

git clone https://github.com/kkeeling/timecamp-mcp-server.git
cd timecamp-mcp-server

Then use this configuration:

{
  "mcpServers": {
    "timecamp": {
      "command": "/path/to/uv",
      "args": [
        "--directory",
        "/path/to/timecamp-mcp-server",
        "run",
        "python",
        "timecamp-server.py"
      ],
      "env": {
        "TIMECAMP_API_TOKEN": "YOUR_API_TOKEN_HERE"
      }
    }
  }
}

Resources

Resources provide read-only access to TimeCamp data:

timecamp://projects

Lists all available projects with task counts and status.

Example response:

{
  "projects": [
    {
      "id": 12345,
      "name": "Website Development",
      "color": "#4CAF50",
      "tasks_count": 15,
      "archived": false
    }
  ],
  "total_count": 8,
  "include_archived": true
}

timecamp://tasks

Lists all tasks with their associated projects.

Example response:

[
  {
    "id": 67890,
    "name": "Frontend Development",
    "project_id": 12345,
    "project_name": "Website Development",
    "archived": false
  }
]

timecamp://timer

Shows current timer status.

Example response:

{
  "is_running": true,
  "task_name": "Code Review",
  "task_id": 67890,
  "timer_id": 11111,
  "project_name": "Website Development",
  "elapsed_time": "1h 23m",
  "elapsed_seconds": 4980,
  "start_time": "2024-01-15T10:30:00Z"
}

timecamp://time-entries/{date}

Retrieves time entries for a specific date (format: YYYY-MM-DD).

Example: timecamp://time-entries/2024-01-15

Example response:

{
  "date": "2024-01-15",
  "total_time": "6h 45m",
  "total_seconds": 24300,
  "entries": [
    {
      "task_name": "Code Review",
      "task_id": 67890,
      "project_name": "Website Development",
      "duration": "2h 30m",
      "duration_seconds": 9000,
      "notes": ["Reviewed PR #123", "Fixed merge conflicts"]
    }
  ],
  "entry_count": 4,
  "is_timer_running": true,
  "current_task": "Documentation",
  "current_task_id": 67891
}

timecamp://changes

Tracks recent state changes (timer starts/stops, entries created).

Example response:

{
  "changes": [
    {
      "type": "timer_started",
      "timestamp": "2024-01-15T14:30:00Z",
      "details": {
        "task_id": 67890,
        "task_name": "Code Review",
        "timer_id": 11111
      }
    }
  ],
  "timestamp": "2024-01-15T14:35:00Z"
}

timecamp://search/{query}

Fuzzy search for projects and tasks by name.

Example: timecamp://search/frontend

Response:

{
  "results": [
    {
      "type": "task",
      "id": 67890,
      "name": "Frontend Development",
      "match_score": 0.95,
      "project_name": "Website Development"
    },
    {
      "type": "project",
      "id": 12345,
      "name": "Frontend Redesign",
      "match_score": 0.85
    }
  ],
  "total_results": 2,
  "query": "frontend"
}

Tools

Tools allow you to perform actions in TimeCamp:

start_timer

Starts a timer for a specific task.

Parameters:

  • task_id (required): The ID of the task to track
  • note (optional): A note to attach to the timer

Example:

{
  "task_id": 67890,
  "note": "Working on authentication feature"
}

Response:

{
  "message": "Timer started for task 'Frontend Development'",
  "timer_id": 11111,
  "task_id": 67890,
  "task_name": "Frontend Development",
  "started_at": "2024-01-15T10:30:00Z",
  "project_name": "Website Development"
}

stop_timer

Stops the currently running timer.

Parameters: None

Response:

{
  "message": "Timer stopped",
  "duration": "2h 15m",
  "duration_seconds": 8100,
  "task_name": "Frontend Development",
  "task_id": 67890,
  "timer_id": 11111
}

create_time_entry

Creates a manual time entry for past work.

Parameters:

  • task_id (required): The task ID
  • date (required): Date in YYYY-MM-DD format
  • start_time (required): Start time in HH:MM format
  • end_time (required): End time in HH:MM format
  • note (optional): Description of work done

Example:

{
  "task_id": 67890,
  "date": "2024-01-14",
  "start_time": "14:00",
  "end_time": "16:30",
  "note": "Implemented user authentication"
}

Response:

{
  "entry_id": 99999,
  "task_id": 67890,
  "task_name": "Frontend Development",
  "project_name": "Website Development",
  "date": "2024-01-14",
  "start_time": "14:00",
  "end_time": "16:30",
  "duration": "2h 30m",
  "duration_seconds": 9000,
  "note": "Implemented user authentication"
}

Prompts

Pre-built prompts for common time tracking workflows:

daily_standup_prompt

Generates a daily standup report from time entries.

Parameters:

  • date (optional): Date in YYYY-MM-DD format (defaults to today)

Example output:

Daily Standup for 2024-01-15
==============================
Total time tracked: 6h 45m

What I worked on:
• Frontend Development (Website Development): 2h 30m - Implemented auth flow; Fixed responsive issues
• Code Review (Website Development): 1h 45m - Reviewed PR #123
• Documentation (API Project): 1h 30m - Updated API docs
• Team Meeting (Internal): 1h 0m

Currently working on: Documentation

weekly_report_prompt

Generates a comprehensive weekly time report.

Parameters:

  • start_date (optional): Start date in YYYY-MM-DD format (defaults to current week's Monday)

Example output:

Weekly Time Report
Week of 2024-01-08
========================================
Total time tracked: 35h 20m

Time by Day:
• Monday (2024-01-08): 7h 15m
• Tuesday (2024-01-09): 6h 45m
• Wednesday (2024-01-10): 7h 30m
• Thursday (2024-01-11): 8h 0m
• Friday (2024-01-12): 5h 50m

Time by Project:
• Website Development: 22h 15m
• API Project: 8h 30m
• Internal: 4h 35m

Top 5 Tasks:
• Frontend Development (Website Development): 12h 30m
• Backend API (API Project): 6h 45m
• Code Review (Website Development): 5h 15m
• Documentation (API Project): 3h 30m
• Team Meeting (Internal): 2h 45m

time_tracking_insights_prompt

Provides insights and suggestions for better time tracking.

Parameters: None

Example output:

Time Tracking Insights
==============================

Today's tracked time: 4h 30m
Tasks worked on: 3

Timer is running: Documentation
Elapsed time: 45m

Yesterday's total: 7h 15m
Tasks completed: 5
📊 You're tracking less time than yesterday.

Suggestions:
• Review untracked time gaps
• Set reminders to start/stop timers
• Use descriptive notes for better reporting

Usage Examples

Start tracking time

"Start timer for task 67890 with note 'Working on login feature'"
"Begin tracking Frontend Development task"
"Start working on task ID 12345"

Stop tracking

"Stop the timer"
"Stop tracking time"
"End current timer"

Check status

"What's my current timer status?"
"Am I tracking time right now?"
"Show current timer"

Create time entries

"Log 2 hours for task 67890 yesterday from 2pm to 4pm"
"Create time entry for Frontend Development on 2024-01-14 from 09:00 to 11:30"
"Add manual entry for task 12345"

View summaries

"Show me today's time tracking"
"What did I work on today?"
"Generate my daily standup"
"Create weekly report for last week"
"Show time tracking insights"

Advanced Features

Intelligent Caching

  • 5-minute TTL cache for projects and tasks
  • Automatic cache invalidation on state changes
  • ETag support for efficient resource updates

Error Handling

  • Graceful handling of API errors
  • Clear error messages for common issues
  • Rate limit detection and warnings

State Tracking

  • Monitors timer starts/stops
  • Tracks time entry creation
  • Provides change history via timecamp://changes resource

Environment Variables

Variable Description Required
TIMECAMP_API_TOKEN Your TimeCamp API token Yes

Troubleshooting

"TIMECAMP_API_TOKEN environment variable not set"

Ensure the API token is properly configured in your MCP client's configuration file.

"Invalid API token"

  1. Verify your token in TimeCamp: Profile → API Access
  2. Check for extra spaces or characters in the token
  3. Ensure the token hasn't been regenerated

"Rate limit exceeded"

TimeCamp API has rate limits. Wait 60 seconds before retrying.

Timer not starting

  1. Verify the task ID exists
  2. Check if a timer is already running (stop it first)
  3. Ensure the task isn't archived

Development

The server is implemented as a single file Python script (timecamp-server.py) that uses PEP 723 inline script metadata. Dependencies are automatically handled by UV.

Running locally

# Using UV
uv run timecamp-server.py

Dependencies

  • fastmcp - MCP server framework
  • httpx - Async HTTP client
  • pydantic - Data validation
  • rapidfuzz - Fuzzy string matching
  • python-dotenv - Environment variable management

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details

Support

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选