[Integrations](https://hourbun.com/integrations)

# [Connect Claude Code to Hourbun](https://hourbun.com/integrations/claude-code)

By Fred Wu, maker of Hourbun · Checked 13 November 2026 · [Report a mistake](mailto:support@hourbun.com)

## The short answer

Claude Code reaches Hourbun's MCP server with one command in a terminal: claude mcp add, with the address of the server and a token of the page API & MCP in the Authorization header. To sign in to Hourbun instead of a token, add the server without the header and run /mcp in Claude Code. It then tracks time, runs your timer and reads your projects as you, with your role.

## Where in the app

- API & MCP → New token
- API & MCP → Connect an AI assistant

## What you need

- A Hourbun account in an active workspace
- Claude Code in a terminal
- A token of the page API & MCP, or a sign-in to Hourbun with OAuth

## Set it up

The setup that the page API & MCP of Hourbun gives, with the address of the server. In a setup with a token, put the text of your token in the place of `YOUR_TOKEN`.

### Claude Code (Token)

Run it in a terminal. Claude Code can also sign in to Hourbun with OAuth: add the server without the header, then run /mcp in Claude Code.

[Docs of Claude Code](https://code.claude.com/docs/en/mcp)

```
claude mcp add --transport http hourbun https://hourbun.com/api/v1/mcp --header "Authorization: Bearer YOUR_TOKEN"
```

## What to ask

Ask in your own words: the assistant chooses the tools of Hourbun. Under each question, the tools that it calls. The tools of invoices and uninvoiced time answer for the owner and the admins.

- “Log 1.5 hours on Website, Development, for the work of this branch.” Calls `list_projects`, then `create_time_entry`.
- “Start my timer on Website, Development.” Calls `list_projects`, then `start_timer`.
- “Stop my timer, then add the note "Fixed the sign-in bug" to its entry.” Calls `stop_timer`, then `update_time_entry`.
- “Is my timer still running?” Calls `get_timer`.

## A token, or a sign-in

`claude mcp add` adds Hourbun to Claude Code as a server named `hourbun`, with the transport `http` and your token in the header `Authorization`. Run it in a terminal.

To sign in to Hourbun instead of a token, run the same command without `--header` and its value, then run `/mcp` in Claude Code and sign in to Hourbun. When every address that an assistant gives for its answer is on your computer, the page of Hourbun that asks you to allow it says so: allow it only for a connection that you started there.

A sign-in puts no secret in the command, and so none in the history of your shell. A token suits a machine where you cannot sign in with a browser.

## Make a token

On the page **API & MCP** of Hourbun, **New token** opens a form with the **Name**, the **Access** and **Expires after**. Name the token after Claude Code, so that the list says where it is used. **Read** lets Claude Code read your projects, clients, time and expenses; **Read and write** also lets it track time and use your timer. A token can end after 7, 30, 90 or 365 days, or never.

**Create token** shows the text of the token once, with **Copy token**. Under **Use it with an AI assistant**, choose Claude Code: its setup has the token in it, and **Copy setup** copies it whole. After **Done**, no page shows the token again: Hourbun keeps only a secure hash of it. The token acts as you, in this workspace and with your role, until it expires or you revoke it.

## Allow the connection

When Claude Code opens Hourbun, sign in, and Hourbun asks you to allow it. The page names Claude Code and where Hourbun sends your answer. Choose the **Workspace** and the **Access**: **Read**, or **Read and write** to also track time and use your timer. Then press **Allow**, or **Deny**.

The connection works in that one workspace, with your role there. Hourbun keeps it as a token of yours, with an access token that lives 1 hour and a refresh token that ends after 90 days without use, both only as secure hashes. The access of a connection never changes: for other access, connect Claude Code again.

## What Claude Code can do

Hourbun has one MCP tool for each operation of its API, and Claude Code gets only the tools that your role and the access allow. With **Read**, it reads your projects, clients, tasks, time entries, timer and expenses. With **Read and write**, it also tracks time, changes and deletes your time entries, and starts, pauses, resumes, stops and discards your timer. Invoices and uninvoiced time are for the owner and the admins of the workspace: a member or a manager gets no tool for them.

Each tool calls what the REST API calls, so Claude Code gets the same answers, amounts and refusals as a script. An entry on an issued invoice, or an approved or submitted one, is locked, and a money field that your role does not see is left out. Hourbun keeps no prompt and no chat: a tool receives only its arguments.

## Stop the connection

Each token and each connection is in the list of the page **API & MCP**, with its access, its status and the day of its last use. **Revoke** ends it at once, and Hourbun refuses the next request of Claude Code. The owner and the admins of the workspace can revoke it too, and it stops when you leave the workspace.

## Questions and answers

### Can Claude Code track my time in Hourbun?

Yes. With a token or a connection with Read and write, Claude Code records time entries, changes them, and starts, pauses, resumes and stops your timer, as you and with your role.

### Does Claude Code need a token for Hourbun?

No. Claude Code can sign in to Hourbun with OAuth: add the server without the header, then run /mcp in Claude Code. A token in the header works too.

### Can Claude Code delete my time in Hourbun?

With Read and write, it can delete a time entry that is not locked, and discard your timer. Neither can be undone, and the description of each of these tools asks the assistant to confirm with you first. With Read, it changes nothing.

## Sources

The setup of Claude Code follows its own documents, read on 13 November 2026:

- [Claude Code documentation](https://code.claude.com/docs/en/mcp)

## Related

- [The MCP server in the API reference](https://hourbun.com/developers#mcp)
- [Time tracking in the help centre](https://hourbun.com/help/time-tracking)
- [Time tracking apps with an MCP server](https://hourbun.com/best/time-tracking-apps-with-an-mcp-server)
- [ChatGPT](https://hourbun.com/integrations/chatgpt)
- [Claude](https://hourbun.com/integrations/claude)
- [Codex](https://hourbun.com/integrations/codex)
- [Cursor](https://hourbun.com/integrations/cursor)
- [VS Code](https://hourbun.com/integrations/vscode)
- [Gemini CLI](https://hourbun.com/integrations/gemini-cli)
- [All integrations](https://hourbun.com/integrations)
