hubstify-mcp

hubstify-mcp

MCP server enabling natural language interaction with Hubstaff data, including organizations, projects, members, tasks, and tracked-time activities.

Category
访问服务器

README

hubstaff-mcp

A Model Context Protocol (MCP) server for Hubstaff. Operate your Hubstaff organizations, projects, tasks, members, tracked-time activities and timesheets through any MCP-compatible LLM client — read your timesheet, log time, and inspect your team in natural language.

Built on FastMCP and scaffolded from the-momentum/python-ai-kit.

Connect it to your LLM

You need two things: a Hubstaff Personal Access Token, and one config entry in your client. No clone requireduv runs the server straight from GitHub.

1. Get a Personal Access Token at developer.hubstaff.com/account/personal-access-tokens. That's the value of HUBSTAFF_PERSONAL_ACCESS_TOKEN in the steps below.

2. Add the server to your client:

Claude Code

claude mcp add hubstaff \
  -e HUBSTAFF_PERSONAL_ACCESS_TOKEN=your_pat_here \
  -- uvx --from git+https://github.com/farce1/hubstify-mcp.git hubstaff-mcp

claude mcp list should then show hubstaff connected. Add -s user to enable it across all your projects.

Claude Desktop / Claude Cowork

Edit claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\). Cowork shares the same desktop MCP configuration:

{
  "mcpServers": {
    "hubstaff": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/farce1/hubstify-mcp.git", "hubstaff-mcp"],
      "env": { "HUBSTAFF_PERSONAL_ACCESS_TOKEN": "your_pat_here" }
    }
  }
}

Restart the app afterward. A ready-to-edit copy is in claude_desktop_config.example.json.

Cursor

Create .cursor/mcp.json in your project (or ~/.cursor/mcp.json for all projects) with the same mcpServers block shown above for Claude Desktop.

Codex

Add to ~/.codex/config.toml:

[mcp_servers.hubstaff]
command = "uvx"
args = ["--from", "git+https://github.com/farce1/hubstify-mcp.git", "hubstaff-mcp"]
env = { HUBSTAFF_PERSONAL_ACCESS_TOKEN = "your_pat_here" }

Prefer a local clone? After git clone … && uv sync, replace the launch command everywhere above with uv --directory /absolute/path/to/hubstify-mcp run hubstaff-mcp.

3. Try it — ask your assistant:

  • "Who am I on Hubstaff?"get_current_user
  • "Show my tracked time this week."get_time_entries
  • "Give me my timesheet summary for last month."get_timesheet
  • "What projects and tasks am I assigned to?"get_projects + get_tasks
  • "Log 2 hours to project Acme today with note 'API integration'."log_time

Tools

Tool Kind Description
get_current_user read The authenticated user (you)
get_organizations read Organizations you belong to
get_projects read Projects in an organization (defaults to your default org)
get_tasks read Tasks in a project
get_members read Members of an organization
get_teams read Teams in an organization
get_time_entries read Your tracked time per day for a period (optional project filter)
get_timesheet read Your tracked time summarised per project for a period
log_time create Create a manual time entry for yourself
create_task create Create a task in a project
hubstaff_get read Guarded raw GET for organizations/*, users/*, projects/*

Hubstaff v2 limitation: time entries are create-only. The v2 API has no endpoint to edit or delete a tracked-time entry, so this server intentionally does not expose update/delete tools — do that in the Hubstaff web app. Tracked time is read via daily activities.

Highlights

  • 🔑 PAT auth with automatic access-token refresh and rotation handling (the rotated refresh token is persisted; the token endpoint's 5/hour limit is respected)
  • ⏱️ Read tracked time and per-project timesheets over natural periods ("this week", "last month", …)
  • ✍️ Log manual time entries and create tasks
  • 🛡️ Rate-limit aware (honors Retry-After, backs off on 5xx) with cursor pagination
  • 🧰 A guarded read-only escape hatch for endpoints without a dedicated tool

Other ways to install

The config above needs no clone, but the same hubstaff-mcp command is available via:

uv tool install git+https://github.com/farce1/hubstify-mcp.git   # persistent, on PATH
pipx run --spec git+https://github.com/farce1/hubstify-mcp.git hubstaff-mcp   # pipx
pip install git+https://github.com/farce1/hubstify-mcp.git       # into a venv

# From source (development):
git clone https://github.com/farce1/hubstify-mcp.git && cd hubstify-mcp && uv sync

Environment variables

Variable Required Default Description
HUBSTAFF_PERSONAL_ACCESS_TOKEN Your Hubstaff Personal Access Token
HUBSTAFF_TOKEN_STORE ~/.hubstaff-mcp/tokens.json Where the rotated token cache is persisted
HUBSTAFF_DEFAULT_ORGANIZATION_ID first org Organization id used when a tool isn't given one
DEFAULT_TIMEZONE UTC IANA timezone for resolving "today"/"this week" and localizing naive start times
MCP_TRANSPORT stdio stdio for local clients, or http to self-host (see below)
MCP_HOST 127.0.0.1 Bind address when MCP_TRANSPORT=http
MCP_PORT 8000 Port when MCP_TRANSPORT=http

Hubstaff rotates the refresh token on every exchange; this server persists the newest token (mode 0600) so it survives restarts. If you revoke the token, update HUBSTAFF_PERSONAL_ACCESS_TOKEN and delete the token store file.

Troubleshooting

  • HUBSTAFF_PERSONAL_ACCESS_TOKEN is not set — the env var didn't reach the server; check the env block in your client config.
  • Auth errors after it worked before — the token may have been revoked or rotated out of band. Update HUBSTAFF_PERSONAL_ACCESS_TOKEN and delete ~/.hubstaff-mcp/tokens.json.
  • Wrong day for "today"/"this week" — set DEFAULT_TIMEZONE (e.g. Europe/Warsaw); Hubstaff buckets daily activity by timezone.

Self-hosting over HTTP

By default the server talks stdio (the client spawns it as a subprocess). To run it as a long-lived HTTP service instead, set MCP_TRANSPORT=http:

HUBSTAFF_PERSONAL_ACCESS_TOKEN=your_pat MCP_TRANSPORT=http MCP_PORT=8000 \
  uvx --from git+https://github.com/farce1/hubstify-mcp.git hubstaff-mcp

The endpoint is then http://<host>:<port>/mcp, which any HTTP-capable MCP client can connect to.

⚠️ Single-user only. The server acts as the one identity behind HUBSTAFF_PERSONAL_ACCESS_TOKEN — every request reads and writes that account's Hubstaff data. Do not expose this endpoint to other people or the public internet; keep it bound to localhost or your private network and put your own authentication in front of it. Multi-tenant hosting (each user with their own Hubstaff token) is not yet supported.

Development

make install     # uv sync --all-groups
make test        # pytest
make lint        # ruff check
make typecheck   # ty check
make check       # lint + typecheck + tests + format check

Architecture

A thin, layered design (each layer has one responsibility):

app/
├── domain/        # Pydantic models + value objects (Duration, DateRange)
├── hubstaff/      # auth (token rotation) + HTTP client (retry, pagination)
├── repositories/  # one per aggregate: endpoints + envelope -> domain models
├── services/      # use-case logic (date normalization, timesheet projection)
└── mcp/           # FastMCP tools (thin adapters) + composition root

License

MIT — see LICENSE.

推荐服务器

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

官方
精选