taskover-mcp 1.0.1 → 1.2.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.
@@ -0,0 +1,1433 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { Server } = require("@modelcontextprotocol/sdk/server/index.js");
4
+ const { StdioServerTransport } = require("@modelcontextprotocol/sdk/server/stdio.js");
5
+ const {
6
+ ListToolsRequestSchema,
7
+ CallToolRequestSchema,
8
+ } = require("@modelcontextprotocol/sdk/types.js");
9
+
10
+ // SECURITY: Mode selection — API key (headless) or browser auth (default).
11
+ const CLOUD_MODE = !!process.env.TASKOVER_API_KEY;
12
+ const BROWSER_AUTH_MODE = !CLOUD_MODE;
13
+
14
+ // SECURITY: Refuse API key passed as CLI argument
15
+ if (process.argv.some(arg => arg.startsWith("tok_"))) {
16
+ console.error("[SECURITY] API keys must not be passed as command-line arguments.");
17
+ console.error("Use the TASKOVER_API_KEY environment variable instead.");
18
+ process.exit(1);
19
+ }
20
+
21
+ const cloudAdapter = require("./cloud-adapter.js");
22
+ const { TOOL_MAP: toolMap, validateSchema } = require("./tool-map.js");
23
+ let authFlow;
24
+
25
+ if (CLOUD_MODE) {
26
+ cloudAdapter.init(process.env.TASKOVER_API_KEY);
27
+ } else {
28
+ authFlow = require("./auth-flow.js");
29
+ }
30
+
31
+ const server = new Server(
32
+ { name: "taskover.gg", version: "1.0.0" },
33
+ { capabilities: { tools: {} } }
34
+ );
35
+
36
+ // ===== TOOL DEFINITIONS =====
37
+
38
+ const TOOLS = [
39
+ // --- Dashboard & Context ---
40
+ {
41
+ name: "taskovergg_dashboard",
42
+ description: "Get full project dashboard: system counts, open bugs, task board, last session. Use at start of every new chat.",
43
+ inputSchema: {
44
+ type: "object",
45
+ properties: {
46
+ project_id: { type: "string", description: "Project ID (e.g. 'village', 'room-06')" },
47
+ },
48
+ required: ["project_id"],
49
+ },
50
+ },
51
+ {
52
+ name: "taskovergg_context_export",
53
+ description: "Generate full context dump — all systems, bugs, tasks, last session, decisions. Paste into new chats.",
54
+ inputSchema: {
55
+ type: "object",
56
+ properties: { project_id: { type: "string" } },
57
+ required: ["project_id"],
58
+ },
59
+ },
60
+ {
61
+ name: "taskovergg_search",
62
+ description: "Search across all project data — tasks, systems, sessions, bugs, blueprints, notes.",
63
+ inputSchema: {
64
+ type: "object",
65
+ properties: {
66
+ project_id: { type: "string" },
67
+ query: { type: "string", description: "Search term" },
68
+ },
69
+ required: ["project_id", "query"],
70
+ },
71
+ },
72
+
73
+ // --- Projects ---
74
+ {
75
+ name: "taskovergg_list_projects",
76
+ description: "List all projects.",
77
+ inputSchema: { type: "object", properties: {} },
78
+ },
79
+ {
80
+ name: "taskovergg_add_project",
81
+ description: `DO NOT call this tool directly. Projects must be created by the user on the TaskOver website.
82
+
83
+ Instead of calling this tool, instruct the user with these steps:
84
+ 1. Go to taskover.gg and log in
85
+ 2. Click the project dropdown in the top-left of the sidebar
86
+ 3. Click "+ New Project" at the bottom of the dropdown
87
+ 4. Follow the 5-step project creation wizard:
88
+ - Step 1: Enter the project name and description
89
+ - Step 2: Choose a project color/icon
90
+ - Step 3: Set up initial systems (or skip)
91
+ - Step 4: Configure project settings
92
+ - Step 5: Review and confirm
93
+ 5. Once the project appears in the project list, tell the AI the project name so it can begin adding tasks, systems, and other data to it via MCP.
94
+
95
+ After the user confirms the project exists, use taskovergg_list_projects to find the project_id, then use other tools (taskovergg_add_task, taskovergg_add_system, etc.) to populate it.`,
96
+ inputSchema: {
97
+ type: "object",
98
+ properties: {
99
+ name: { type: "string" },
100
+ description: { type: "string" },
101
+ trello_board_id: { type: "string" },
102
+ },
103
+ required: ["name"],
104
+ },
105
+ },
106
+
107
+ // --- Tasks (replaces To Do / Doing / Done / Scrapped) ---
108
+ {
109
+ name: "taskovergg_get_tasks",
110
+ description: "Get tasks filtered by status and/or phase. Statuses: todo, doing, done, scrapped.",
111
+ inputSchema: {
112
+ type: "object",
113
+ properties: {
114
+ project_id: { type: "string" },
115
+ status: { type: "string", enum: ["todo", "doing", "done", "scrapped"] },
116
+ phase: { type: "string" },
117
+ },
118
+ required: ["project_id"],
119
+ },
120
+ },
121
+ {
122
+ name: "taskovergg_add_task",
123
+ description: "Add a task (idea, feature, to-do item).",
124
+ inputSchema: {
125
+ type: "object",
126
+ properties: {
127
+ project_id: { type: "string" },
128
+ title: { type: "string" },
129
+ description: { type: "string" },
130
+ status: { type: "string", enum: ["todo", "doing", "done", "scrapped"] },
131
+ phase: { type: "string" },
132
+ priority: { type: "string", enum: ["high", "medium", "low"] },
133
+ tags: { type: "array", items: { type: "string" } },
134
+ checklist: { type: "array", items: { type: "object", properties: { text: { type: "string" }, done: { type: "boolean" } } } },
135
+ },
136
+ required: ["project_id", "title"],
137
+ },
138
+ },
139
+ {
140
+ name: "taskovergg_update_task",
141
+ description: "Update a task's fields.",
142
+ inputSchema: {
143
+ type: "object",
144
+ properties: {
145
+ task_id: { type: "string" },
146
+ title: { type: "string" },
147
+ description: { type: "string" },
148
+ status: { type: "string", enum: ["todo", "doing", "done", "scrapped"] },
149
+ phase: { type: "string" },
150
+ priority: { type: "string", enum: ["high", "medium", "low"] },
151
+ tags: { type: "array", items: { type: "string" } },
152
+ checklist: { type: "array", items: { type: "object", properties: { text: { type: "string" }, done: { type: "boolean" } } } },
153
+ },
154
+ required: ["task_id"],
155
+ },
156
+ },
157
+ {
158
+ name: "taskovergg_move_task",
159
+ description: "Move task between columns (todo/doing/done/scrapped).",
160
+ inputSchema: {
161
+ type: "object",
162
+ properties: {
163
+ task_id: { type: "string" },
164
+ status: { type: "string", enum: ["todo", "doing", "done", "scrapped"] },
165
+ },
166
+ required: ["task_id", "status"],
167
+ },
168
+ },
169
+ {
170
+ name: "taskovergg_add_task_comment",
171
+ description: "Add a comment to a task (replaces Trello card comments).",
172
+ inputSchema: {
173
+ type: "object",
174
+ properties: {
175
+ task_id: { type: "string" },
176
+ text: { type: "string" },
177
+ },
178
+ required: ["task_id", "text"],
179
+ },
180
+ },
181
+
182
+ // --- Systems (replaces Claude Memory documentation cards) ---
183
+ {
184
+ name: "taskovergg_get_systems",
185
+ description: "Get all systems/features for a project with status, files, rules, notes.",
186
+ inputSchema: {
187
+ type: "object",
188
+ properties: { project_id: { type: "string" } },
189
+ required: ["project_id"],
190
+ },
191
+ },
192
+ {
193
+ name: "taskovergg_add_system",
194
+ description: "Document a new system/feature. Include critical rules and notes.",
195
+ inputSchema: {
196
+ type: "object",
197
+ properties: {
198
+ project_id: { type: "string" },
199
+ name: { type: "string" },
200
+ description: { type: "string" },
201
+ status: { type: "string", enum: ["working", "wip", "broken", "planned"] },
202
+ key_files: { type: "string" },
203
+ notes: { type: "string" },
204
+ critical_rules: { type: "string" },
205
+ },
206
+ required: ["project_id", "name"],
207
+ },
208
+ },
209
+ {
210
+ name: "taskovergg_update_system",
211
+ description: "Update a system's status, description, notes, or rules.",
212
+ inputSchema: {
213
+ type: "object",
214
+ properties: {
215
+ system_id: { type: "string" },
216
+ name: { type: "string" },
217
+ description: { type: "string" },
218
+ status: { type: "string", enum: ["working", "wip", "broken", "planned"] },
219
+ key_files: { type: "string" },
220
+ notes: { type: "string" },
221
+ critical_rules: { type: "string" },
222
+ },
223
+ required: ["system_id"],
224
+ },
225
+ },
226
+
227
+ // --- Sessions (replaces Claude Chat Memory) ---
228
+ {
229
+ name: "taskovergg_get_sessions",
230
+ description: "Get recent work sessions with what was done and where we left off.",
231
+ inputSchema: {
232
+ type: "object",
233
+ properties: {
234
+ project_id: { type: "string" },
235
+ limit: { type: "number" },
236
+ },
237
+ required: ["project_id"],
238
+ },
239
+ },
240
+ {
241
+ name: "taskovergg_log_session",
242
+ description: "Log a work session. Call at end of each chat (replaces !chatsave). Include what was done, where we left off, and next steps.",
243
+ inputSchema: {
244
+ type: "object",
245
+ properties: {
246
+ project_id: { type: "string" },
247
+ title: { type: "string" },
248
+ summary: { type: "string" },
249
+ what_we_did: { type: "array", items: { type: "string" } },
250
+ where_we_left_off: { type: "string" },
251
+ next_steps: { type: "array", items: { type: "string" } },
252
+ systems_worked_on: { type: "array", items: { type: "string" } },
253
+ },
254
+ required: ["project_id", "title"],
255
+ },
256
+ },
257
+
258
+ // --- Changelog ---
259
+ {
260
+ name: "taskovergg_get_changelog",
261
+ description: "Get recent changelog entries.",
262
+ inputSchema: {
263
+ type: "object",
264
+ properties: {
265
+ project_id: { type: "string" },
266
+ limit: { type: "number" },
267
+ },
268
+ required: ["project_id"],
269
+ },
270
+ },
271
+ {
272
+ name: "taskovergg_add_changelog",
273
+ description: "Log changes made. Include list of specific changes and affected systems.",
274
+ inputSchema: {
275
+ type: "object",
276
+ properties: {
277
+ project_id: { type: "string" },
278
+ title: { type: "string" },
279
+ changes: { type: "array", items: { type: "string" } },
280
+ systems_affected: { type: "array", items: { type: "string" } },
281
+ },
282
+ required: ["project_id", "title", "changes"],
283
+ },
284
+ },
285
+
286
+ // --- Bugs ---
287
+ {
288
+ name: "taskovergg_get_bugs",
289
+ description: "Get bugs, optionally filtered by status (open/fixed/wontfix).",
290
+ inputSchema: {
291
+ type: "object",
292
+ properties: {
293
+ project_id: { type: "string" },
294
+ status: { type: "string", enum: ["open", "fixed", "wontfix"] },
295
+ },
296
+ required: ["project_id"],
297
+ },
298
+ },
299
+ {
300
+ name: "taskovergg_add_bug",
301
+ description: "Report a bug with priority and steps to reproduce.",
302
+ inputSchema: {
303
+ type: "object",
304
+ properties: {
305
+ project_id: { type: "string" },
306
+ system_id: { type: "string" },
307
+ title: { type: "string" },
308
+ description: { type: "string" },
309
+ priority: { type: "string", enum: ["high", "medium", "low"] },
310
+ steps_to_reproduce: { type: "string" },
311
+ },
312
+ required: ["project_id", "title"],
313
+ },
314
+ },
315
+ {
316
+ name: "taskovergg_fix_bug",
317
+ description: "Mark a bug as fixed with a description of the fix.",
318
+ inputSchema: {
319
+ type: "object",
320
+ properties: {
321
+ bug_id: { type: "string" },
322
+ fix_description: { type: "string" },
323
+ },
324
+ required: ["bug_id"],
325
+ },
326
+ },
327
+
328
+ // --- Decisions ---
329
+ {
330
+ name: "taskovergg_get_decisions",
331
+ description: "Get design decisions for a project.",
332
+ inputSchema: {
333
+ type: "object",
334
+ properties: { project_id: { type: "string" } },
335
+ required: ["project_id"],
336
+ },
337
+ },
338
+ {
339
+ name: "taskovergg_log_decision",
340
+ description: "Log a design decision with context and alternatives considered.",
341
+ inputSchema: {
342
+ type: "object",
343
+ properties: {
344
+ project_id: { type: "string" },
345
+ decision: { type: "string" },
346
+ context: { type: "string" },
347
+ system_id: { type: "string" },
348
+ alternatives: { type: "string" },
349
+ },
350
+ required: ["project_id", "decision"],
351
+ },
352
+ },
353
+
354
+ // --- Blueprints ---
355
+ {
356
+ name: "taskovergg_get_blueprints",
357
+ description: "Get all registered Blueprints for a project.",
358
+ inputSchema: {
359
+ type: "object",
360
+ properties: { project_id: { type: "string" } },
361
+ required: ["project_id"],
362
+ },
363
+ },
364
+ {
365
+ name: "taskovergg_add_blueprint",
366
+ description: "Register a Blueprint with path, parent class, variables, and key functions.",
367
+ inputSchema: {
368
+ type: "object",
369
+ properties: {
370
+ project_id: { type: "string" },
371
+ name: { type: "string" },
372
+ path: { type: "string" },
373
+ parent_class: { type: "string" },
374
+ system_id: { type: "string" },
375
+ description: { type: "string" },
376
+ variables: { type: "array", items: { type: "string" } },
377
+ key_functions: { type: "array", items: { type: "string" } },
378
+ },
379
+ required: ["project_id", "name"],
380
+ },
381
+ },
382
+ {
383
+ name: "taskovergg_update_blueprint",
384
+ description: "Update a registered Blueprint.",
385
+ inputSchema: {
386
+ type: "object",
387
+ properties: {
388
+ blueprint_id: { type: "string" },
389
+ name: { type: "string" },
390
+ path: { type: "string" },
391
+ parent_class: { type: "string" },
392
+ description: { type: "string" },
393
+ variables: { type: "array", items: { type: "string" } },
394
+ key_functions: { type: "array", items: { type: "string" } },
395
+ },
396
+ required: ["blueprint_id"],
397
+ },
398
+ },
399
+
400
+ // --- Blueprint Graphs ---
401
+ {
402
+ name: "taskovergg_get_blueprint_graphs",
403
+ description: "Get all visual diagram graphs for a blueprint, including nodes, connections, and layout.",
404
+ inputSchema: {
405
+ type: "object",
406
+ properties: { blueprint_id: { type: "string" } },
407
+ required: ["blueprint_id"],
408
+ },
409
+ },
410
+ {
411
+ name: "taskovergg_set_blueprint_graph",
412
+ description: "Set a complete visual diagram graph on a blueprint. Creates or replaces a named graph with nodes, pins, and connections.",
413
+ inputSchema: {
414
+ type: "object",
415
+ properties: {
416
+ blueprint_id: { type: "string" },
417
+ graph_name: { type: "string", description: "Graph name, e.g. 'EventGraph'" },
418
+ graph_type: { type: "string", enum: ["event", "function", "macro"] },
419
+ nodes: {
420
+ type: "array",
421
+ items: {
422
+ type: "object",
423
+ properties: {
424
+ id: { type: "string" }, type: { type: "string" }, title: { type: "string" },
425
+ subtitle: { type: "string" }, x: { type: "number" }, y: { type: "number" },
426
+ comment: { type: "string" }, pure: { type: "boolean" },
427
+ pins: { type: "array", items: { type: "object",
428
+ properties: { id: { type: "string" }, name: { type: "string" }, direction: { type: "string" }, type: { type: "string" } },
429
+ required: ["id", "name", "direction", "type"] } },
430
+ },
431
+ required: ["id", "type", "title", "x", "y", "pins"],
432
+ },
433
+ },
434
+ connections: {
435
+ type: "array",
436
+ items: { type: "object",
437
+ properties: { id: { type: "string" }, sourceNodeId: { type: "string" }, sourcePinId: { type: "string" }, targetNodeId: { type: "string" }, targetPinId: { type: "string" } },
438
+ required: ["id", "sourceNodeId", "sourcePinId", "targetNodeId", "targetPinId"] },
439
+ },
440
+ },
441
+ required: ["blueprint_id", "graph_name", "nodes", "connections"],
442
+ },
443
+ },
444
+ {
445
+ name: "taskovergg_add_graph_nodes",
446
+ description: "Add nodes and connections to an existing blueprint graph without replacing existing data.",
447
+ inputSchema: {
448
+ type: "object",
449
+ properties: {
450
+ blueprint_id: { type: "string" },
451
+ graph_name: { type: "string" },
452
+ nodes: { type: "array", items: { type: "object" } },
453
+ connections: { type: "array", items: { type: "object" } },
454
+ },
455
+ required: ["blueprint_id", "graph_name"],
456
+ },
457
+ },
458
+
459
+ // --- Notes ---
460
+ {
461
+ name: "taskovergg_get_notes",
462
+ description: "Get notes, optionally filtered by parent type (project/system/task/blueprint).",
463
+ inputSchema: {
464
+ type: "object",
465
+ properties: {
466
+ project_id: { type: "string" },
467
+ parent_type: { type: "string", enum: ["project", "system", "task", "blueprint"] },
468
+ parent_id: { type: "string" },
469
+ },
470
+ required: ["project_id"],
471
+ },
472
+ },
473
+ {
474
+ name: "taskovergg_add_note",
475
+ description: "Add a note/document to the project or attached to a system/task/blueprint.",
476
+ inputSchema: {
477
+ type: "object",
478
+ properties: {
479
+ project_id: { type: "string" },
480
+ parent_type: { type: "string", enum: ["project", "system", "task", "blueprint"] },
481
+ parent_id: { type: "string" },
482
+ title: { type: "string" },
483
+ content: { type: "string" },
484
+ },
485
+ required: ["project_id", "content"],
486
+ },
487
+ },
488
+
489
+ // --- Backups ---
490
+ {
491
+ name: "taskovergg_log_backup",
492
+ description: "Log that a project backup was created (replaces !backup).",
493
+ inputSchema: {
494
+ type: "object",
495
+ properties: {
496
+ project_id: { type: "string" },
497
+ title: { type: "string" },
498
+ description: { type: "string" },
499
+ },
500
+ required: ["project_id"],
501
+ },
502
+ },
503
+
504
+ // --- Levels ---
505
+ {
506
+ name: "taskovergg_get_levels",
507
+ description: "Get all levels/scenes for a project with actors and status.",
508
+ inputSchema: {
509
+ type: "object",
510
+ properties: { project_id: { type: "string" } },
511
+ required: ["project_id"],
512
+ },
513
+ },
514
+ {
515
+ name: "taskovergg_add_level",
516
+ description: "Add a level/scene with name, map, and actor count.",
517
+ inputSchema: {
518
+ type: "object",
519
+ properties: {
520
+ project_id: { type: "string" },
521
+ name: { type: "string" },
522
+ map: { type: "string", description: "Map/file path" },
523
+ actor_count: { type: "number" },
524
+ status: { type: "string", enum: ["planned", "wip", "testing", "done"] },
525
+ },
526
+ required: ["project_id", "name"],
527
+ },
528
+ },
529
+ {
530
+ name: "taskovergg_update_level",
531
+ description: "Update a level's status, name, map, or actor count.",
532
+ inputSchema: {
533
+ type: "object",
534
+ properties: {
535
+ level_id: { type: "string" },
536
+ name: { type: "string" },
537
+ map: { type: "string" },
538
+ actor_count: { type: "number" },
539
+ status: { type: "string", enum: ["planned", "wip", "testing", "done"] },
540
+ },
541
+ required: ["level_id"],
542
+ },
543
+ },
544
+ {
545
+ name: "taskovergg_add_actor",
546
+ description: "Add an actor to a level with XYZ coordinates.",
547
+ inputSchema: {
548
+ type: "object",
549
+ properties: {
550
+ level_id: { type: "string" },
551
+ name: { type: "string" },
552
+ x: { type: "number" }, y: { type: "number" }, z: { type: "number" },
553
+ notes: { type: "string" },
554
+ },
555
+ required: ["level_id", "name"],
556
+ },
557
+ },
558
+ {
559
+ name: "taskovergg_remove_actor",
560
+ description: "Remove an actor from a level by index.",
561
+ inputSchema: {
562
+ type: "object",
563
+ properties: {
564
+ level_id: { type: "string" },
565
+ actor_index: { type: "number" },
566
+ },
567
+ required: ["level_id", "actor_index"],
568
+ },
569
+ },
570
+
571
+ // --- Plugins ---
572
+ {
573
+ name: "taskovergg_get_plugins",
574
+ description: "Get all plugins/dependencies for a project.",
575
+ inputSchema: {
576
+ type: "object",
577
+ properties: { project_id: { type: "string" } },
578
+ required: ["project_id"],
579
+ },
580
+ },
581
+ {
582
+ name: "taskovergg_add_plugin",
583
+ description: "Track a plugin/dependency with version and source.",
584
+ inputSchema: {
585
+ type: "object",
586
+ properties: {
587
+ project_id: { type: "string" },
588
+ name: { type: "string" },
589
+ version: { type: "string" },
590
+ source: { type: "string", description: "Marketplace, GitHub, Custom, etc." },
591
+ dependents: { type: "array", items: { type: "string" } },
592
+ },
593
+ required: ["project_id", "name"],
594
+ },
595
+ },
596
+ {
597
+ name: "taskovergg_update_plugin",
598
+ description: "Update a plugin's version, source, or dependents.",
599
+ inputSchema: {
600
+ type: "object",
601
+ properties: {
602
+ plugin_id: { type: "string" },
603
+ name: { type: "string" },
604
+ version: { type: "string" },
605
+ source: { type: "string" },
606
+ dependents: { type: "array", items: { type: "string" } },
607
+ },
608
+ required: ["plugin_id"],
609
+ },
610
+ },
611
+ {
612
+ name: "taskovergg_delete_plugin",
613
+ description: "Remove a plugin from the tracker.",
614
+ inputSchema: {
615
+ type: "object",
616
+ properties: { plugin_id: { type: "string" } },
617
+ required: ["plugin_id"],
618
+ },
619
+ },
620
+
621
+ // --- Build Errors ---
622
+ {
623
+ name: "taskovergg_get_build_errors",
624
+ description: "Get build/compile errors, optionally filtered by status (open/fixed).",
625
+ inputSchema: {
626
+ type: "object",
627
+ properties: {
628
+ project_id: { type: "string" },
629
+ status: { type: "string", enum: ["open", "fixed"] },
630
+ },
631
+ required: ["project_id"],
632
+ },
633
+ },
634
+ {
635
+ name: "taskovergg_add_build_error",
636
+ description: "Log a build/compile error tagged to a blueprint.",
637
+ inputSchema: {
638
+ type: "object",
639
+ properties: {
640
+ project_id: { type: "string" },
641
+ error: { type: "string", description: "Error message/description" },
642
+ bp: { type: "string", description: "Related blueprint name" },
643
+ },
644
+ required: ["project_id", "error"],
645
+ },
646
+ },
647
+ {
648
+ name: "taskovergg_fix_build_error",
649
+ description: "Mark a build error as fixed with a description of the fix.",
650
+ inputSchema: {
651
+ type: "object",
652
+ properties: {
653
+ error_id: { type: "string" },
654
+ fix: { type: "string", description: "How the error was fixed" },
655
+ },
656
+ required: ["error_id"],
657
+ },
658
+ },
659
+
660
+ // --- Optimize Items ---
661
+ {
662
+ name: "taskovergg_get_optimize_items",
663
+ description: "Get optimization issues (unused assets, oversized files, performance problems).",
664
+ inputSchema: {
665
+ type: "object",
666
+ properties: { project_id: { type: "string" } },
667
+ required: ["project_id"],
668
+ },
669
+ },
670
+ {
671
+ name: "taskovergg_add_optimize_item",
672
+ description: "Log an optimization issue with category and estimated savings.",
673
+ inputSchema: {
674
+ type: "object",
675
+ properties: {
676
+ project_id: { type: "string" },
677
+ title: { type: "string" },
678
+ category: { type: "string", enum: ["unused", "textures", "meshes", "performance", "memory", "other"] },
679
+ status: { type: "string", enum: ["open", "fixed", "ok"] },
680
+ savings: { type: "string", description: "Estimated savings (e.g. '50MB', '15ms')" },
681
+ },
682
+ required: ["project_id", "title"],
683
+ },
684
+ },
685
+ {
686
+ name: "taskovergg_update_optimize_item",
687
+ description: "Update an optimization item's status or details.",
688
+ inputSchema: {
689
+ type: "object",
690
+ properties: {
691
+ item_id: { type: "string" },
692
+ title: { type: "string" },
693
+ category: { type: "string" },
694
+ status: { type: "string", enum: ["open", "fixed", "ok"] },
695
+ savings: { type: "string" },
696
+ },
697
+ required: ["item_id"],
698
+ },
699
+ },
700
+
701
+ // --- Perf Budget ---
702
+ {
703
+ name: "taskovergg_get_perf_budget",
704
+ description: "Get performance budget readings (FPS, GPU, memory per scene).",
705
+ inputSchema: {
706
+ type: "object",
707
+ properties: { project_id: { type: "string" } },
708
+ required: ["project_id"],
709
+ },
710
+ },
711
+ {
712
+ name: "taskovergg_add_perf_budget",
713
+ description: "Add a performance budget reading for a scene.",
714
+ inputSchema: {
715
+ type: "object",
716
+ properties: {
717
+ project_id: { type: "string" },
718
+ scene: { type: "string" },
719
+ fps: { type: "number" },
720
+ gpu: { type: "number", description: "GPU usage percentage" },
721
+ memory: { type: "number", description: "Memory usage in MB" },
722
+ notes: { type: "string" },
723
+ },
724
+ required: ["project_id", "scene"],
725
+ },
726
+ },
727
+
728
+ // --- Playtests ---
729
+ {
730
+ name: "taskovergg_get_playtests",
731
+ description: "Get playtest sessions for a project.",
732
+ inputSchema: {
733
+ type: "object",
734
+ properties: { project_id: { type: "string" } },
735
+ required: ["project_id"],
736
+ },
737
+ },
738
+ {
739
+ name: "taskovergg_add_playtest",
740
+ description: "Log a playtest session with rating, tester, issues, and build version.",
741
+ inputSchema: {
742
+ type: "object",
743
+ properties: {
744
+ project_id: { type: "string" },
745
+ duration: { type: "string", description: "e.g. '45 min'" },
746
+ issues: { type: "array", items: { type: "string" } },
747
+ rating: { type: "number", description: "1-5 star rating" },
748
+ notes: { type: "string" },
749
+ tester: { type: "string" },
750
+ build_version: { type: "string" },
751
+ },
752
+ required: ["project_id"],
753
+ },
754
+ },
755
+
756
+ // --- Milestones ---
757
+ {
758
+ name: "taskovergg_get_milestones",
759
+ description: "Get project milestones/timeline.",
760
+ inputSchema: {
761
+ type: "object",
762
+ properties: { project_id: { type: "string" } },
763
+ required: ["project_id"],
764
+ },
765
+ },
766
+ {
767
+ name: "taskovergg_add_milestone",
768
+ description: "Add a project milestone with target date.",
769
+ inputSchema: {
770
+ type: "object",
771
+ properties: {
772
+ project_id: { type: "string" },
773
+ title: { type: "string" },
774
+ date: { type: "string", description: "Target date (YYYY-MM-DD)" },
775
+ status: { type: "string", enum: ["upcoming", "active", "done", "missed"] },
776
+ notes: { type: "string" },
777
+ },
778
+ required: ["project_id", "title"],
779
+ },
780
+ },
781
+ {
782
+ name: "taskovergg_update_milestone",
783
+ description: "Update a milestone's status, date, or notes.",
784
+ inputSchema: {
785
+ type: "object",
786
+ properties: {
787
+ milestone_id: { type: "string" },
788
+ title: { type: "string" },
789
+ date: { type: "string" },
790
+ status: { type: "string", enum: ["upcoming", "active", "done", "missed"] },
791
+ notes: { type: "string" },
792
+ },
793
+ required: ["milestone_id"],
794
+ },
795
+ },
796
+
797
+ // --- Iterations ---
798
+ {
799
+ name: "taskovergg_get_iterations",
800
+ description: "Get feature iteration history.",
801
+ inputSchema: {
802
+ type: "object",
803
+ properties: { project_id: { type: "string" } },
804
+ required: ["project_id"],
805
+ },
806
+ },
807
+ {
808
+ name: "taskovergg_add_iteration",
809
+ description: "Log a feature iteration (version change with reason).",
810
+ inputSchema: {
811
+ type: "object",
812
+ properties: {
813
+ project_id: { type: "string" },
814
+ feature: { type: "string" },
815
+ version: { type: "string", description: "e.g. 'v2', 'v3'" },
816
+ change: { type: "string", description: "What changed" },
817
+ reason: { type: "string", description: "Why it changed" },
818
+ },
819
+ required: ["project_id", "feature"],
820
+ },
821
+ },
822
+
823
+ // --- Dialogues ---
824
+ {
825
+ name: "taskovergg_get_dialogues",
826
+ description: "Get NPC dialogue nodes for a project.",
827
+ inputSchema: {
828
+ type: "object",
829
+ properties: { project_id: { type: "string" } },
830
+ required: ["project_id"],
831
+ },
832
+ },
833
+ {
834
+ name: "taskovergg_add_dialogue",
835
+ description: "Add an NPC dialogue node with choices and branching.",
836
+ inputSchema: {
837
+ type: "object",
838
+ properties: {
839
+ project_id: { type: "string" },
840
+ npc: { type: "string" },
841
+ line: { type: "string", description: "Dialogue text" },
842
+ choices: { type: "array", items: { type: "string" } },
843
+ next_node: { type: "string", description: "Next dialogue node ID" },
844
+ notes: { type: "string" },
845
+ },
846
+ required: ["project_id", "npc"],
847
+ },
848
+ },
849
+ {
850
+ name: "taskovergg_update_dialogue",
851
+ description: "Update a dialogue node.",
852
+ inputSchema: {
853
+ type: "object",
854
+ properties: {
855
+ dialogue_id: { type: "string" },
856
+ npc: { type: "string" },
857
+ line: { type: "string" },
858
+ choices: { type: "array", items: { type: "string" } },
859
+ next_node: { type: "string" },
860
+ notes: { type: "string" },
861
+ },
862
+ required: ["dialogue_id"],
863
+ },
864
+ },
865
+
866
+ // --- Sounds ---
867
+ {
868
+ name: "taskovergg_get_sounds",
869
+ description: "Get sound cues for a project.",
870
+ inputSchema: {
871
+ type: "object",
872
+ properties: { project_id: { type: "string" } },
873
+ required: ["project_id"],
874
+ },
875
+ },
876
+ {
877
+ name: "taskovergg_add_sound",
878
+ description: "Track a sound cue with actor, trigger, and spatial settings.",
879
+ inputSchema: {
880
+ type: "object",
881
+ properties: {
882
+ project_id: { type: "string" },
883
+ name: { type: "string" },
884
+ actor: { type: "string" },
885
+ trigger: { type: "string" },
886
+ spatial: { type: "boolean" },
887
+ attenuation: { type: "string" },
888
+ notes: { type: "string" },
889
+ },
890
+ required: ["project_id", "name"],
891
+ },
892
+ },
893
+ {
894
+ name: "taskovergg_update_sound",
895
+ description: "Update a sound cue's settings.",
896
+ inputSchema: {
897
+ type: "object",
898
+ properties: {
899
+ sound_id: { type: "string" },
900
+ name: { type: "string" },
901
+ actor: { type: "string" },
902
+ trigger: { type: "string" },
903
+ spatial: { type: "boolean" },
904
+ attenuation: { type: "string" },
905
+ notes: { type: "string" },
906
+ },
907
+ required: ["sound_id"],
908
+ },
909
+ },
910
+
911
+ // --- Controls ---
912
+ {
913
+ name: "taskovergg_get_controls",
914
+ description: "Get input control bindings for a project.",
915
+ inputSchema: {
916
+ type: "object",
917
+ properties: { project_id: { type: "string" } },
918
+ required: ["project_id"],
919
+ },
920
+ },
921
+ {
922
+ name: "taskovergg_add_control",
923
+ description: "Add an input control binding (key → action).",
924
+ inputSchema: {
925
+ type: "object",
926
+ properties: {
927
+ project_id: { type: "string" },
928
+ key: { type: "string", description: "Input key/button" },
929
+ action: { type: "string", description: "Game action" },
930
+ context: { type: "string", description: "Input context (e.g. 'on foot', 'in vehicle')" },
931
+ condition: { type: "string" },
932
+ },
933
+ required: ["project_id", "key", "action"],
934
+ },
935
+ },
936
+ {
937
+ name: "taskovergg_update_control",
938
+ description: "Update a control binding.",
939
+ inputSchema: {
940
+ type: "object",
941
+ properties: {
942
+ control_id: { type: "string" },
943
+ key: { type: "string" },
944
+ action: { type: "string" },
945
+ context: { type: "string" },
946
+ condition: { type: "string" },
947
+ },
948
+ required: ["control_id"],
949
+ },
950
+ },
951
+
952
+ // --- Assets ---
953
+ {
954
+ name: "taskovergg_get_assets",
955
+ description: "Get assets in the pipeline for a project.",
956
+ inputSchema: {
957
+ type: "object",
958
+ properties: { project_id: { type: "string" } },
959
+ required: ["project_id"],
960
+ },
961
+ },
962
+ {
963
+ name: "taskovergg_add_asset",
964
+ description: "Track an asset in the pipeline with type, status, and usage.",
965
+ inputSchema: {
966
+ type: "object",
967
+ properties: {
968
+ project_id: { type: "string" },
969
+ name: { type: "string" },
970
+ type: { type: "string", description: "Asset type (Mesh, Texture, Material, Sound, etc.)" },
971
+ path: { type: "string" },
972
+ size: { type: "string" },
973
+ status: { type: "string", enum: ["concept", "imported", "integrated", "tested", "final"] },
974
+ used_by: { type: "string" },
975
+ },
976
+ required: ["project_id", "name"],
977
+ },
978
+ },
979
+ {
980
+ name: "taskovergg_update_asset",
981
+ description: "Update an asset's status or details.",
982
+ inputSchema: {
983
+ type: "object",
984
+ properties: {
985
+ asset_id: { type: "string" },
986
+ name: { type: "string" },
987
+ type: { type: "string" },
988
+ path: { type: "string" },
989
+ size: { type: "string" },
990
+ status: { type: "string", enum: ["concept", "imported", "integrated", "tested", "final"] },
991
+ used_by: { type: "string" },
992
+ },
993
+ required: ["asset_id"],
994
+ },
995
+ },
996
+
997
+ // --- References ---
998
+ {
999
+ name: "taskovergg_get_refs",
1000
+ description: "Get reference/inspiration items for a project.",
1001
+ inputSchema: {
1002
+ type: "object",
1003
+ properties: { project_id: { type: "string" } },
1004
+ required: ["project_id"],
1005
+ },
1006
+ },
1007
+ {
1008
+ name: "taskovergg_add_ref",
1009
+ description: "Add a reference/inspiration item (game, art, video, article).",
1010
+ inputSchema: {
1011
+ type: "object",
1012
+ properties: {
1013
+ project_id: { type: "string" },
1014
+ title: { type: "string" },
1015
+ type: { type: "string", enum: ["Game", "Art", "Video", "Article"] },
1016
+ url: { type: "string" },
1017
+ notes: { type: "string" },
1018
+ },
1019
+ required: ["project_id", "title"],
1020
+ },
1021
+ },
1022
+
1023
+ // --- Marketing ---
1024
+ {
1025
+ name: "taskovergg_get_marketing_items",
1026
+ description: "Get marketing/launch prep items for a project.",
1027
+ inputSchema: {
1028
+ type: "object",
1029
+ properties: { project_id: { type: "string" } },
1030
+ required: ["project_id"],
1031
+ },
1032
+ },
1033
+ {
1034
+ name: "taskovergg_add_marketing_item",
1035
+ description: "Add a marketing/launch prep item (Steam page, trailer, social, press).",
1036
+ inputSchema: {
1037
+ type: "object",
1038
+ properties: {
1039
+ project_id: { type: "string" },
1040
+ item: { type: "string" },
1041
+ category: { type: "string", enum: ["Steam", "Trailer", "Social", "Press"] },
1042
+ status: { type: "string", enum: ["todo", "doing", "done"] },
1043
+ notes: { type: "string" },
1044
+ },
1045
+ required: ["project_id", "item"],
1046
+ },
1047
+ },
1048
+ {
1049
+ name: "taskovergg_update_marketing_item",
1050
+ description: "Update a marketing item's status or details.",
1051
+ inputSchema: {
1052
+ type: "object",
1053
+ properties: {
1054
+ marketing_id: { type: "string" },
1055
+ item: { type: "string" },
1056
+ category: { type: "string" },
1057
+ status: { type: "string", enum: ["todo", "doing", "done"] },
1058
+ notes: { type: "string" },
1059
+ },
1060
+ required: ["marketing_id"],
1061
+ },
1062
+ },
1063
+
1064
+ // --- Wiki ---
1065
+ {
1066
+ name: "taskovergg_get_wiki_pages",
1067
+ description: "Get internal wiki/knowledge base pages for a project.",
1068
+ inputSchema: {
1069
+ type: "object",
1070
+ properties: { project_id: { type: "string" } },
1071
+ required: ["project_id"],
1072
+ },
1073
+ },
1074
+ {
1075
+ name: "taskovergg_add_wiki_page",
1076
+ description: "Add a wiki/knowledge base page with category and content.",
1077
+ inputSchema: {
1078
+ type: "object",
1079
+ properties: {
1080
+ project_id: { type: "string" },
1081
+ title: { type: "string" },
1082
+ category: { type: "string", enum: ["Systems", "Workflows", "Guides", "Reference"] },
1083
+ content: { type: "string" },
1084
+ },
1085
+ required: ["project_id", "title"],
1086
+ },
1087
+ },
1088
+ {
1089
+ name: "taskovergg_update_wiki_page",
1090
+ description: "Update a wiki page's title, category, or content.",
1091
+ inputSchema: {
1092
+ type: "object",
1093
+ properties: {
1094
+ wiki_id: { type: "string" },
1095
+ title: { type: "string" },
1096
+ category: { type: "string" },
1097
+ content: { type: "string" },
1098
+ },
1099
+ required: ["wiki_id"],
1100
+ },
1101
+ },
1102
+
1103
+ // --- Ship Readiness ---
1104
+ {
1105
+ name: "taskovergg_get_ship_checked",
1106
+ description: "Get completed ship readiness checklist items for a project.",
1107
+ inputSchema: {
1108
+ type: "object",
1109
+ properties: { project_id: { type: "string" } },
1110
+ required: ["project_id"],
1111
+ },
1112
+ },
1113
+ {
1114
+ name: "taskovergg_toggle_ship_check",
1115
+ description: "Toggle a ship readiness checklist step as complete/incomplete.",
1116
+ inputSchema: {
1117
+ type: "object",
1118
+ properties: {
1119
+ project_id: { type: "string" },
1120
+ step_id: { type: "string", description: "Checklist step ID (e.g. 'p1s1', 'p2s3')" },
1121
+ },
1122
+ required: ["project_id", "step_id"],
1123
+ },
1124
+ },
1125
+
1126
+ // --- Open Questions ---
1127
+ {
1128
+ name: "taskovergg_get_open_questions",
1129
+ description: "Get open design/development questions for a project.",
1130
+ inputSchema: {
1131
+ type: "object",
1132
+ properties: { project_id: { type: "string" } },
1133
+ required: ["project_id"],
1134
+ },
1135
+ },
1136
+ {
1137
+ name: "taskovergg_add_open_question",
1138
+ description: "Add an open question that needs answering.",
1139
+ inputSchema: {
1140
+ type: "object",
1141
+ properties: {
1142
+ project_id: { type: "string" },
1143
+ text: { type: "string" },
1144
+ },
1145
+ required: ["project_id", "text"],
1146
+ },
1147
+ },
1148
+ {
1149
+ name: "taskovergg_toggle_question",
1150
+ description: "Toggle an open question as resolved/unresolved.",
1151
+ inputSchema: {
1152
+ type: "object",
1153
+ properties: { question_id: { type: "string" } },
1154
+ required: ["question_id"],
1155
+ },
1156
+ },
1157
+
1158
+ // --- Board Columns (Blocks) ---
1159
+ {
1160
+ name: "taskovergg_add_board_column",
1161
+ description: "Add a new custom column (block) to the Kanban task board. Use this when the user asks to create a new block, column, or category on their task board. This does NOT create a task/card — it creates a new column that cards can be placed into.",
1162
+ inputSchema: {
1163
+ type: "object",
1164
+ properties: {
1165
+ name: { type: "string", description: "The name/label for the new column (e.g. 'Review Later', 'Blocked', 'QA Testing')" },
1166
+ color: { type: "string", description: "Hex color for the column dot (e.g. '#FDE68A'). Defaults to '#9B95A0' if not provided." },
1167
+ },
1168
+ required: ["name"],
1169
+ },
1170
+ },
1171
+ // --- Stories (Narrative Bible) ---
1172
+ {
1173
+ name: "taskovergg_get_stories",
1174
+ description: "Get all narrative bible / story sections for a project.",
1175
+ inputSchema: {
1176
+ type: "object",
1177
+ properties: { project_id: { type: "string" } },
1178
+ required: ["project_id"],
1179
+ },
1180
+ },
1181
+ {
1182
+ name: "taskovergg_add_story",
1183
+ description: "Add a narrative bible section (synopsis, characters, lore, plot points, or endings).",
1184
+ inputSchema: {
1185
+ type: "object",
1186
+ properties: {
1187
+ project_id: { type: "string" },
1188
+ section_id: { type: "string", description: "Section key: s_synopsis, s_characters, s_lore, s_plot, s_endings" },
1189
+ section: { type: "string", description: "Display label for the section" },
1190
+ content: { type: "string", description: "Section content text" },
1191
+ },
1192
+ required: ["project_id", "section_id", "section"],
1193
+ },
1194
+ },
1195
+ {
1196
+ name: "taskovergg_update_story",
1197
+ description: "Update a narrative bible story section's content.",
1198
+ inputSchema: {
1199
+ type: "object",
1200
+ properties: {
1201
+ story_id: { type: "string" },
1202
+ section: { type: "string" },
1203
+ content: { type: "string" },
1204
+ },
1205
+ required: ["story_id"],
1206
+ },
1207
+ },
1208
+ // --- Scenes ---
1209
+ {
1210
+ name: "taskovergg_get_scenes",
1211
+ description: "Get all scenes for a project's narrative bible.",
1212
+ inputSchema: {
1213
+ type: "object",
1214
+ properties: { project_id: { type: "string" } },
1215
+ required: ["project_id"],
1216
+ },
1217
+ },
1218
+ {
1219
+ name: "taskovergg_add_scene",
1220
+ description: "Add a new scene to a project's story.",
1221
+ inputSchema: {
1222
+ type: "object",
1223
+ properties: {
1224
+ project_id: { type: "string" },
1225
+ number: { type: "number", description: "Scene number" },
1226
+ title: { type: "string" },
1227
+ location: { type: "string" },
1228
+ characters: { type: "array", items: { type: "string" }, description: "Character names in this scene" },
1229
+ mood: { type: "string" },
1230
+ round: { type: "string", description: "Story round/act (e.g. Intro, Act 1)" },
1231
+ content: { type: "string" },
1232
+ },
1233
+ required: ["project_id", "title"],
1234
+ },
1235
+ },
1236
+ {
1237
+ name: "taskovergg_update_scene",
1238
+ description: "Update a scene's fields.",
1239
+ inputSchema: {
1240
+ type: "object",
1241
+ properties: {
1242
+ scene_id: { type: "string" },
1243
+ number: { type: "number" },
1244
+ title: { type: "string" },
1245
+ location: { type: "string" },
1246
+ characters: { type: "array", items: { type: "string" } },
1247
+ mood: { type: "string" },
1248
+ round: { type: "string" },
1249
+ content: { type: "string" },
1250
+ },
1251
+ required: ["scene_id"],
1252
+ },
1253
+ },
1254
+ {
1255
+ name: "taskovergg_delete_scene",
1256
+ description: "Delete a scene from the narrative bible.",
1257
+ inputSchema: {
1258
+ type: "object",
1259
+ properties: { scene_id: { type: "string" } },
1260
+ required: ["scene_id"],
1261
+ },
1262
+ },
1263
+ // --- Story Bible (Story NEW tab — full project story data) ---
1264
+ {
1265
+ name: "taskovergg_get_story_bible",
1266
+ description: "Get the full Story Bible for a project — includes title, logline, genre, tone, characters, chapters, scenes with word counts, and script. This is the primary tool for reading story data from the Story NEW writing environment.",
1267
+ inputSchema: {
1268
+ type: "object",
1269
+ properties: { project_id: { type: "string" } },
1270
+ required: ["project_id"],
1271
+ },
1272
+ },
1273
+ {
1274
+ name: "taskovergg_update_story_bible",
1275
+ description: "Update the Story Bible metadata (title, logline, genre, tone, script).",
1276
+ inputSchema: {
1277
+ type: "object",
1278
+ properties: {
1279
+ project_id: { type: "string" },
1280
+ title: { type: "string" },
1281
+ logline: { type: "string" },
1282
+ genre: { type: "string" },
1283
+ tone: { type: "string" },
1284
+ script: { type: "string", description: "Full script/source material text" },
1285
+ },
1286
+ required: ["project_id"],
1287
+ },
1288
+ },
1289
+ {
1290
+ name: "taskovergg_add_story_character",
1291
+ description: "Add a character to the Story Bible.",
1292
+ inputSchema: {
1293
+ type: "object",
1294
+ properties: {
1295
+ project_id: { type: "string" },
1296
+ name: { type: "string" },
1297
+ role: { type: "string", description: "Character role: Player, Protagonist, Antagonist, NPC, Supporting, Mentioned" },
1298
+ description: { type: "string" },
1299
+ },
1300
+ required: ["project_id", "name"],
1301
+ },
1302
+ },
1303
+ {
1304
+ name: "taskovergg_update_story_character",
1305
+ description: "Update a character in the Story Bible.",
1306
+ inputSchema: {
1307
+ type: "object",
1308
+ properties: {
1309
+ project_id: { type: "string" },
1310
+ character_id: { type: "string" },
1311
+ name: { type: "string" },
1312
+ role: { type: "string" },
1313
+ description: { type: "string" },
1314
+ },
1315
+ required: ["project_id", "character_id"],
1316
+ },
1317
+ },
1318
+ {
1319
+ name: "taskovergg_get_scene_content",
1320
+ description: "Get the full content and details of a specific scene by ID.",
1321
+ inputSchema: {
1322
+ type: "object",
1323
+ properties: { scene_id: { type: "string" } },
1324
+ required: ["scene_id"],
1325
+ },
1326
+ },
1327
+ {
1328
+ name: "taskovergg_update_scene_content",
1329
+ description: "Update a scene's fields in the Story NEW writing environment (title, location, mood, content, chapter, characters, objectives).",
1330
+ inputSchema: {
1331
+ type: "object",
1332
+ properties: {
1333
+ project_id: { type: "string" },
1334
+ scene_id: { type: "string" },
1335
+ title: { type: "string" },
1336
+ location: { type: "string" },
1337
+ mood: { type: "string" },
1338
+ content: { type: "string", description: "Scene content (HTML supported)" },
1339
+ round: { type: "string", description: "Chapter name this scene belongs to" },
1340
+ characters: { type: "array", items: { type: "string" }, description: "Character IDs assigned to this scene" },
1341
+ objectives: { type: "array", items: { type: "object", properties: { text: { type: "string" }, done: { type: "boolean" } } } },
1342
+ },
1343
+ required: ["project_id", "scene_id"],
1344
+ },
1345
+ },
1346
+ ];
1347
+
1348
+ // ===== REGISTER TOOLS =====
1349
+
1350
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
1351
+ return { tools: TOOLS };
1352
+ });
1353
+
1354
+ // ===== PROJECT SCOPE GUARD =====
1355
+ // ===== HANDLE TOOL CALLS =====
1356
+
1357
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1358
+ const { name, arguments: args } = request.params;
1359
+
1360
+ const mapping = toolMap[name];
1361
+ if (!mapping) {
1362
+ return { content: [{ type: "text", text: `Unknown tool: ${name}` }] };
1363
+ }
1364
+ if (!cloudAdapter.isAllowed(mapping.rpc)) {
1365
+ return { content: [{ type: "text", text: `Method "${mapping.rpc}" is not available` }] };
1366
+ }
1367
+
1368
+ // SECURITY: Schema validation -- strips unknown fields, checks required + types
1369
+ const raw = args || {};
1370
+ const { errors, cleaned } = validateSchema(raw, mapping.schema);
1371
+ if (errors.length > 0) {
1372
+ return { content: [{ type: "text", text: `Validation error: ${errors.join("; ")}` }] };
1373
+ }
1374
+
1375
+ try {
1376
+ const rpcArgs = mapping.args(cleaned, raw);
1377
+ const result = await cloudAdapter.callRpc(mapping.rpc, rpcArgs);
1378
+ return { content: [{ type: "text", text: typeof result === "string" ? result : JSON.stringify(result, null, 2) }] };
1379
+ } catch (err) {
1380
+ if (err.message === "AUTH_FAILED") {
1381
+ console.error("[ERROR] Authentication failed. Shutting down.");
1382
+ process.exit(1);
1383
+ }
1384
+ if (err.message.startsWith("RATE_LIMITED:")) {
1385
+ const secs = err.message.split(":")[1];
1386
+ return { content: [{ type: "text", text: `Rate limited. Try again in ${secs} seconds.` }] };
1387
+ }
1388
+ return { content: [{ type: "text", text: `Error: ${err.message}` }] };
1389
+ }
1390
+ });
1391
+
1392
+
1393
+ // ===== START =====
1394
+
1395
+ async function main() {
1396
+ if (CLOUD_MODE) {
1397
+ const check = await cloudAdapter.validateKey();
1398
+ if (!check.valid) {
1399
+ console.error(`[ERROR] ${check.error}`);
1400
+ process.exit(1);
1401
+ }
1402
+ console.error("[CLOUD] Connected to api.taskover.gg (API key mode)");
1403
+ } else {
1404
+ try {
1405
+ const hostType = process.env.TASKOVER_HOST_TYPE || "MCP";
1406
+ const auth = await authFlow.authenticate(hostType);
1407
+ cloudAdapter.initWithToken(auth.accessToken, auth.refreshToken);
1408
+ if (auth.displayName) {
1409
+ console.error(`[AUTH] Connected as ${auth.displayName}`);
1410
+ } else {
1411
+ console.error("[AUTH] Connected to api.taskover.gg");
1412
+ }
1413
+ } catch (err) {
1414
+ console.error(`[ERROR] ${err.message}`);
1415
+ console.error("[HINT] Set TASKOVER_API_KEY for headless/CI environments.");
1416
+ process.exit(1);
1417
+ }
1418
+ }
1419
+
1420
+ const transport = new StdioServerTransport();
1421
+ await server.connect(transport);
1422
+ console.error("TaskOver MCP server running (stdio)");
1423
+ }
1424
+
1425
+ main().catch((err) => {
1426
+ // SECURITY: Never log secrets in crash output
1427
+ const msg = err.message || String(err);
1428
+ const redacted = msg
1429
+ .replace(/tok_[a-zA-Z0-9]+/g, "tok_[REDACTED]")
1430
+ .replace(/ht_[a-zA-Z0-9]+/g, "ht_[REDACTED]");
1431
+ console.error(`[FATAL] ${redacted}`);
1432
+ process.exit(1);
1433
+ });