Skip to main content
Glama
Harvest MCP Server

Harvest MCP Server

by taiste

Harvest MCP 服务器

此 MCP (Model Context Protocol) 服务器提供与 Harvest 时间追踪和项目管理 API 的集成。它允许 Claude 和其他兼容 MCP 的 AI 助手与您的 Harvest 账户进行交互,帮助您管理时间条目、项目、客户等。

功能

该服务器提供以下功能:

用户

  • 列出用户

  • 获取用户详情

时间条目

  • 列出带有过滤选项的时间条目

  • 创建新的时间条目

  • 启动/停止计时器

  • 查询时间条目详情

  • 获取未提交的时间表(尚未提交审批的时间条目)

项目

  • 列出带有过滤选项的项目

  • 检索详细的项目信息

客户

  • 列出带有过滤选项的客户

  • 检索详细的客户信息

任务

  • 列出带有过滤选项的可用任务

估算单

  • 列出带有过滤选项的估算单(按客户、状态、日期范围、updated_since)

  • 检索详细的估算单信息

  • 通过用户可见的编号(例如 "79")查找估算单

  • 列出与估算单关联的消息

  • 创建带有行项目的估算单

  • 更新现有估算单(通过 _destroy 添加/更新/删除行项目)

  • 更改估算单状态(发送、接受、拒绝、重新打开),而不发送电子邮件

  • 发送估算单消息(将估算单通过电子邮件发送给收件人)

  • 删除估算单

Related MCP server: Harvest MCP Server

设置说明

先决条件

  • Python 3.10 或更高版本

  • 具有 API 访问权限的 Harvest 账户

  • Harvest API 密钥和账户 ID

与 Claude Desktop 集成

  1. 创建或编辑您的 Claude Desktop 配置文件:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

    • Windows (MSIX 安装 — claude.ai/download 的默认安装方式): %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.json

    • Windows (旧版/非 MSIX 安装): %APPDATA%\Claude\claude_desktop_config.json

  2. 添加 Harvest MCP 服务器配置:

     {
         "mcpServers": {
             "harvest": {
                 "command": "uv",
                 "args": [
                   "run",
                   "--directory",
                   "change_directory",
                   "harvest-mcp-server.py"
                 ],
                 "env": {
                     "HARVEST_ACCOUNT_ID": "account_id",
                     "HARVEST_API_KEY": "api_key"
                 }
             }
         }
     }
  3. 重启 Claude Desktop。

  4. 通过查看 Claude 界面中的锤子图标来验证集成。

查询示例

连接后,您可以询问 Claude 关于您的 Harvest 数据,例如:

  • "显示我上周的时间条目"

  • "列出我所有活跃的项目"

  • "为项目 [project_id] 和任务 [task_id] 启动计时器"

  • "显示我所有活跃的客户"

  • "列出所有可用任务"

  • "获取我本月未提交的时间表"

  • "显示用户 [user_id] 未提交的时间条目"

  • "显示本季度所有已接受的估算单"

  • "查找编号为 [number] 的估算单"

  • "为客户 [client_id] 创建一份包含这些行项目的估算单草稿..."

  • "将估算单 [id] 标记为已发送"

  • "将估算单 [id] 通过电子邮件发送给 client@example.com"

自定义

您可以修改服务器代码以添加更多功能或自定义现有工具,以更好地适应您的工作流程。该服务器使用 FastMCP,通过简单地添加带有 @mcp.tool() 装饰器的新函数,即可轻松添加新工具。

故障排除

  • API 错误: 确保您的 Harvest API 密钥和账户 ID 正确,并具有必要的权限。

  • 连接问题: 验证您的 Claude Desktop 配置文件是否具有指向服务器脚本的正确路径。

  • 缺少依赖项: 确保您已在 Python 环境中安装了所有必需的包。

只读模式

您可以通过将 HARVEST_READ_ONLY 环境变量设置为 true 来以只读模式运行服务器。这将禁用所有写入操作(创建时间条目、启动/停止计时器、创建/更新/删除估算单、更改估算单状态以及发送估算单消息),同时保持所有读取操作可用。

{
    "mcpServers": {
        "harvest": {
            "command": "uv",
            "args": [
              "run",
              "--directory",
              "change_directory",
              "harvest-mcp-server.py"
            ],
            "env": {
                "HARVEST_ACCOUNT_ID": "account_id",
                "HARVEST_API_KEY": "api_key",
                "HARVEST_READ_ONLY": "true"
            }
        }
    }
}

当启用只读模式时,任何调用写入工具的尝试都将返回一条错误消息,解释服务器处于只读模式以及如何启用写入访问权限。

安全说明

此服务器需要您的 Harvest API 凭据才能运行。请确保:

  • 妥善保管您的 API 密钥

  • 不要共享您的 claude_desktop_config.json 文件

  • 考虑为此集成使用具有有限权限的专用 API 密钥

Available Tools

11 tools
create_time_entryC

Create a new time entry.

Args:
    project_id: The ID of the project to associate with the time entry
    task_id: The ID of the task to associate with the time entry
    spent_date: The date when the time was spent (YYYY-MM-DD)
    hours: The number of hours spent
    notes: Optional notes about the time entry

Inputs: hours (required), project_id (required), spent_date (required), task_id (required), +1 more.

get_client_detailsC

Get detailed information about a specific client.

Args:
    client_id: The ID of the client to retrieve

Inputs: client_id (required).

get_project_detailsC

Get detailed information about a specific project.

Args:
    project_id: The ID of the project to retrieve

Inputs: project_id (required).

get_user_detailsB

Retrieve details for a specific user.

Args:
    user_id: The ID of the user to retrieve

Inputs: user_id (required).

list_clientsB

List clients with optional filtering.

Args:
    is_active: Pass true to only return active clients and false to return inactive clients

Inputs: is_active.

list_projectsB

List projects with optional filtering.

Args:
    client_id: Filter by client ID
    is_active: Pass true to only return active projects and false to return inactive projects

Inputs: client_id, is_active.

list_tasksB

List all tasks with optional filtering.

Args:
    is_active: Pass true to only return active tasks and false to return inactive tasks

Inputs: is_active.

list_time_entriesB

List time entries with optional filtering.

Args:
    user_id: Filter by user ID
    from_date: Only return time entries with a spent_date on or after the given date (YYYY-MM-DD)
    to_date: Only return time entries with a spent_date on or before the given date (YYYY-MM-DD)
    is_running: Pass true to only return running time entries and false to return non-running time entries

Inputs: from_date, is_running, to_date, user_id.

list_usersA

List all users in your Harvest account.

Args:
    is_active: Pass true to only return active users and false to return inactive users
    page: The page number for pagination
    per_page: The number of records to return per page (1-2000)

Inputs: is_active, page, per_page.

start_timerC

Start a new timer.

Args:
    project_id: The ID of the project to associate with the time entry
    task_id: The ID of the task to associate with the time entry
    notes: Optional notes about the time entry

Inputs: project_id (required), task_id (required), notes.

stop_timerB

Stop a running timer.

Args:
    time_entry_id: The ID of the running time entry to stop

Inputs: time_entry_id (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 11 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose targeting specific resources and actions. For example, create_time_entry vs. start_timer vs. stop_timer handle different aspects of time tracking, while list_* tools retrieve collections and get_* tools fetch individual details. No tools appear to overlap or cause confusion.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with snake_case throughout. The naming is highly predictable: list_* for collections, get_* for details, create_* for creation, and start_/stop_ for timer actions. There are no deviations in style or convention.

    Tool Count5/5

    With 11 tools, this server is well-scoped for time tracking and project management. Each tool earns its place by covering essential operations like CRUD for time entries, listing resources, and timer control. The count is neither too sparse nor bloated for the domain.

    Completeness4/5

    The tool surface provides strong coverage for core time tracking workflows, including creating/listing time entries, managing timers, and accessing clients, projects, tasks, and users. A minor gap exists in missing update/delete operations for time entries and other resources, but agents can work around this with the available tools.

    Related MCP Connectors

    Related MCP Servers

    • -
      license
      Not graded
      quality
      Not graded
      maintenance
      Provides MCP integration for Harvest's time tracking, project management, and invoicing functionality, enabling natural language interaction with Harvest API through tools for managing clients, time entries, projects, tasks, and users.
      -