Home · Guides

How to track billable hours inside Claude Code and Cursor

If you bill by the hour and you already spend the day inside Claude Code or Cursor, the timesheet is the part that gets lost. You finish a task, move to the next one, and at the end of the week you reconstruct Tuesday from git history. The MCP Time Tracker puts the timer where the work happens: you say "start a timer for Acme, task API refactor", keep working, and later ask for the week's hours. Entries are plain JSON under your home directory. Nothing is uploaded.

Install it

One command for Claude Code:

claude mcp add time-tracker -- npx -y @theluckystrike/mcp-time-tracker

Cursor reads the same kind of config. Add this to ~/.cursor/mcp.json (or the project-level .cursor/mcp.json), then restart Cursor:

{
  "mcpServers": {
    "time-tracker": {
      "command": "npx",
      "args": ["-y", "@theluckystrike/mcp-time-tracker"]
    }
  }
}

Claude Desktop uses claude_desktop_config.json with exactly the same block. There is no account, no API key and no login step: the server runs locally over stdio and writes to ~/.local/share/mcp-servers/time-tracker/.

The four things you actually do

Start and stop a timer. Say "start tracking time on the Acme website project". Only one timer runs at a time, so starting a second one stops and logs the first. "Stop the timer and tell me how long I worked" closes it and writes the entry.

Log time you forgot. The timer is not the only path in. "Log 2.5 hours yesterday for Acme, design review, at 90 euros an hour" writes a complete entry: project, task, duration, rate and currency. The rate accepts the words you said, so "90 euros an hour" stores 90 EUR rather than defaulting to dollars.

Get a report. "How many hours did I put into Acme this week, grouped by task" returns totals in hours and money. Grouping works by project, day, task or tag.

Turn it into invoice lines. "Give me invoice lines for Acme in August" returns one line per task with hours, rate and amount, plus a total. Those lines feed straight into an invoice PDF if you also run the invoice server.

What the audit measured

The servers were driven by the real Claude CLI as an MCP client against a fresh data directory, with prompts phrased the way a person phrases them and no tool names mentioned. Starting the timer, stopping it, and logging a forgotten 2.5 hour entry each completed in a single tool call: one call, one correct result, no clarifying question. The weekly billing question took three calls, because the model asked for a report and then invoice lines separately. Round trip times were 8.6 s, 9.4 s and 10.0 s for the single-call steps.

The same audit found two real defects and both are fixed in the shipped server. The currency in "90 euros an hour" used to be dropped, so a report printed dollars for euro work; entry_add now takes a currency, in words or as an ISO code. Project names that differed only in phrasing ("the Acme website project" and "for Acme") used to create two projects and split the week's billing; a partial name that matches exactly one existing project now resolves to that project.

Money arithmetic

Hours are stored as seconds and money as integer minor units. An entry's amount is computed from seconds and the rate in one rounding step, then summed, so the total of a report equals the sum of the lines you can see. There is no floating point drift between what the report shows and what you invoice.

Free tier and Pro

Free gives unlimited timers and entries, reports and CSV export over the last 7 days, and two projects with an hourly rate. Pro ($19 once, lifetime) opens full history, invoice summaries, grouping by tag and unlimited rated projects. The full comparison is in free versus Pro. Product page: MCP Time Tracker.

Questions

Does this work in Cursor as well as Claude Code?

Yes. Both speak MCP over stdio. Claude Code takes the claude mcp add command; Cursor reads the same JSON block from ~/.cursor/mcp.json. The tools and the data directory are identical.

Where is my time data stored?

In plain JSON under ~/.local/share/mcp-servers/time-tracker/ (or $XDG_DATA_HOME if you set it). Writes are atomic. Nothing is sent to a server, and there is no account to create.

Can I bill in euros if my other projects are in dollars?

Yes. Currency is per entry and per project. entry_add takes a currency as an ISO code or as words such as 'euros'. If you give neither, it falls back to the project currency and then to USD.

What happens when the free 7 day window runs out?

Nothing is deleted. Entries keep accumulating; reports, listings and CSV exports cover the last 7 days until you activate a Pro key, which opens the whole history.

Does it work offline?

Yes. The server never makes a network call, and Pro keys are Ed25519 signatures verified locally, so activation works on a machine with no internet connection.

Related

All MCP servers and prices · All guides