Productive.io MCP服务器
MCP(模型上下文协议)服务器 产品.io 它使像Claude这样的人工智能助手能够与您的Productive.io工作区进行交互,管理项目、任务、时间条目、预算等。
支持两种运输方式:
- 标准 (默认)--Claude将其作为本地子进程启动
- 超文本传输协议 (与
--httpflag)--作为Express web服务器运行,供远程/团队使用
先决条件
- Node.js 18+
- A. 产品.io 具有API访问权限的帐户
- API代币 --在Productive.io的“设置”下生成一个→ API集成
- 组织ID --在您的Productive.io帐户设置中找到
安装
git clone productive-mcp-server
cd productive-mcp-server
npm install
cp .env.example .env
# Edit .env with your credentials
npm run build配置
| 变量 | 必填 | 描述 |
|---|---|---|
PRODUCTIVE_API_TOKEN | 是 | 您的Productive.io API令牌 |
PRODUCTIVE_ORG_ID | 是 | 您的Productive.io组织ID |
PORT | 否 | HTTP服务器端口(默认值:3000) |
跑步
stdio模式(默认-本地使用)
# Development
npm run dev
# Production (after build)
npm startHTTP模式(用于远程/团队使用)
# Development
npm run dev:http
# Production (after build)
npm run start:httpHTTP服务器公开:
POST /mcp--MCP协议端点GET /health--健康检查
连接到克劳德桌面
将此添加到您的Claude Desktop配置中(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):
{
"mcpServers": {
"productive": {
"command": "node",
"args": ["/absolute/path/to/productive-mcp-server/dist/index.js"],
"env": {
"PRODUCTIVE_API_TOKEN": "your_api_token_here",
"PRODUCTIVE_ORG_ID": "your_org_id_here"
}
}
}
}连接到克劳德代码
stdio模式
claude mcp add productive -- node /absolute/path/to/productive-mcp-server/dist/index.js在运行Claude Code之前设置环境变量,或将其添加到shell配置文件中:
export PRODUCTIVE_API_TOKEN=your_api_token_here
export PRODUCTIVE_ORG_ID=your_org_id_hereHTTP模式
先启动服务器:
cd /path/to/productive-mcp-server
PRODUCTIVE_API_TOKEN=your_token PRODUCTIVE_ORG_ID=your_org npm run start:http然后连接克劳德代码:
claude mcp add productive --transport http http://localhost:3000/mcp连接到VS代码
添加到您的VS Code用户设置JSON(.vscode/settings.json 或用户设置):
stdio模式
{
"mcp": {
"servers": {
"productive": {
"command": "node",
"args": ["/absolute/path/to/productive-mcp-server/dist/index.js"],
"env": {
"PRODUCTIVE_API_TOKEN": "your_api_token_here",
"PRODUCTIVE_ORG_ID": "your_org_id_here"
}
}
}
}
}HTTP模式
{
"mcp": {
"servers": {
"productive": {
"type": "http",
"url": "http://localhost:3000/mcp"
}
}
}
}可用工具
| 工具 | 说明 | 关键参数 |
|---|---|---|
productive_list_projects | 列出/搜索项目 | company_id, project_type_id, status, query |
productive_get_project | 按ID获取项目 | id, include |
productive_create_project | 创建项目 | name, project_type_id, company_id |
productive_update_project | 更新项目 | id, name, project_type_id |
productive_list_tasks | 列出/筛选任务 | project_id, assignee_id, status, query |
productive_get_task | 按ID获取任务 | id, include |
productive_create_task | 创建任务 | title, task_list_id, assignee_id |
productive_update_task | 更新任务 | id, title, closed, assignee_id |
productive_list_time_entries | 列出时间条目 | person_id, project_id, after, before |
productive_log_time | 记录时间条目 | person_id, service_id, date, time |
productive_list_people | 列出团队成员 | status, company_id, query |
productive_get_person | 按ID获取人员 | id, include |
productive_list_deals | 列出预算/交易 | project_id, company_id, deal_status |
productive_get_deal | 通过ID获取交易 | id, include |
productive_list_companies | 列出公司 | status, query |
productive_get_company | 按ID获取公司 | id, include |
productive_list_bookings | 列出预订 | person_id, project_id, after, before |
productive_list_services | 列出服务 | deal_id |
发票工具(仅草稿)
所有发票工具创建和管理 仅发票草稿。最终确定(分配发票编号)必须始终在Productive.io UI中手动完成。
| 工具 | 说明 | 关键参数 |
|---|---|---|
productive_list_invoices | 列出/筛选发票 | company_id, deal_id, invoice_status,日期范围 |
productive_get_invoice | 获取包含行项目的完整发票详细信息 | id |
productive_create_invoice | 创建新的空发票草稿 | company_id, document_type_id, subsidiary_id |
productive_update_invoice | 更新发票草稿 | id, subject, note,日期 |
productive_create_invoice_from_previous | 克隆发票(行项目+预算链接) | source_invoice_id,可选覆盖 |
productive_create_invoice_like_last_for_client | 克隆客户的最新发票 | company_id, how_many_back |
productive_list_line_items | 列出发票的行项目 | invoice_id |
productive_create_line_item | 在发票草稿中添加行项目 | invoice_id, description, quantity, unit_price, unit_id |
productive_update_line_item | 更新现有行项目 | id, description, quantity, unit_price |
productive_delete_line_item | 删除行项目 | id |
productive_list_invoice_attributions | 列出发票的预算链接 | invoice_id |
productive_create_invoice_attribution | 将发票草稿链接到预算 | invoice_id, deal_id, amount |
productive_list_document_types | 列出可用的文档类型 | subsidiary_id, status |
productive_list_subsidiaries | 列出贵公司的子公司 | status |
productive_list_tax_rates | 列出可用税率 | status |
所有列表工具支持 page, page_size,以及 sort 参数。
MCP检验员测试
npx @modelcontextprotocol/inspector node dist/index.js这将打开一个交互式UI来测试每个工具。
速率限制
Productive.io强制执行:
- 每10秒100个请求
- 每30分钟4000个请求
服务器实现了429个响应的指数回退自动重试(最多3次重试)。
