@togglhq/mcp 1.13.362 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,17 +1,64 @@
1
- # Toggl 2.0 MCP Server
1
+ # Toggl MCP
2
2
 
3
- A local MCP (Model Context Protocol) server that connects to the Toggl 2.0 API. Works with any MCP client including Claude Code and Claude Desktop.
3
+ Connect Claude, VS Code, Cursor and other MCP clients to Toggl 2.0: tasks, projects, time entries and workspace operations. Setup guide: [docs.toggl.com/toggl-mcp-and-cli](https://docs.toggl.com/toggl-mcp-and-cli).
4
4
 
5
- The server supports MCP `2026-07-28` and keeps compatibility with legacy MCP clients. JSON tool results include `structuredContent` for modern clients and a text fallback for older clients.
5
+ ## Remote MCP (recommended)
6
+
7
+ Add Toggl's remote MCP server to your client. There is nothing to install, and the client signs you in through your browser on first use.
8
+
9
+ | Region | URL |
10
+ | ------ | -------------------------------- |
11
+ | US | `https://focus.toggl.com/mcp` |
12
+ | EU | `https://focus.eu.toggl.com/mcp` |
13
+
14
+ [![Install in VS Code](https://img.shields.io/badge/Install_in-VS_Code-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect/mcp/install?name=toggl&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Ffocus.toggl.com%2Fmcp%22%7D)
15
+ [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/install-mcp?name=toggl&config=eyJ1cmwiOiJodHRwczovL2ZvY3VzLnRvZ2dsLmNvbS9tY3AifQ%3D%3D)
16
+
17
+ The one-click buttons use the US URL; EU accounts should add the EU URL by hand.
18
+
19
+ ### Claude Code
20
+
21
+ ```bash
22
+ claude mcp add --transport http toggl https://focus.toggl.com/mcp
23
+ ```
24
+
25
+ Then run `/mcp` in Claude Code to sign in.
26
+
27
+ ### Claude Desktop and claude.ai
28
+
29
+ Open **Settings → Connectors → Add custom connector** and paste the URL for your region.
30
+
31
+ ## Hosted relay (clients that only run local servers)
6
32
 
7
- ## One-click install
33
+ If your MCP client cannot add a remote server, this package can relay the remote MCP instead. It is off unless you choose it, and an existing install never switches on its own:
8
34
 
9
- [![Install in VS Code](https://img.shields.io/badge/Install_in-VS_Code-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect/mcp/install?name=toggl&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40togglhq%2Fmcp%22%5D%2C%22env%22%3A%7B%7D%7D)
10
- [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/install-mcp?name=toggl&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB0b2dnbGhxL21jcCJdfQ%3D%3D)
35
+ ```json
36
+ {
37
+ "mcpServers": {
38
+ "toggl": {
39
+ "command": "npx",
40
+ "args": ["@togglhq/mcp"],
41
+ "env": { "TOGGL_MCP_MODE": "hosted" }
42
+ }
43
+ }
44
+ }
45
+ ```
46
+
47
+ In the `.mcpb` bundles, set **Connection mode** to `hosted`. Set it back to `local` (or remove `TOGGL_MCP_MODE`) and restart to return to the local tools, profiles and `TOGGL_API_TOKEN`, unchanged.
11
48
 
12
- On first use, call the **auth** MCP tool to sign in (opens your browser). For Claude Code and Claude Desktop, see **Add to your MCP client** below.
49
+ - **Sign-in:** call **hosted-sign-in** (opens your browser) or run `npx @togglhq/mcp auth --hosted` (`--manual` for headless machines). The hosted sign-in is separate from CLI and local MCP profiles and is stored in `~/.toggl/mcp-hosted.json` (mode 0600); refreshing it never touches `focus-tools.json`. **hosted-sign-out** forgets it; **hosted-status** shows the mode, region and sign-in state.
50
+ - **Workspace:** use the hosted `list_workspaces` and `select_workspace` tools. Nothing is selected for you, and the selection is account-wide: it changes the active workspace for every hosted Toggl MCP connection on your account (for example claude.ai). Local profiles and `workspace-switch` do not apply here.
51
+ - **Changes:** in apps that show MCP Apps cards, a hosted tool with its own card is confirmed there. Every other hosted change first returns a `confirm_token` and a summary; repeating the call with that token runs that one action once. Failed calls are never retried; check before repeating.
52
+ - **Not supported in hosted mode:** `TOGGL_API_TOKEN`, custom or staging `TOGGL_FOCUS_API_URL` / `TOGGL_ACCOUNTS_API_URL` (only the exact US and EU addresses; for EU set both to `https://focus.eu.toggl.com` and `https://accounts.eu.toggl.com`), profile pinning, and the local entity tools. The server reports these instead of falling back to local mode.
53
+ - **Limitation:** the sign-in asks Toggl Accounts for the hosted `focus` scope and the `/mcp` resource, but the hosted server does not yet check a token's audience, so the hosted grant is not technically limited to `/mcp`.
13
54
 
14
- ## Install
55
+ ## Local server (legacy)
56
+
57
+ The original local server runs on your machine with Node.js. It is still supported for API-key and custom-URL setups, but new setups should use the remote MCP above.
58
+
59
+ The server supports MCP `2026-07-28` and keeps compatibility with legacy MCP clients. JSON tool results include `structuredContent` for modern clients and a text fallback for older clients.
60
+
61
+ ### Install
15
62
 
16
63
  ```bash
17
64
  npm install @togglhq/mcp
@@ -26,15 +73,15 @@ npx @togglhq/mcp auth
26
73
 
27
74
  For one-off runs without a local install: `npx -y @togglhq/mcp auth`.
28
75
 
29
- ## Add to your MCP client
76
+ ### Add to your MCP client
30
77
 
31
- ### Claude Code
78
+ #### Claude Code
32
79
 
33
80
  ```bash
34
81
  claude mcp add toggl-focus -- npx @togglhq/mcp
35
82
  ```
36
83
 
37
- ### Claude Desktop
84
+ #### Claude Desktop
38
85
 
39
86
  Add to your Claude Desktop config file:
40
87
 
@@ -54,7 +101,7 @@ Add to your Claude Desktop config file:
54
101
 
55
102
  Restart Claude Desktop after saving.
56
103
 
57
- ## Authentication
104
+ ### Authentication
58
105
 
59
106
  Uses **OAuth2 with PKCE** via the Toggl Accounts service. Credentials are stored in `~/.toggl/focus-tools.json` (mode 0600). Access tokens refresh automatically — call **auth** again (or run `npx @togglhq/mcp auth`) to switch workspaces or if your refresh token expires (after 4 weeks of inactivity).
60
107
 
@@ -62,7 +109,7 @@ Uses **OAuth2 with PKCE** via the Toggl Accounts service. Credentials are stored
62
109
 
63
110
  > **Unified config vs legacy file:** MCP **logout** only removes credentials when there is a matching profile row under **`~/.toggl/focus-tools.json`** with **`active.mcp`** set. Call **`auth`** once to migrate into the unified file if logout reports nothing was cleared (or run `npx @togglhq/mcp auth` from a terminal).
64
111
 
65
- ### CI or headless environments
112
+ #### CI or headless environments
66
113
 
67
114
  Set `TOGGL_API_TOKEN` to a personal Toggl API key (`toggl_sk_…`, from Toggl 2.0 **Settings → API token**). It takes precedence over any OAuth profile: no browser opens, nothing refreshes, and nothing is written to `~/.toggl/focus-tools.json`.
68
115
 
@@ -87,9 +134,9 @@ API keys only reach the Toggl 2.0 API. Tools that call Toggl Accounts return `re
87
134
 
88
135
  The `toggl` CLI (`@togglhq/cli`) honours the same variables; `--workspace-id` overrides `TOGGL_WORKSPACE_ID` there. The key is never logged and is redacted from error reports.
89
136
 
90
- ## Tools
137
+ ### Tools
91
138
 
92
- ### Entity tools
139
+ #### Entity tools
93
140
 
94
141
  One tool per domain (for example `tasks`, `projects`, `time-entries`, `organization`). Each tool accepts:
95
142
 
@@ -100,11 +147,11 @@ One tool per domain (for example `tasks`, `projects`, `time-entries`, `organizat
100
147
 
101
148
  **Mutation confirmation:** mutating tools return `confirm_required` with a `confirm_token` on the first call; repeat with `confirm_token` to execute.
102
149
 
103
- ### Deep links
150
+ #### Deep links
104
151
 
105
152
  - **deep-links** — read-only, no API calls. `action: "get"` returns the Toggl 2.0 web URL for a `task`, `project`, `time_entry`, `calendar_day`, `report` or `member` in the active organization and workspace, on the profile's environment (production or staging). It also returns a Track URL where the IDs map (members, by organization user ID); otherwise `track.url` is `null` with a `note` saying why. A time entry needs `task_id` to open directly; `calendar_day` opens the calendar on the week of its `date`. Example: `{ "action": "get", "data": { "entity": "report", "report_type": "detailed", "period": "prevMonth" } }`.
106
153
 
107
- ### Workspace, profiles, and auth
154
+ #### Workspace, profiles, and auth
108
155
 
109
156
  - **workspace-list** — list workspaces (`refresh: true` refetches from Accounts)
110
157
  - **workspace-switch** — set the active workspace
package/build/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as PUBLIC_SENTRY_PRIVACY_OPTIONS, c as initProductAnalytics, d as shutdownProductAnalytics, i as runMcpCli, l as resolveProductAnalyticsDistinctId, o as captureToolInvocation, s as getProductAnalyticsDistinctId, u as resolvePublicSentryDsn } from "./src-DI5YCPP6.js";
2
+ import { a as PUBLIC_SENTRY_PRIVACY_OPTIONS, c as initProductAnalytics, d as shutdownProductAnalytics, i as runMcpCli, l as resolveProductAnalyticsDistinctId, o as captureToolInvocation, s as getProductAnalyticsDistinctId, u as resolvePublicSentryDsn } from "./src-Xaefc7X0.js";
3
3
  import * as Sentry from "@sentry/node";
4
4
  //#region src/analytics-tool-metadata.ts
5
5
  /**
@@ -162,7 +162,7 @@ function wrapServerWithProductAnalytics(server) {
162
162
  }
163
163
  //#endregion
164
164
  //#region src/cli.ts
165
- const packageVersion = "1.13.362";
165
+ const packageVersion = "1.14.1";
166
166
  let sentryEnabled = false;
167
167
  let productAnalyticsEnabled = false;
168
168
  runMcpCli({
package/build/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { i as runMcpCli, n as MCP_MAX_TOOL_INPUT_ELEMENTS, r as bootstrapServer, t as MCP_CACHE_TTL_MS } from "./src-DI5YCPP6.js";
2
+ import { i as runMcpCli, n as MCP_MAX_TOOL_INPUT_ELEMENTS, r as bootstrapServer, t as MCP_CACHE_TTL_MS } from "./src-Xaefc7X0.js";
3
3
  export { MCP_CACHE_TTL_MS, MCP_MAX_TOOL_INPUT_ELEMENTS, bootstrapServer, runMcpCli };