projectx mcp
记录小时数 项目X 通过与Claude Desktop交谈。
“今天记录8小时的Ontrac” “用Ontrac填写本周缺失的天数” “这个月我错过了哪些日子?”
______________________________________________________________________
安装
macOS(自动)
git clone git@github.com:agustindiezdb/projectx-mcp.git
cd projectx-mcp
bash scripts/install.sh脚本将:
- 安装依赖项
- 构建项目
- 自动配置克劳德桌面
- 创建现有配置的备份
然后 重新启动克劳德桌面.Chrome将自动打开,以便使用您的Dualboot Google帐户登录。
就是这样! 你现在可以让克劳德记录你的工作时间。
______________________________________________________________________
视窗
git clone git@github.com:agustindiezdb/projectx-mcp.git
cd projectx-mcp
npm install
npm run build然后 手动编辑Claude Desktop配置:
打开: %APPDATA%\Claude\claude_desktop_config.json
添加:
{
"mcpServers": {
"projectx": {
"command": "node",
"args": ["C:\\full\\path\\to\\projectx-mcp\\dist\\src\\server.js"]
}
}
}替换 C:\\full\\path\\to\\ 与您的实际路径(使用 \\ Windows路径)。
然后 重新启动克劳德桌面.Chrome将自动打开进行登录。
______________________________________________________________________
手动安装
如果您更喜欢手动配置:
- 克隆和构建:
git clone git@github.com:agustindiezdb/projectx-mcp.git
cd projectx-mcp
npm install
npm run build- 编辑Claude桌面配置:\
打开 ~/Library/Application Support/Claude/claude_desktop_config.json 并添加:
{
"mcpServers": {
"projectx": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/projectx-mcp/dist/src/server.js"]
}
}
}替换 /ABSOLUTE/PATH/TO/ 带有克隆仓库的完整路径。
- 重新启动克劳德桌面
______________________________________________________________________
与光标一起使用
游标使用 每个项目 MCP配置。创建 .cursor/mcp.json 在项目根目录中:
{
"$schema": "https://json.schemastore.org/mcp.json",
"mcpServers": {
"projectx": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/projectx-mcp/dist/src/server.js"]
}
}
}替换 /ABSOLUTE/PATH/TO/ 带有克隆仓库的完整路径。
然后重新启动Cursor。第一次,Chrome将打开登录。
______________________________________________________________________
用法
自然地和克劳德谈谈:
Log 8 hours of Ontrac for today with description "Sprint planning"Check my entries for this week and fill the missing days with 8h of OntracDelete yesterday's entry and log 4h of Internal — AdministrativeWhich days am I missing hours for April?______________________________________________________________________
可用工具
| 工具 | 说明 |
|---|---|
get_time_entries | 查看日期范围的条目 |
get_projects | 列出可用项目 |
create_time_entry | 创建条目 |
delete_time_entry | 按ID删除条目 |
______________________________________________________________________
如果登录失败或会话过期
只需重新启动Claude Desktop。Chrome将再次打开供您登录。
______________________________________________________________________
有用的脚本
您也可以在不使用Claude Desktop的情况下直接使用API:
# Test the API (creates and deletes a test entry)
npm run test:entry
# Check which days you're missing hours in April
npx ts-node scripts/check-april.ts
# Manually refresh your session (if expired)
npm run save-session______________________________________________________________________
面向开发者
建筑
Claude Desktop → MCP Server (stdio) → fetch() + _interslice_session cookie → ProjectX API会话cookie存储在 ~/Library/Application Support/projectx-mcp/auth.json (忽略了)。
启动时,如果找不到有效的会话,Chrome会自动打开,通过Playwright登录。
开发模式
npm run dev这将运行服务器 ts-node 用于快速开发(无需构建步骤)。
运作原理
- 认证:使用Playwright打开Chrome,并通过轮询自动检测登录是否成功
/api/v1/current_user - 会话持续:将Cookie保存到
auth.json使用剧作家storageState() - API客户端:阅读
_interslice_sessioncookie,并向ProjectX发出经过身份验证的请求 - MCP协议:通过stdio传输将4个工具暴露给Claude Desktop
Claude桌面配置(手动)
如果您更喜欢手动编辑:
{
"mcpServers": {
"projectx": {
"command": "node",
"args": ["/path/to/projectx-mcp/dist/src/server.js"]
}
}
}故障排除
- 会话已过期 → 重启克劳德桌面,Chrome会自动打开
- 未找到Chrome → 安装谷歌Chrome浏览器(必须在系统PATH中)
- 未找到项目 → 让克劳德跑
get_projects查看确切名称 - 路径问题(macOS/Linux) → 使用绝对路径,而不是
~或相对路径 - 路径问题(Windows) → use
\\JSON路径中的(双反斜杠),例如。C:\\Users\\... - 身份验证文件位置:
- macOS: ~/Library/Application Support/projectx-mcp/auth.json - 窗户: %APPDATA%\projectx-mcp\auth.json - Linux: ~/.config/projectx-mcp/auth.json
______________________________________________________________________
需求
- 操作系统: macOS、Windows或Linux
- Node.js: 20+
- 浏览器: 谷歌Chrome浏览器(自动登录所需)
- 克劳德桌面版
- 双引导谷歌帐户
______________________________________________________________________
许可证
Dualboot合作伙伴的内部工具。
