horas-mcp
horas-mcp
本地 MCP 服务器,用于按 Jira 卡片/子任务控制工时——计时器、暂停、修正、报表和待登记工时控制。100% 本地(JSON 文件),不依赖 Jira API。运行在 Node 18+,并可作为单个文件分发。
使用流程(与 agent 对话)
你说 | 发生什么 |
"开始 SUB-456" | 启动计时器(自动停止上一个) |
"暂停" / "我回来了" | 暂停 / 恢复(午休、会议) |
"我完成了" | 关闭会话并显示实际时间 + 取整时间 |
"我在 9 点开始了 SUB-456" | 回溯开始时间 |
"我昨天在 SUB-457 工作了 1h30" | 手动登记记录 |
"今日报告 / 本周报告" | 按卡片表格,包含待登记项 |
"我登记了 SUB-456" | 标记为已登记(从待登记中移除) |
正式的工时登记由你在 Jira 手动完成——报表会显示 worklog 格式的取整值(2h 30m)以及可作为评论使用的会话备注。
构建
npm install
npm run build # dist/index.js (ESM, para desenvolvimento)
npm run bundle # dist/horas.cjs — ARQUIVO ÚNICO, autocontido, Node 18+在公司电脑上安装(GitHub Copilot / VS Code)
只复制 dist/horas.cjs 到机器上(例如:C:\Users\voce\horas\horas.cjs),并在 VS Code 中注册——Ctrl+Shift+P → "MCP: Open User Configuration"(或工作区的 .vscode/mcp.json):
{
"servers": {
"horas": {
"type": "stdio",
"command": "node",
"args": ["C:/Users/voce/horas/horas.cjs"],
"env": { "HORAS_BLOCO_MIN": "15", "HORAS_ARREDONDAR": "cima" }
}
}
}无需 npm install、无需构建——只需要 Node 18+ 和该文件。这些工具会出现在 Copilot Chat 的 agent mode 中。
SQLite 替代方案:使用 node-22/dist/horas-sqlite.cjs(也是单个文件,需 Node 22.13+;数据存放在 ~/.horas/horas.db)。请选择其中一种——两种方案的数据不互通。
在 Claude Code 中安装
claude mcp add --scope user horas -- node D:/Gabriel/Projetos/horas/dist/horas.cjs配置(环境变量)
变量 | 默认值 | 描述 |
|
| 取整区块大小(分钟)( |
|
| 模式: |
|
| 超过此时长的未关闭会话视为被遗忘的计时器 |
|
| 数据文件路径(JSON,原子写入) |
暴露的工具
iniciar_tarefa · pausar_tarefa · retomar_tarefa · parar_tarefa · status_atual · registrar_manual · editar_sessao · excluir_sessao · relatorio · marcar_apontado
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Log time on Trello cards and read time reports. Free during early access.
Track billable time from your AI chat: timers, entries, reports, CSV export. All data stays local.
Track billable time from your AI chat: timers, entries, reports, CSV export. All data stays local.
Personal time tracker: start timers, log time and summarize your hours by activity.