Track Time from Claude Code and Cursor with the Sandtime.io MCP Server

The best moment to log time is the moment you stop typing, and for a developer that moment happens inside an editor or a terminal, not inside a time tracker. Sandtime.io ships an MCP server, so Claude Code, Cursor, Claude Desktop, Codex, and any other Model Context Protocol client can create, read, and fix time entries for you in plain language. This is what it does, how to connect it in one command, and what a real request looks like end to end.

Connect the Sandtime.io MCP server once, then log time by telling your assistant what you did. "Log 2 hours on Project X for yesterday" becomes a proper time entry, checked for overlaps, in the same timesheet your team submits, approves, and locks. Free for unlimited users, including the MCP server and the public API.

  • Claude Code: one claude mcp add command, then sign in from the browser.
  • Cursor: one entry in mcp.json, or the Add to Cursor button on the MCP page.
  • What it does: creates, lists, updates, and stops entries, fills a week, checks timesheet status, builds reports.
  • What it does not do: watch your commits, windows, or keystrokes. You say what you did; it records it.

Written 2026-09-03 against the shipped MCP server and the Claude Code and Cursor releases of that date. Client setup steps change; the MCP page is kept current.

Why time tracking belongs in the coding session

Developers do not forget to track time because they are careless. They forget because the tracker lives in a browser tab that is three context switches away from the terminal, and by the time the tab is open the work has already blurred into the next task. Month-end timesheets then get reconstructed from git history and calendar entries, which is slow and never quite right.

An assistant that already sits in the session changes the geometry. The context is right there: which repository, which ticket, roughly how long. Saying "log that as two hours on the API migration" costs nothing, and the entry lands with the correct project, the correct day, and a start and end time that do not collide with anything else you logged.

The Model Context Protocol is the plumbing that makes this possible. An MCP server exposes tools that a client such as Claude Code or Cursor can call on your behalf. Sandtime.io's server exposes its time tracking as those tools, over Streamable HTTP, with the same permissions your account has in the app.

What the server can do

The full list is on the MCP server page, with every tool's inputs. The ones that matter in a coding session:

  • Time entries: create_activity, update_activity, delete_activity, stop_activity, and list_activities for a date range, plus fill_activities to fill a whole week from a pattern.
  • Projects and people: list_projects, get_project, list_project_members, get_current_user.
  • Timesheet state: get_timesheet_status, lock_timesheet, unlock_timesheet, request_timesheet_unlock, and the approve and reject tools for unlock requests.
  • Reporting: get_time_summary for quick totals, create_report and list_reports for the same reports the web app builds.
  • Calendar: get_calendar returns workdays and public holidays for your organization, so "fill last week, skip the holiday" works without you naming the holiday.

Every write goes through the same overlap detection as the app. If the entry you asked for collides with one already logged, the server returns the conflicts and the assistant tells you instead of silently double-booking the hour. See overlap detection for how that rule works in the product.

Connect Claude Code

The command below is the same one the MCP page shows. It registers the server for your user, so it is available in every project on the machine, and the second command opens your browser to approve access:

claude mcp add --transport http --scope user sandtime https://mcp.sandtime.io/mcp
claude mcp login sandtime

Prefer an API key, for example on a CI box or a machine without a browser? Create one in Sandtime.io under Settings, then Integrations, then API, and pass it as a header:

claude mcp add --transport http --scope user sandtime https://mcp.sandtime.io/mcp --header "Authorization: Bearer YOUR_API_KEY"

Use --scope project instead of --scope user to commit the server to a repository's .mcp.json, so every contributor gets it. Verify with claude mcp list; sandtime should show as connected. Claude Desktop reads a different configuration file; the MCP page has the JSON for it.

Connect Cursor

Cursor reads MCP servers from mcp.json, either globally under ~/.cursor/ or per project under .cursor/. The remote server needs a URL and, until Cursor finishes browser sign-in for it, an API key header:

{
  "mcpServers": {
    "sandtime": {
      "url": "https://mcp.sandtime.io/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

The MCP page has an Add to Cursor button that fills this in for you. Once the server shows green in Cursor's MCP settings, the tools are available in agent mode.

Codex CLI, Gemini CLI, and GitHub Copilot in VS Code follow the same pattern: add the server URL, send the key as a Bearer header, and the tools appear. The MCP page keeps one section per client.

A worked example: "log 2 hours on Project X for yesterday"

Here is what a good assistant does with that sentence, tool by tool. The point of walking through it is to show that nothing is guessed: every step reads before it writes.

If step 3 had shown the afternoon already full, step 4 would not happen. The assistant would report the collision and ask where the two hours should go, which is exactly what a colleague would do before editing your timesheet.

Variations that work the same way:

  • "Fill last week with 8 hours a day on the platform project, skip Friday, it was a holiday" calls get_calendar, then fill_activities.
  • "What did I log this week, by project?" calls get_time_summary.
  • "Stop my timer" calls stop_activity on the entry with no end time.
  • "Is week 35 locked?" calls get_timesheet_status, and "ask for an unlock, I need to fix Tuesday" calls request_timesheet_unlock, which your administrator sees in the app.

What the server will not do

It will not watch you. There is no capture of commits, windows, keystrokes, or screens, on any plan, and none is planned. The assistant only knows what you tell it in the session, and it only writes what you asked for. That is a deliberate choice: an hour you declared is an hour you will stand behind when the timesheet is approved, and a team that trusts its records does not need a surveillance layer to produce them.

It also stays inside your permissions. A User can log and read their own time; an Administrator can lock weeks and resolve unlock requests. The MCP server does not add a back door around the roles in the app.

Is the MCP server free?

Yes. The MCP server and the public API are part of the free product, for unlimited users, with no seat charge and no credit card.

Which clients work?

Claude (web and desktop), Claude Code, Cursor, Codex CLI, Gemini CLI, GitHub Copilot in VS Code, ChatGPT connectors, and any client that speaks MCP over Streamable HTTP. Browser sign-in where the client supports it, an API key header everywhere else.

Do I need an API key?

Not for Claude Code, Claude, or ChatGPT: they sign in through the browser. Cursor, Codex, and most terminal clients need a key today. Create one under Settings, Integrations, API, and revoke it from the same screen if a machine is lost.

Can it log time from my git history automatically?

No, by design. Hours are self-reported declarations. The assistant can read your session and propose an entry, and you confirm it; nothing is written from commits behind your back.

Can my whole team use it?

Yes. Each person connects with their own account and sees their own timesheet. Administrators additionally get the locking and unlock-request tools. Commit the server to a repository's .mcp.json with --scope project and every contributor has it.

Does it work with the Slack integration?

They are independent. Slack handles start, stop, and project commands; MCP handles everything an assistant can ask for. Both write to the same timesheet.

The bottom line

Time tracking fails when it asks people to leave their work to record their work. Putting the tracker inside the assistant that is already in the session removes the trip, and doing it over an open protocol means the same server works in whichever editor the team uses next year.

Open the MCP server page for the client-by-client setup, or create a free account, add the server with the command above, and log the first entry from your next coding session. The developer workflow page covers the rest of the day: tickets, retroactive entries, and the reports your lead will ask for.

About the contributors

Sandtime.io Editorial Team

Sandtime.io Editorial Team

Sandtime.io articles combine product knowledge, source research, and AI-assisted drafting. Every published guide receives human editorial review.

LinkedInWebsite
Przemysław Zalewski

Przemysław Zalewski

Sandtime.io engineer and Sanddev team member who reviews product accuracy, technical details, sources, and editorial quality.

LinkedInEmailSanddev profile

Related articles

Continue reading about time tracking and productivity.

Build vs Buy Time Tracking: What We Learned Retiring Our Own Build

We retired a 7.6-year-old build server and kept the time tracker we built. Here is how to tell which decision you are looking at, with the five-year numbers.

Read article

How to Save Time Using a Time Tracker

Time trackers can help you organize your day, stay on task, and boost your productivity. Learn how to use a time tracker effectively.

Read article

Best Polish Time Tracking Apps 2026

Compare Sandtime.io, TimeCamp, inEwi, and Calamari, the four Polish time tracking tools, and find the right fit for client billing, attendance, or HR.

Read article

Logging Time in a Timesheet

There are many ways of logging time. Some are very cheap but not effective. Check the pros and cons of paper, spreadsheets and app timesheet.

Read article