Harvest MCP Server

Harvest MCP Server

Enables AI assistants to manage Harvest time tracking by verifying credentials, listing projects and tasks, retrieving and logging time entries, and starting/stopping/restarting timers.

Category
访问服务器

README

Harvest MCP Server

A Model Context Protocol (MCP) server that integrates with the Harvest time tracking API. This server enables AI assistants like Claude to interact with your Harvest account to check projects, tasks, and log time entries.

Features

  • Verify credentials and retrieve authenticated user information
  • List active projects with their associated tasks
  • Retrieve time entries for any date or date range with optional project/user filtering
  • Log time entries for specific projects and tasks
  • Start/stop/restart timers to track time in real-time
  • Delete time entries when needed
  • Flexible authentication: Supports both environment variables and per-call credentials

Prerequisites

  • Node.js (v16 or higher recommended)
  • A Harvest account with API access
  • Harvest Personal Access Token and Account ID

Getting Harvest Credentials

  1. Log in to your Harvest account
  2. Go to SettingsDevelopers
  3. Create a new Personal Access Token
  4. Note your Account ID (visible in the URL or the token creation page)

Installation

  1. Clone this repository:
git clone <repository-url>
cd harvest-mcp
  1. Install dependencies:
npm install
  1. Build the TypeScript code:
npm run build

Configuration

Option 1: Environment Variables (Recommended for MCP)

Configure the server in your MCP client (e.g., Claude Desktop):

Claude Desktop (~/.claude.json or %APPDATA%/Claude/config.json on Windows):

{
  "mcpServers": {
    "harvest": {
      "command": "node",
      "args": ["/absolute/path/to/harvest-mcp/build/index.js"],
      "env": {
        "HARVEST_ACCESS_TOKEN": "your-token-here",
        "HARVEST_ACCOUNT_ID": "your-account-id"
      }
    }
  }
}

Important:

  • Use the absolute path to build/index.js
  • Restart Claude Desktop after modifying the config
  • Rebuild the project (npm run build) after any code changes

Option 2: Per-Call Credentials (Stateless Mode)

If you prefer not to use environment variables, you can pass credentials with each tool invocation:

{
  "access_token": "your-token-here",
  "account_id": "your-account-id"
}

Available Tools

get_my_profile

Verify credentials and retrieve information about the authenticated user.

Parameters:

  • access_token (optional): Harvest Personal Access Token
  • account_id (optional): Harvest Account ID

Example Response:

Authenticated as: John Doe

get_time_entries

Retrieve time entries for a specific date or date range. Supports filtering by project and user.

Parameters:

  • access_token (optional): Harvest Personal Access Token
  • account_id (optional): Harvest Account ID
  • from (optional): Start date in YYYY-MM-DD format (defaults to today)
  • to (optional): End date in YYYY-MM-DD format (defaults to the from date)
  • project_id (optional): Filter entries for a specific project
  • user_id (optional): Filter entries for a specific user (defaults to current user)

Example Usage:

Get today's entries:

{}

Get entries for a specific date:

{
  "from": "2026-02-01"
}

Get entries for a date range:

{
  "from": "2026-02-01",
  "to": "2026-02-05"
}

Get this week's entries for a specific project:

{
  "from": "2026-02-03",
  "to": "2026-02-07",
  "project_id": 67890
}

Example Response:

Found 3 time entries for 2026-02-04:

Total hours: 6.50

[
  {
    "id": 123456789,
    "spent_date": "2026-02-04",
    "hours": 2.5,
    "notes": "Implemented user authentication",
    "project": {
      "id": 67890,
      "name": "My Project"
    },
    "task": {
      "id": 222,
      "name": "Development"
    }
  },
  ...
]

list_active_projects

List all active projects assigned to the authenticated user, including their associated tasks. Returns a concise, readable format by default to minimize context usage.

Parameters:

  • access_token (optional): Harvest Personal Access Token
  • account_id (optional): Harvest Account ID
  • format (optional): Output format - 'compact' (default) for concise view or 'full' for complete JSON

Example Response (Compact Format - Default):

Client: Acme Corp
  → Website Redesign (project_id: 14308070)
     Tasks: Design (8083367), Development (8083368), Testing (8083369)

Client: 123 Industries
  → Online Store - Phase 1 (project_id: 14308069)
     Tasks: Graphic Design (8083365), Programming (8083366)

Example Response (Full Format):

[
  {
    "id": 12345,
    "project": {
      "id": 67890,
      "name": "My Project",
      "code": "PROJ"
    },
    "task_assignments": [
      {
        "id": 111,
        "task": {
          "id": 222,
          "name": "Development"
        }
      }
    ],
    "is_project_manager": false,
    "budget": null,
    ...
  }
]

log_time

Create a time entry for a specific project and task.

Parameters:

  • access_token (optional): Harvest Personal Access Token
  • account_id (optional): Harvest Account ID
  • project_id (required): Project ID
  • task_id (required): Task ID
  • hours (required): Number of hours to log
  • spent_date (optional): Date in YYYY-MM-DD format (defaults to today)
  • notes (optional): Description of the work performed

Example Usage:

{
  "project_id": 67890,
  "task_id": 222,
  "hours": 2.5,
  "spent_date": "2026-02-04",
  "notes": "Implemented user authentication"
}

Example Response:

Success! Time entry created with ID: 123456789

start_timer

Start a running timer for a specific project and task. The timer will track time until stopped.

Parameters:

  • access_token (optional): Harvest Personal Access Token
  • account_id (optional): Harvest Account ID
  • project_id (required): Project ID
  • task_id (required): Task ID
  • spent_date (optional): Date in YYYY-MM-DD format or relative date (defaults to today)
  • notes (optional): Description of the work being performed

Example Usage:

{
  "project_id": 67890,
  "task_id": 222,
  "notes": "Working on user authentication"
}

Example Response:

Success! Timer started with ID: 123456789

stop_timer

Stop a running timer. This uses Harvest's dedicated /stop endpoint to calculate hours based on elapsed time.

Parameters:

  • access_token (optional): Harvest Personal Access Token
  • account_id (optional): Harvest Account ID
  • time_entry_id (required): The ID of the running timer to stop

Example Usage:

{
  "time_entry_id": 123456789
}

Example Response:

Success! Timer stopped.

Project: My Project
Task: Development
Total time logged: 2.5 hours
Date: 2026-02-12

restart_timer

Restart a previously stopped timer. This uses Harvest's dedicated /restart endpoint to resume tracking.

Parameters:

  • access_token (optional): Harvest Personal Access Token
  • account_id (optional): Harvest Account ID
  • time_entry_id (required): The ID of the stopped timer to restart

Example Usage:

{
  "time_entry_id": 123456789
}

Example Response:

Success! Timer restarted.

ID: 123456789
Project: My Project
Task: Development
Date: 2026-02-12

get_running_timer

Check if there's a timer currently running and see elapsed time.

Parameters:

  • access_token (optional): Harvest Personal Access Token
  • account_id (optional): Harvest Account ID

Example Response:

Timer is running:

ID: 123456789
Project: My Project
Task: Development
Notes: Working on user authentication
Elapsed: 1h 23m

[detailed JSON data]

delete_time_entry

Delete a specific time entry.

Parameters:

  • access_token (optional): Harvest Personal Access Token
  • account_id (optional): Harvest Account ID
  • time_entry_id (required): The ID of the time entry to delete

Example Usage:

{
  "time_entry_id": 123456789
}

Example Response:

Success! Time entry 123456789 has been deleted.

Development

Build the project

npm run build

Run in development mode (with ts-node)

npm run dev

Type checking only

npx tsc --noEmit

Project Structure

harvest-mcp/
├── index.ts          # Main server implementation
├── build/            # Compiled JavaScript output
│   └── index.js      # Entry point for MCP clients
├── package.json      # Dependencies and scripts
├── tsconfig.json     # TypeScript configuration
└── README.md         # This file

Usage with Claude Desktop

Once configured, you can use natural language to interact with Harvest:

Example interactions:

  • "What projects am I assigned to in Harvest?"
  • "Show me my time entries for today"
  • "How many hours have I logged today?"
  • "Show me my time entries for last Monday" (2026-02-03)
  • "Get all time entries from February 1st to February 5th"
  • "Show me time entries for project 67890 this week"
  • "Log 3 hours to project 12345, task 222 with notes 'Fixed authentication bug'"
  • "Start a timer for project 67890, task 222"
  • "Is a timer running?"
  • "Stop my current timer"
  • "Restart timer 123456789"
  • "Delete time entry 123456789"
  • "Show me my Harvest profile"

Troubleshooting

Server not connecting

  • Ensure the build step completed successfully (npm run build)
  • Verify the absolute path in your MCP config points to build/index.js
  • Restart your MCP client after configuration changes

Authentication errors

  • Double-check your Personal Access Token and Account ID
  • Ensure credentials are correctly set in environment variables or passed with tool calls
  • Verify your Harvest account has API access enabled

Missing projects or tasks

  • Ensure you're assigned to the projects in Harvest
  • Only active projects are returned by list_active_projects
  • Check that your user has the necessary permissions

API Reference

This server uses the Harvest API v2. Key endpoints:

  • GET /users/me - Current user information
  • GET /users/me/project_assignments - User's project assignments
  • GET /time_entries - Retrieve time entries
  • POST /time_entries - Create a time entry or start a timer
  • PATCH /time_entries/{id}/stop - Stop a running timer
  • PATCH /time_entries/{id}/restart - Restart a stopped timer
  • DELETE /time_entries/{id} - Delete a time entry

License

ISC

Author

Sebastiaan Pfennigwerth

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

推荐服务器

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

官方
精选