收获mcp管理员
用于Harvest管理操作的MCP服务器。 仅限管理员 --管理项目、任务、用户、客户和整个团队的时间跟踪。
工具(35)
用户: 列表、获取、创建、更新、停用 项目: 列表、获取、创建、更新、存档、删除 任务: 列表、创建、更新、删除 作业: 将任务/用户分配给项目、删除、列出所有 客户: 列表、创建、更新 团队时间: 查看任何人的条目(默认值:最近7天,每页=50),可选查询/匹配筛选器,为用户编辑/创建条目,可选 external_reference 报告: 按项目/任务/团队/客户划分的全账户 团队概述: 所有用户的每周摘要——找出不完整的时间表 公司: 设置、角色 解析器: 将项目/任务名称或项目代码解析为ID(仅限默认活动) 搜索: 快速搜索用户、项目、任务、客户(结果有限)
设置
快速安装(管理员+时间)
git clone git@github.com:robert-blueshift/harvest-mcp-admin.git
cd harvest-mcp-admin
./scripts/install-global.sh --clone-time --interactive1.获取管理员收获令牌
首选 https://id.getharvest.com/developers:
- 点击 创建新的个人访问令牌
- 将其命名为“Claude MCP管理员”
- 复制您的 代币 和 帐户ID
- 确保您的Harvest用户 管理员 角色
2.安装
git clone git@github.com:robert-blueshift/harvest-mcp-admin.git
cd harvest-mcp-admin
npm install3.添加到克劳德桌面
编辑 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"harvest-admin": {
"command": "node",
"args": ["/path/to/harvest-mcp-admin/index.js"],
"env": {
"HARVEST_ACCESS_TOKEN": "your-admin-token",
"HARVEST_ACCOUNT_ID": "your-account-id",
"HARVEST_RESOLVE_CACHE_TTL_SECONDS": "300"
}
}
}
}管理员还应安装 收割mcp时间 用于个人时间跟踪。
4.重新启动克劳德桌面
终端MCP客户端(无克劳德桌面)
使用本地CLI包装器直接从终端调用工具。
每个命令的作用:
list显示编号的工具列表(使用--json用于原始输出)。call调用一个带有JSON参数的工具并打印JSON结果。
node scripts/mcp-cli.js list
node scripts/mcp-cli.js list --json
node scripts/mcp-cli.js call harvest_admin_list_projects '{"per_page": 25, "summary": true}'NPM快捷方式:
npm run mcp:list
npm run mcp:call -- harvest_admin_list_projects '{"per_page": 25, "summary": true}'
npm run mcp:replREPL命令: 使用 /json 查看原始工具响应; /pretty 切换回来。长结果被分页;按Enter键获取更多信息,或按q键停止。 您可以直接键入工具编号或名称(无需/需要调用)。前缀为/也有效。打字 / 打开工具选择器。 /search 打开实时搜索。 /list 打印完整列表。选项卡填写工具名称。短后缀,如 whoami 在明确无误的情况下被接受。 搜索工具(harvest_admin_search_*)当您跳过JSON参数或直接调用它们而不使用参数时,请使用实时查询提示。
/
/list
/search
1
harvest_admin_list_projects {"per_page":25,"summary":true}
/find project
/call 3 {"per_page":25,"summary":true}
/menu
/last管理员时间输入创建/编辑工具也接受Harvest external_reference 因此,Jira链接的条目在Harvest中保留了它们的结构化图标/链接。
全局命令(可选):
cd /Users/robert/Documents/Projects/harvest-mcp-admin
npm link
harvest-admin
harvest-admin list
harvest-admin call harvest_admin_list_projects '{"per_page": 25, "summary": true}'可选组合命令(admin+time):
harvest list
harvest admin list
harvest time list注: harvest 如果满足以下条件,则默认为时间 harvest-time 链接;否则,它将退回到管理员。 注: harvest time ... 需要 npm link 在收获mcp时间回购中。
全局安装脚本(推荐):
./scripts/install-global.sh如果你还没有收获mcp时间:
./scripts/install-global.sh --clone-time仅管理员安装:
./scripts/install-global.sh --admin-only添加方便别名:
./scripts/install-global.sh --add-aliases提示输入env变量(如果缺少)并添加到~/.zshrc:
./scripts/install-global.sh --set-env引导式设置(环境变量+别名+可选打开+剪贴板):
./scripts/install-global.sh --interactive为方便起见,可选别名:
alias harvest=harvest-admin环境:
HARVEST_ACCESS_TOKEN和HARVEST_ACCOUNT_ID必须设置。- 可选:
HARVEST_RESOLVE_CACHE_TTL_SECONDS,MCP_SERVER_PATH.
使用示例
"Who hasn't submitted their time this week?"
"Create a new project for Acme Corp"
"Add Jessica to the EPC Network project"
"Show me all time logged to ClearScore this month"
"What are the team's hours by client for Q1?"
"Resolve project 'EPC Network' and task 'Design' (active only)"解析器工具示例(返回一个带有ID的小匹配列表):
{
"tool": "harvest_admin_resolve_project_task",
"arguments": {
"project_name": "EPC Network",
"task_name": "Design",
"is_active": true,
"limit": 5,
"match": "contains"
}
}列表工具默认为 summary: true 以保持较小的响应。集 summary: false 如果你需要完整的有效载荷。
