@tobiashochguertel/taskbook-mcp-server 1.9.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alexander Davidsen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,438 @@
1
+ ---
2
+ title: Taskbook MCP Server
3
+ description: Model Context Protocol server that exposes Taskbook task management to LLM clients — GitHub Copilot, Claude Desktop, Cursor, and more
4
+ last_updated: 2025-07-18
5
+ ---
6
+
7
+ # 🎯 Taskbook MCP Server
8
+
9
+ > **Model Context Protocol (MCP) server for [Taskbook](https://github.com/hochguertel/taskbook)** — manage tasks, notes, and boards from any MCP-compatible AI tool.
10
+
11
+ The `taskbook-mcp` server connects LLM clients (GitHub Copilot, Claude Desktop, Cursor, OpenCode, etc.) to a Taskbook sync server, providing 14 tools and 4 resources for full task management through natural language.
12
+
13
+ ---
14
+
15
+ ## 📋 Table of Contents
16
+
17
+ - [Quick Start](#-quick-start)
18
+ - [AI Tool Configuration](#-ai-tool-configuration)
19
+ - [Available MCP Tools](#-available-mcp-tools)
20
+ - [Available MCP Resources](#-available-mcp-resources)
21
+ - [Environment Variables](#-environment-variables)
22
+ - [HTTP Transport & DevOps](#-http-transport--devops)
23
+ - [Architecture](#-architecture)
24
+ - [Development](#-development)
25
+
26
+ ---
27
+
28
+ ## 🚀 Quick Start
29
+
30
+ ### Prerequisites
31
+
32
+ 1. A running **Taskbook sync server** (e.g. `https://taskbook.hochguertel.work`)
33
+ 2. Authenticated via the `tb` CLI — run `tb --login` to create `~/.taskbook.json`
34
+ 3. **Bun** runtime (v1.3+) installed
35
+
36
+ ### Install & Run (stdio)
37
+
38
+ ```bash
39
+ # Clone and build
40
+ cd packages/taskbook-mcp-server
41
+ bun install
42
+ bun run build
43
+
44
+ # Run in stdio mode (default) — used by all local AI tools
45
+ bun run src/index.ts
46
+
47
+ # Or build a standalone binary
48
+ bun run build:standalone
49
+ ./dist/taskbook-mcp --help
50
+ ```
51
+
52
+ The server reads credentials from `~/.taskbook.json` automatically. No extra configuration needed if you've already logged in with `tb --login`.
53
+
54
+ ---
55
+
56
+ ## 🔧 AI Tool Configuration
57
+
58
+ All local AI tools use **stdio transport** — the tool spawns `taskbook-mcp` as a child process and communicates over stdin/stdout.
59
+
60
+ ### GitHub Copilot CLI
61
+
62
+ Add to `~/.copilot/mcp-config.json`:
63
+
64
+ ```json
65
+ {
66
+ "mcpServers": {
67
+ "taskbook": {
68
+ "command": "bun",
69
+ "args": ["run", "/path/to/taskbook-mcp-server/src/index.ts"]
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ Or with the standalone binary:
76
+
77
+ ```json
78
+ {
79
+ "mcpServers": {
80
+ "taskbook": {
81
+ "command": "/path/to/taskbook-mcp"
82
+ }
83
+ }
84
+ }
85
+ ```
86
+
87
+ ### VS Code (GitHub Copilot)
88
+
89
+ Add to `.vscode/mcp.json` in your workspace or `~/.vscode/mcp.json` globally:
90
+
91
+ ```json
92
+ {
93
+ "servers": {
94
+ "taskbook": {
95
+ "command": "bun",
96
+ "args": ["run", "/path/to/taskbook-mcp-server/src/index.ts"],
97
+ "env": {}
98
+ }
99
+ }
100
+ }
101
+ ```
102
+
103
+ ### Claude Desktop
104
+
105
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
106
+
107
+ ```json
108
+ {
109
+ "mcpServers": {
110
+ "taskbook": {
111
+ "command": "bun",
112
+ "args": ["run", "/path/to/taskbook-mcp-server/src/index.ts"],
113
+ "env": {}
114
+ }
115
+ }
116
+ }
117
+ ```
118
+
119
+ ### Cursor
120
+
121
+ Add to `~/.cursor/mcp.json`:
122
+
123
+ ```json
124
+ {
125
+ "mcpServers": {
126
+ "taskbook": {
127
+ "command": "bun",
128
+ "args": ["run", "/path/to/taskbook-mcp-server/src/index.ts"]
129
+ }
130
+ }
131
+ }
132
+ ```
133
+
134
+ ### OpenCode
135
+
136
+ Add to `~/.config/opencode/config.json`:
137
+
138
+ ```json
139
+ {
140
+ "mcp": {
141
+ "taskbook": {
142
+ "command": "bun",
143
+ "args": ["run", "/path/to/taskbook-mcp-server/src/index.ts"]
144
+ }
145
+ }
146
+ }
147
+ ```
148
+
149
+ > 💡 **Tip:** Replace `/path/to/taskbook-mcp-server` with the actual absolute path, or use the standalone binary path after running `bun run build:standalone`.
150
+
151
+ ### Using Environment Variables (all tools)
152
+
153
+ If you don't have `~/.taskbook.json`, pass credentials via environment variables in any config above:
154
+
155
+ ```json
156
+ {
157
+ "env": {
158
+ "TB_SERVER_URL": "https://taskbook.hochguertel.work",
159
+ "TB_TOKEN": "your-session-token",
160
+ "TB_ENCRYPTION_KEY": "your-encryption-key"
161
+ }
162
+ }
163
+ ```
164
+
165
+ ---
166
+
167
+ ## 🛠 Available MCP Tools
168
+
169
+ | Tool | Description | Parameters |
170
+ | ------------------- | ---------------------------------------------------- | --------------------------------------------- |
171
+ | `list_tasks` | List all tasks, optionally filtered by board | `board?` |
172
+ | `create_task` | Create a new task on a board | `description`, `board?`, `priority?`, `tags?` |
173
+ | `complete_task` | Toggle a task's completion status | `task_id` |
174
+ | `begin_task` | Toggle a task's in-progress status | `task_id` |
175
+ | `set_task_priority` | Set priority level (1=normal, 2=medium, 3=high) | `task_id`, `priority` |
176
+ | `list_notes` | List all notes, optionally filtered by board | `board?` |
177
+ | `create_note` | Create a new note on a board | `description`, `board?`, `body?`, `tags?` |
178
+ | `list_boards` | List all boards with item counts | — |
179
+ | `move_item` | Move a task or note to a different board | `item_id`, `target_board` |
180
+ | `search_items` | Search tasks and notes by description, tag, or board | `query` |
181
+ | `edit_item` | Edit an item's description | `item_id`, `description` |
182
+ | `delete_item` | Permanently delete a task or note | `item_id` |
183
+ | `archive_item` | Move an item to the archive | `item_id` |
184
+ | `star_item` | Toggle the star/bookmark on an item | `item_id` |
185
+ | `get_status` | Server health, user info, and item statistics | — |
186
+
187
+ ---
188
+
189
+ ## 📦 Available MCP Resources
190
+
191
+ | URI | Name | Description |
192
+ | ------------------------------- | ----------- | --------------------------------------------------- |
193
+ | `taskbook://status` | `status` | Server health and authenticated user info (JSON) |
194
+ | `taskbook://boards/{boardName}` | `board` | Tasks and notes on a specific board (JSON, dynamic) |
195
+ | `taskbook://items` | `all-items` | All tasks and notes across all boards (JSON) |
196
+ | `taskbook://archive` | `archive` | All archived tasks and notes (JSON) |
197
+
198
+ The `board` resource is dynamic — it lists available boards and lets clients browse individual board contents.
199
+
200
+ ---
201
+
202
+ ## 📝 Environment Variables
203
+
204
+ | Variable | Default | Description |
205
+ | --------------------- | ----------------------- | ------------------------------------------ |
206
+ | `TB_MCP_TRANSPORT` | `stdio` | Transport type: `stdio` or `http` |
207
+ | `TB_MCP_PORT` | `3100` | HTTP transport listen port |
208
+ | `TB_MCP_HOST` | `127.0.0.1` | HTTP transport bind address |
209
+ | `TB_MCP_ACCESS_TOKEN` | — | Bearer token required for HTTP connections |
210
+ | `TB_SERVER_URL` | from `~/.taskbook.json` | Taskbook sync server URL |
211
+ | `TB_TOKEN` | from `~/.taskbook.json` | Taskbook session/auth token |
212
+ | `TB_ENCRYPTION_KEY` | from `~/.taskbook.json` | AES-256-GCM client-side encryption key |
213
+ | `TB_CONFIG_PATH` | `~/.taskbook.json` | Path to taskbook configuration file |
214
+
215
+ Environment variables **override** values from `~/.taskbook.json`. If all three `TB_SERVER_URL`, `TB_TOKEN`, and `TB_ENCRYPTION_KEY` are set, the config file is not read at all.
216
+
217
+ ---
218
+
219
+ ## 🌐 HTTP Transport & DevOps
220
+
221
+ The HTTP transport enables **multi-client** deployments with session management using MCP Streamable HTTP (not SSE — that protocol is deprecated).
222
+
223
+ ### Starting HTTP Mode
224
+
225
+ ```bash
226
+ # Via environment variable
227
+ TB_MCP_TRANSPORT=http bun run src/index.ts
228
+
229
+ # Via CLI flag
230
+ taskbook-mcp --transport=http --port=3100 --host=0.0.0.0
231
+ ```
232
+
233
+ **Endpoints:**
234
+
235
+ | Endpoint | Method | Description |
236
+ | --------- | -------- | ----------------------------------------------------------- |
237
+ | `/mcp` | `POST` | MCP JSON-RPC requests (initialize + tool calls) |
238
+ | `/mcp` | `GET` | Server-to-client streaming (SSE fallback for notifications) |
239
+ | `/mcp` | `DELETE` | Close a session |
240
+ | `/health` | `GET` | Health check — returns `{ "status": "ok" }` |
241
+
242
+ Sessions are tracked via the `mcp-session-id` header. Each session gets its own `TaskbookClient` instance.
243
+
244
+ ### Bearer Token Authentication
245
+
246
+ Set `TB_MCP_ACCESS_TOKEN` to require a Bearer token on all HTTP requests:
247
+
248
+ ```bash
249
+ TB_MCP_TRANSPORT=http TB_MCP_ACCESS_TOKEN=my-secret-token taskbook-mcp
250
+ ```
251
+
252
+ Clients must send `Authorization: Bearer my-secret-token` on every request.
253
+
254
+ ### Docker
255
+
256
+ ```bash
257
+ # Build the image
258
+ docker build -f packages/taskbook-mcp-server/Dockerfile -t taskbook-mcp .
259
+
260
+ # Run
261
+ docker run -p 3100:3100 \
262
+ -e TB_SERVER_URL=https://taskbook.hochguertel.work \
263
+ -e TB_TOKEN=your-token \
264
+ -e TB_ENCRYPTION_KEY=your-key \
265
+ taskbook-mcp
266
+ ```
267
+
268
+ The Dockerfile uses a **multi-stage build**: Bun compiles a standalone binary in stage 1, then copies it to a minimal `distroless` runtime image.
269
+
270
+ ### Docker Compose
271
+
272
+ The MCP server is available as a Docker Compose profile:
273
+
274
+ ```bash
275
+ # Start with MCP server
276
+ docker compose --profile mcp up -d
277
+
278
+ # Set credentials via .env or shell
279
+ TB_TOKEN=your-token TB_ENCRYPTION_KEY=your-key docker compose --profile mcp up -d
280
+ ```
281
+
282
+ The compose service (`mcp-server`) connects to the Taskbook server internally at `http://server:8080`.
283
+
284
+ ### Reverse Proxy (Traefik)
285
+
286
+ When running behind Traefik or another reverse proxy with Authelia/OIDC:
287
+
288
+ ```yaml
289
+ # Example Traefik labels
290
+ labels:
291
+ - "traefik.enable=true"
292
+ - "traefik.http.routers.taskbook-mcp.rule=Host(`mcp.example.com`)"
293
+ - "traefik.http.routers.taskbook-mcp.entrypoints=websecure"
294
+ - "traefik.http.routers.taskbook-mcp.tls.certresolver=letsencrypt"
295
+ - "traefik.http.services.taskbook-mcp.loadbalancer.server.port=3100"
296
+ # Authelia middleware for OAuth2/OIDC
297
+ - "traefik.http.routers.taskbook-mcp.middlewares=authelia@docker"
298
+ ```
299
+
300
+ For OIDC flows, the client obtains a token from the identity provider and passes it as a Bearer token. Set `TB_MCP_ACCESS_TOKEN` to validate tokens at the MCP layer, or rely on the reverse proxy for authentication.
301
+
302
+ ---
303
+
304
+ ## 🏗 Architecture
305
+
306
+ ```mermaid
307
+ graph TB
308
+ subgraph "AI Clients"
309
+ GH[GitHub Copilot CLI]
310
+ VS[VS Code / Copilot]
311
+ CL[Claude Desktop]
312
+ CU[Cursor / OpenCode]
313
+ end
314
+
315
+ subgraph "taskbook-mcp"
316
+ IDX[index.ts<br/>Entry Point]
317
+ CFG[config.ts<br/>Config Loader]
318
+ SRV[server.ts<br/>MCP Server Factory]
319
+
320
+ subgraph "Transports"
321
+ STDIO[stdio.ts<br/>Single Client]
322
+ HTTP[http.ts<br/>Multi Client + Sessions]
323
+ end
324
+
325
+ subgraph "Tools"
326
+ TT[tasks.ts<br/>5 tools]
327
+ TN[notes.ts<br/>2 tools]
328
+ TB_TOOLS[boards.ts<br/>2 tools]
329
+ TG[general.ts<br/>6 tools]
330
+ end
331
+
332
+ subgraph "Resources"
333
+ RES[index.ts<br/>4 resources]
334
+ end
335
+
336
+ subgraph "Client"
337
+ API[api.ts<br/>TaskbookClient]
338
+ CRYPTO[crypto.ts<br/>AES-256-GCM]
339
+ end
340
+ end
341
+
342
+ subgraph "Backend"
343
+ TBSRV[Taskbook Sync Server]
344
+ DB[(Database)]
345
+ end
346
+
347
+ GH & VS & CL & CU -->|stdio / HTTP| IDX
348
+ IDX --> CFG
349
+ IDX -->|stdio| STDIO
350
+ IDX -->|http| HTTP
351
+ STDIO & HTTP --> SRV
352
+ SRV --> TT & TN & TB_TOOLS & TG & RES
353
+ TT & TN & TB_TOOLS & TG & RES --> API
354
+ API --> CRYPTO
355
+ API -->|REST + encrypted payloads| TBSRV
356
+ TBSRV --> DB
357
+ ```
358
+
359
+ ### Key Design Decisions
360
+
361
+ - **Client-side encryption**: All data is encrypted with AES-256-GCM before leaving the MCP server. The Taskbook sync server never sees plaintext.
362
+ - **Per-session clients**: HTTP transport creates a separate `TaskbookClient` per session, enabling multi-user deployments.
363
+ - **Zod schemas**: All tool parameters are validated with Zod at the MCP protocol level.
364
+ - **Bun runtime**: Uses Bun for fast startup, native TypeScript execution, and `bun build --compile` for standalone binaries.
365
+
366
+ ---
367
+
368
+ ## 👩‍💻 Development
369
+
370
+ ### Building from Source
371
+
372
+ ```bash
373
+ cd packages/taskbook-mcp-server
374
+
375
+ # Install dependencies
376
+ bun install
377
+
378
+ # Development mode (watch + auto-reload)
379
+ bun run dev
380
+
381
+ # Type checking
382
+ bun run typecheck
383
+
384
+ # Linting (Biome)
385
+ bun run lint
386
+
387
+ # Build (bundled JS)
388
+ bun run build
389
+
390
+ # Build standalone binary
391
+ bun run build:standalone
392
+
393
+ # Run tests
394
+ bun test
395
+
396
+ # Clean build artifacts
397
+ bun run clean
398
+ ```
399
+
400
+ ### Project Structure
401
+
402
+ ```
403
+ src/
404
+ ├── index.ts # Entry point, CLI arg parsing
405
+ ├── server.ts # MCP server factory, tool/resource registration
406
+ ├── config.ts # Config loading (~/.taskbook.json + env vars)
407
+ ├── client/
408
+ │ ├── api.ts # TaskbookClient — REST API + encryption
409
+ │ └── crypto.ts # AES-256-GCM encrypt/decrypt helpers
410
+ ├── tools/
411
+ │ ├── tasks.ts # list, create, complete, begin, set_priority
412
+ │ ├── notes.ts # list, create
413
+ │ ├── boards.ts # list, move_item
414
+ │ └── general.ts # search, edit, delete, archive, star, get_status
415
+ ├── transport/
416
+ │ ├── stdio.ts # Stdio transport (single client)
417
+ │ └── http.ts # HTTP Streamable transport (multi client)
418
+ └── resources/
419
+ └── index.ts # MCP resources (status, boards, items, archive)
420
+ ```
421
+
422
+ ### Tech Stack
423
+
424
+ | Component | Technology |
425
+ | ---------- | ------------------------------------------------------------------------------------------- |
426
+ | Runtime | [Bun](https://bun.sh) 1.3+ |
427
+ | MCP SDK | [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) ^1.14.0 |
428
+ | Validation | [Zod](https://zod.dev) ^3.25 |
429
+ | Language | TypeScript (ESNext, strict mode) |
430
+ | Linter | [Biome](https://biomejs.dev) |
431
+ | Build | `bun build` (bundled) / `bun build --compile` (standalone) |
432
+
433
+ ### Contributing
434
+
435
+ 1. Fork the repository
436
+ 2. Create a feature branch: `git checkout -b feat/my-feature`
437
+ 3. Make changes and ensure `bun run typecheck && bun run lint && bun test` pass
438
+ 4. Submit a pull request