You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds the CLI examples, the authorization rule (token must own / session / admin), and the two new MCP tool rows (`update_entry`, `delete_entry`). Also two example prompts that exercise the new tools.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Duration formats accepted: `1h`, `45m`, `1h30m`, `1.5h`, `1:30`, or a bare number (interpreted as minutes — e.g. `90` → 1h 30m).
58
64
65
+
**Edit / delete authorization:** an API token can only modify entries it created itself. JWT sessions (the web UI) and admin tokens bypass this rule. Invoiced entries are locked for everyone via the API. A 403 with a friendly message is returned on a denied attempt — fix the entry from the web UI or with the token that created it.
66
+
59
67
## Use it as an MCP server
60
68
61
69
The same binary speaks MCP over stdio when invoked with `timebook mcp`. Drop it into any MCP-aware host (Claude Code, Claude Desktop, Codex, Cursor, …):
@@ -90,16 +98,18 @@ The MCP server reuses the token saved by `timebook login` — run `timebook logi
|`whoami`| Current authenticated user (read-only) |
104
+
|`list_projects`| All projects in scope (read-only) |
105
+
|`list_clients`| All clients in scope (read-only) |
106
+
|`get_active_timer`| The running timer, or `null` (read-only) |
107
+
|`start_timer`| Start a timer on a project |
108
+
|`stop_timer`| Stop the running timer |
109
+
|`log_time`| Log a manual entry (`duration` OR `startTime`+`endTime`) |
110
+
|`list_entries`| Recent entries (default 50, max 500), project + date filters |
111
+
|`update_entry`| Edit one or more fields on an entry (description, duration, startTime, endTime, project, rate). Token must own the entry. |
112
+
|`delete_entry`| Delete an entry. Token must own it. Invoiced entries are locked. |
103
113
104
114
### Try it with prompts
105
115
@@ -110,6 +120,8 @@ Once the MCP server is connected, ask the model in plain English:
110
120
-_"Log 1 hour 30 minutes against ChatNexus from 9am this morning at the Software Development rate, with description 'code review of the auth refactor'."_
111
121
-_"What am I currently working on?"_ — invokes `get_active_timer`.
112
122
-_"Stop my timer."_
123
+
-_"My last entry on Recycler should be 2 hours, not 1h45m. Fix it."_ — invokes `list_entries` then `update_entry`.
124
+
-_"Delete the entry I just made by mistake."_ — invokes `delete_entry`. Will 403 if the entry was created by a different token (web UI, another agent) — say so to the model so it doesn't keep retrying.
113
125
114
126
The model picks the right tool, asks `list_projects` first if it needs to disambiguate a name, and writes through `start_timer` / `log_time` / `stop_timer`.
0 commit comments