@gethmy/mcp 2.0.0 → 2.1.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.
Files changed (62) hide show
  1. package/README.md +6 -1
  2. package/dist/cli.js +711 -59
  3. package/dist/index.js +5 -3
  4. package/dist/lib/__tests__/active-learning.test.js +386 -0
  5. package/dist/lib/__tests__/agent-performance-profiles.test.js +325 -0
  6. package/dist/lib/__tests__/auto-session.test.js +661 -0
  7. package/dist/lib/__tests__/context-assembly.test.js +362 -0
  8. package/dist/lib/__tests__/graph-expansion.test.js +150 -0
  9. package/dist/lib/__tests__/integration-memory-crud.test.js +797 -0
  10. package/dist/lib/__tests__/integration-memory-system.test.js +281 -0
  11. package/dist/lib/__tests__/lifecycle-maintenance.test.js +207 -0
  12. package/dist/lib/__tests__/pattern-detection.test.js +295 -0
  13. package/dist/lib/__tests__/prompt-builder.test.js +418 -0
  14. package/dist/lib/active-learning.js +878 -0
  15. package/dist/lib/api-client.js +550 -0
  16. package/dist/lib/auto-session.js +173 -0
  17. package/dist/lib/cli.js +127 -0
  18. package/dist/lib/config.js +205 -0
  19. package/dist/lib/consolidation.js +243 -0
  20. package/dist/lib/context-assembly.js +606 -0
  21. package/dist/lib/graph-expansion.js +163 -0
  22. package/dist/lib/http.js +174 -0
  23. package/dist/lib/index.js +7 -0
  24. package/dist/lib/lifecycle-maintenance.js +88 -0
  25. package/dist/lib/prompt-builder.js +483 -0
  26. package/dist/lib/remote.js +166 -0
  27. package/dist/lib/server.js +3132 -0
  28. package/dist/lib/tui/agents.js +116 -0
  29. package/dist/lib/tui/docs.js +744 -0
  30. package/dist/lib/tui/setup.js +1068 -0
  31. package/dist/lib/tui/theme.js +95 -0
  32. package/dist/lib/tui/writer.js +200 -0
  33. package/package.json +15 -6
  34. package/src/__tests__/active-learning.test.ts +483 -0
  35. package/src/__tests__/agent-performance-profiles.test.ts +468 -0
  36. package/src/__tests__/auto-session.test.ts +912 -0
  37. package/src/__tests__/context-assembly.test.ts +506 -0
  38. package/src/__tests__/graph-expansion.test.ts +285 -0
  39. package/src/__tests__/integration-memory-crud.test.ts +948 -0
  40. package/src/__tests__/integration-memory-system.test.ts +321 -0
  41. package/src/__tests__/lifecycle-maintenance.test.ts +238 -0
  42. package/src/__tests__/pattern-detection.test.ts +438 -0
  43. package/src/__tests__/prompt-builder.test.ts +505 -0
  44. package/src/active-learning.ts +1227 -0
  45. package/src/api-client.ts +969 -0
  46. package/src/auto-session.ts +218 -0
  47. package/src/cli.ts +166 -0
  48. package/src/config.ts +285 -0
  49. package/src/consolidation.ts +314 -0
  50. package/src/context-assembly.ts +842 -0
  51. package/src/graph-expansion.ts +234 -0
  52. package/src/http.ts +265 -0
  53. package/src/index.ts +8 -0
  54. package/src/lifecycle-maintenance.ts +120 -0
  55. package/src/prompt-builder.ts +681 -0
  56. package/src/remote.ts +227 -0
  57. package/src/server.ts +3858 -0
  58. package/src/tui/agents.ts +154 -0
  59. package/src/tui/docs.ts +863 -0
  60. package/src/tui/setup.ts +1281 -0
  61. package/src/tui/theme.ts +114 -0
  62. package/src/tui/writer.ts +260 -0
@@ -0,0 +1,1068 @@
1
+ import { existsSync, lstatSync, mkdirSync, symlinkSync, unlinkSync, } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { dirname, join } from "node:path";
4
+ import * as p from "@clack/prompts";
5
+ import { areSkillsInstalled, getConfigPath, getLocalConfigPath, hasProjectContext, isConfigured, loadConfig, saveLocalConfig, } from "../config.js";
6
+ import { detectAgents } from "./agents.js";
7
+ import { runDocsStep } from "./docs.js";
8
+ import { colors, formatPath, messages } from "./theme.js";
9
+ import { getWriteSummary, writeFilesWithProgress } from "./writer.js";
10
+ // Central skills directory for global installation
11
+ const GLOBAL_SKILLS_DIR = join(homedir(), ".agents", "skills");
12
+ // API base URL
13
+ const API_URL = "https://gethmy.com/api";
14
+ // Harmony workflow prompt - shared across agents
15
+ const HARMONY_WORKFLOW_PROMPT = `# Harmony Card Workflow
16
+
17
+ Start work on a Harmony card. Card reference: $ARGUMENTS
18
+
19
+ ## 1. Find & Fetch Card
20
+
21
+ Parse the reference and fetch the card:
22
+ - \`#42\` or \`42\` → \`harmony_get_card_by_short_id\` with \`shortId: 42\`
23
+ - UUID → \`harmony_get_card\` with \`cardId\`
24
+ - Name/text → \`harmony_search_cards\` with \`query\`
25
+
26
+ ## 2. Get Board State
27
+
28
+ Call \`harmony_get_board\` to get columns and labels. From the response:
29
+ - Find the "In Progress" (or "Progress") column ID
30
+ - Find the "agent" label ID
31
+
32
+ ## 3. Setup Card for Work
33
+
34
+ Execute these in sequence:
35
+ 1. \`harmony_move_card\` → Move to "In Progress" column
36
+ 2. \`harmony_add_label_to_card\` → Add "agent" label
37
+ 3. \`harmony_start_agent_session\`:
38
+ - \`cardId\`: Card UUID
39
+ - \`agentIdentifier\`: Your agent identifier
40
+ - \`agentName\`: Your agent name
41
+ - \`currentTask\`: "Analyzing card requirements"
42
+
43
+ ## 4. Generate Work Prompt
44
+
45
+ Call \`harmony_generate_prompt\` with:
46
+ - \`cardId\` or \`shortId\` (+ \`projectId\` if using shortId)
47
+ - \`variant\`: Select based on task:
48
+ - \`"execute"\` (default) → Clear tasks, bug fixes, well-defined work
49
+ - \`"analysis"\` → Complex features, unclear requirements
50
+ - \`"draft"\` → Medium complexity, want feedback first
51
+
52
+ The generated prompt provides role framing, focus areas, subtasks, linked cards, and suggested outputs.
53
+
54
+ ## 5. Display Card Summary
55
+
56
+ Show the user: Card title, short ID, role, priority, labels, due date, description, and subtasks.
57
+
58
+ ## 6. Implement Solution
59
+
60
+ Work on the card following the generated prompt's guidance. Update progress at milestones:
61
+ - \`harmony_update_agent_progress\` with \`progressPercent\` (0-100), \`currentTask\`, \`status\`, \`blockers\`
62
+
63
+ **Progress checkpoints:** 20% (exploration), 50% (implementation), 80% (testing), 100% (done)
64
+
65
+ ## 7. Complete Work
66
+
67
+ When finished:
68
+ 1. \`harmony_end_agent_session\` with \`status: "completed"\`, \`progressPercent: 100\`
69
+ 2. \`harmony_move_card\` to "Review" column
70
+ 3. Summarize accomplishments
71
+
72
+ If pausing: \`harmony_end_agent_session\` with \`status: "paused"\`
73
+
74
+ ## Key Tools Reference
75
+
76
+ **Cards:** \`harmony_get_card\`, \`harmony_get_card_by_short_id\`, \`harmony_search_cards\`, \`harmony_create_card\`, \`harmony_update_card\`, \`harmony_move_card\`, \`harmony_delete_card\`, \`harmony_assign_card\`
77
+
78
+ **Subtasks:** \`harmony_create_subtask\`, \`harmony_toggle_subtask\`, \`harmony_delete_subtask\`
79
+
80
+ **Labels:** \`harmony_add_label_to_card\`, \`harmony_remove_label_from_card\`, \`harmony_create_label\`
81
+
82
+ **Links:** \`harmony_add_link_to_card\`, \`harmony_remove_link_from_card\`, \`harmony_get_card_links\`
83
+
84
+ **Board:** \`harmony_get_board\`, \`harmony_list_projects\`, \`harmony_get_context\`, \`harmony_set_project_context\`
85
+
86
+ **Sessions:** \`harmony_start_agent_session\`, \`harmony_update_agent_progress\`, \`harmony_end_agent_session\`, \`harmony_get_agent_session\`
87
+
88
+ **AI:** \`harmony_generate_prompt\`, \`harmony_process_command\`
89
+ `;
90
+ // Harmony plan prompt - unified plan creation and execution workflow
91
+ const HARMONY_PLAN_PROMPT = `# Harmony Plan Workflow
92
+
93
+ Create a new plan or work on an existing one. Argument: $ARGUMENTS
94
+
95
+ ## Step 1 — Detect Intent
96
+
97
+ Parse \`$ARGUMENTS\` to determine the workflow:
98
+
99
+ - **UUID** (contains dashes, 36 chars) → call \`harmony_get_plan\` with \`planId\` directly → **Step 2A**
100
+ - **\`#N\`** (short ID) → call \`harmony_get_card_by_short_id\` to get the card, then \`harmony_get_plan\` with \`cardId\` → **Step 2A**
101
+ - **Text** (anything else) → call \`harmony_list_plans\` with \`search\` set to the text
102
+ - If **one match** → use it → **Step 2A**
103
+ - If **multiple matches** → list them with title, status, phase, and updated date. Ask the user to pick one using \`AskUserQuestion\` → **Step 2A**
104
+ - If **no matches** → ask user: "No existing plans found for '$ARGUMENTS'. Would you like to create a new plan on this topic?" → **Step 2B**
105
+ - **Empty / vague topic** → **Step 2B** (create new plan)
106
+
107
+ ---
108
+
109
+ ## Step 2A — Work on Existing Plan
110
+
111
+ ### 2A.1 — Analyze & Display
112
+
113
+ Once you have the plan ID, call \`harmony_get_plan\` to fetch the full plan with tasks. Show a structured summary:
114
+
115
+ \\\`\\\`\\\`
116
+ ## [Plan Title]
117
+ **Status:** draft/active/archived | **Phase:** plan/execute/verify/done
118
+ **Tasks:** N total (X pending, Y in_progress, Z completed)
119
+ **URL:** https://gethmy.com/plans/{id}
120
+ \\\`\\\`\\\`
121
+
122
+ If plan is in execute phase and tasks already have linked cards, note which tasks have cards and which don't.
123
+
124
+ ### 2A.2 — Recall Context
125
+
126
+ Call \`harmony_memory_search\` with the plan title to find related knowledge, patterns, or decisions that may inform execution.
127
+
128
+ ### 2A.3 — Present Options
129
+
130
+ Use \`AskUserQuestion\` to offer execution choices. Adapt options based on plan state:
131
+
132
+ #### Default options (plan in \`plan\` phase):
133
+
134
+ **(A) Single card** — Create one card with plan summary + link to plan. Best for simple plans.
135
+ **(B) Multiple cards** — Create one card per task via \`harmony_advance_plan\`. Best for complex plans with independent tasks.
136
+ **(C) Analyze only** — Review the plan and design an implementation approach. Create cards later.
137
+ **(D) Skip** — Do nothing.
138
+
139
+ #### If plan has no tasks:
140
+ Only offer **(A) Single card**, **(C) Analyze only**, or **(D) Skip**.
141
+
142
+ #### If plan is already in \`execute\` phase with existing cards:
143
+ **(A) Work on existing cards** — List cards with short IDs, suggest \`/hmy #N\` to start
144
+ **(B) Create cards for remaining tasks** — Only create cards for tasks without linked cards
145
+ **(C) Analyze progress** — Review what's done vs remaining
146
+ **(D) Skip**
147
+
148
+ ### 2A.4 — Execute Choice
149
+
150
+ #### Option A — Single card
151
+ 1. Call \`harmony_create_card\` with:
152
+ - \`title\`: Plan title
153
+ - \`description\`: Brief 2-3 sentence summary of the plan + \`\\n\\n[View plan](https://gethmy.com/plans/{planId})\`
154
+ - \`priority\`: based on plan task priorities (use highest)
155
+ 2. Call \`harmony_update_plan\` to set \`status: "active"\`, \`workflowPhase: "execute"\`
156
+
157
+ #### Option B — Multiple cards (advance plan)
158
+ 1. Call \`harmony_advance_plan\` with:
159
+ - \`planId\`: the plan ID
160
+ - \`phase\`: \`"execute"\`
161
+ - \`summary\`: Brief summary of the plan scope
162
+ 2. Display the created cards with their short IDs
163
+
164
+ #### Option C — Analyze only
165
+ 1. Present a structured implementation analysis:
166
+ - Suggested order of tasks
167
+ - Dependencies between tasks
168
+ - Key technical considerations from memory search
169
+ - Estimated complexity
170
+ 2. Suggest creating cards when ready
171
+
172
+ #### Option D — Skip
173
+ Acknowledge and stop.
174
+
175
+ ### 2A.5 — Summary
176
+
177
+ After execution, show:
178
+ - Created card(s) with short IDs
179
+ - Current plan phase
180
+ - Suggest next step: \`/hmy #N\` to start working on a card
181
+
182
+ ---
183
+
184
+ ## Step 2B — Create New Plan
185
+
186
+ ### 2B.1 — Context Gathering
187
+
188
+ Before interviewing, gather existing context:
189
+
190
+ 1. Call \`harmony_get_board\` for board state (columns, cards, labels)
191
+ 2. Call \`harmony_recall\` with relevant tags to find existing knowledge on the topic
192
+ 3. Call \`harmony_memory_search\` with the topic to find related patterns/decisions/lessons
193
+
194
+ Note what you learn — reference it during the interview to ask smarter questions.
195
+
196
+ ### 2B.2 — Structured Interview (3-5 questions)
197
+
198
+ Interview the user with **3-5 focused questions** using AskUserQuestion. Adapt based on complexity.
199
+
200
+ #### Core Questions
201
+ 1. **Problem & Audience**: What problem are we solving? Who benefits?
202
+ 2. **Scope**: What's in v1, what's deferred?
203
+ 3. **Technical Constraints**: Any technical preferences, constraints, or existing patterns to follow?
204
+
205
+ #### Adaptive Follow-ups (if needed)
206
+ - Key user flows or interactions?
207
+ - Integration points with existing systems?
208
+ - Performance, security, or accessibility requirements?
209
+
210
+ #### Interview Rules
211
+ - Reference what you found in Step 2B.1 (board state, memories) to ask informed questions
212
+ - Skip questions that aren't relevant — simple features need fewer questions
213
+ - Tell the user when you have enough information to draft
214
+
215
+ ### 2B.3 — Plan Document
216
+
217
+ Create a structured markdown document:
218
+
219
+ \\\`\\\`\\\`markdown
220
+ # [Title]
221
+
222
+ ## Problem
223
+ [What problem we're solving and why]
224
+
225
+ ## Scope
226
+
227
+ ### In Scope
228
+ - [Feature/capability 1]
229
+ - [Feature/capability 2]
230
+
231
+ ### Out of Scope
232
+ - [Deferred items]
233
+
234
+ ## Approach
235
+ [Technical design, architecture decisions, key patterns]
236
+
237
+ ### Key Decisions
238
+ | Decision | Choice | Rationale |
239
+ |----------|--------|-----------|
240
+ | ... | ... | ... |
241
+
242
+ ## Tasks
243
+ 1. **[Task title]** — priority: high
244
+ [Brief description]
245
+
246
+ 2. **[Task title]** — priority: medium
247
+ [Brief description]
248
+
249
+ [Continue for all tasks...]
250
+
251
+ ## Risks & Mitigations
252
+ | Risk | Mitigation |
253
+ |------|------------|
254
+ | ... | ... |
255
+
256
+ ## Success Criteria
257
+ - [ ] [Measurable criterion]
258
+ \\\`\\\`\\\`
259
+
260
+ ### 2B.4 — Create Plan
261
+
262
+ Call \`harmony_create_plan\` with:
263
+ - \`title\`: The plan title
264
+ - \`content\`: Full markdown document from Step 2B.3
265
+ - \`source\`: \`"agent"\`
266
+ - \`workflowPhase\`: \`"plan"\`
267
+ - \`tasks\`: Array of tasks from the Tasks section, each with:
268
+ - \`content\`: Task title + brief description
269
+ - \`priority\`: \`"high"\`, \`"medium"\`, or \`"low"\`
270
+ - \`status\`: \`"pending"\`
271
+
272
+ ### 2B.5 — User Approval
273
+
274
+ Show the user:
275
+ - Plan URL: \`https://gethmy.com/plans/{id}\`
276
+ - Number of tasks created
277
+ - Brief summary
278
+
279
+ Then ask: **"Ready to execute? I'll create board cards from these tasks and start the execution phase."**
280
+
281
+ Options:
282
+ 1. **Yes, advance to Execute** — proceed to Step 2B.6
283
+ 2. **Let me review first** — end here, they can advance later from the UI
284
+ 3. **Make changes** — iterate on the plan
285
+
286
+ ### 2B.6 — Advance to Execute
287
+
288
+ Call \`harmony_advance_plan\` with:
289
+ - \`planId\`: The plan ID from Step 2B.4
290
+ - \`phase\`: \`"execute"\`
291
+ - \`summary\`: A 2-3 sentence summary of the key decisions made during planning
292
+
293
+ Report the result:
294
+ - "Created N cards in 'To Do'. Use \`/hmy #<id>\` to start working on any card."
295
+ - List the created cards with their short IDs
296
+
297
+ ## Key Tools Reference
298
+
299
+ **Discovery:** \`harmony_list_plans\`, \`harmony_get_plan\`, \`harmony_get_card_by_short_id\`
300
+ **Context:** \`harmony_get_board\`, \`harmony_recall\`, \`harmony_memory_search\`
301
+ **Planning:** \`harmony_create_plan\`, \`harmony_advance_plan\`, \`harmony_update_plan\`
302
+ **Execution:** \`harmony_create_card\`, \`harmony_update_card\`
303
+ `;
304
+ /**
305
+ * Register MCP server using Claude CLI
306
+ * Returns true if successful, false if CLI unavailable or failed
307
+ */
308
+ async function registerMcpServer() {
309
+ try {
310
+ const { execSync } = await import("node:child_process");
311
+ // Use the official CLI command to register the MCP server (npx for no global install)
312
+ execSync("claude mcp add --transport stdio harmony -- npx -y @gethmy/mcp@latest serve", {
313
+ stdio: "pipe",
314
+ });
315
+ return true;
316
+ }
317
+ catch {
318
+ return false;
319
+ }
320
+ }
321
+ /**
322
+ * Write MCP server config directly to settings.json (fallback method)
323
+ */
324
+ async function writeMcpConfigFallback(home) {
325
+ const { readFileSync, writeFileSync, mkdirSync, existsSync } = await import("node:fs");
326
+ const settingsPath = join(home, ".claude", "settings.json");
327
+ const settingsDir = dirname(settingsPath);
328
+ // Ensure directory exists
329
+ if (!existsSync(settingsDir)) {
330
+ mkdirSync(settingsDir, { recursive: true });
331
+ }
332
+ // Read existing settings or start fresh
333
+ let settings = {};
334
+ if (existsSync(settingsPath)) {
335
+ try {
336
+ settings = JSON.parse(readFileSync(settingsPath, "utf-8"));
337
+ }
338
+ catch {
339
+ // Invalid JSON, start fresh
340
+ }
341
+ }
342
+ // Merge mcpServers config
343
+ const mcpServers = settings.mcpServers || {};
344
+ mcpServers.harmony = {
345
+ command: "npx",
346
+ args: ["-y", "@gethmy/mcp@latest", "serve"],
347
+ };
348
+ settings.mcpServers = mcpServers;
349
+ // Write back
350
+ writeFileSync(settingsPath, JSON.stringify(settings, null, 2));
351
+ }
352
+ /**
353
+ * Validate API key by testing connectivity
354
+ */
355
+ async function validateApiKey(apiKey, apiUrl = API_URL) {
356
+ try {
357
+ const response = await fetch(`${apiUrl}/v1/workspaces`, {
358
+ method: "GET",
359
+ headers: {
360
+ "Content-Type": "application/json",
361
+ "X-API-Key": apiKey,
362
+ },
363
+ });
364
+ if (!response.ok) {
365
+ const data = await response.json().catch(() => ({}));
366
+ return {
367
+ valid: false,
368
+ error: data.error || `API returned ${response.status}`,
369
+ };
370
+ }
371
+ // Try to get user info from /me endpoint if available
372
+ const meResponse = await fetch(`${apiUrl}/v1/me`, {
373
+ method: "GET",
374
+ headers: {
375
+ "Content-Type": "application/json",
376
+ "X-API-Key": apiKey,
377
+ },
378
+ });
379
+ if (meResponse.ok) {
380
+ const meData = await meResponse.json();
381
+ return { valid: true, email: meData.user?.email };
382
+ }
383
+ return { valid: true };
384
+ }
385
+ catch (error) {
386
+ return {
387
+ valid: false,
388
+ error: error instanceof Error ? error.message : "Connection failed",
389
+ };
390
+ }
391
+ }
392
+ /**
393
+ * Fetch workspaces from API
394
+ */
395
+ async function fetchWorkspaces(apiKey) {
396
+ const response = await fetch(`${API_URL}/v1/workspaces`, {
397
+ method: "GET",
398
+ headers: {
399
+ "Content-Type": "application/json",
400
+ "X-API-Key": apiKey,
401
+ },
402
+ });
403
+ if (!response.ok) {
404
+ throw new Error(`Failed to fetch workspaces: ${response.status}`);
405
+ }
406
+ const data = await response.json();
407
+ return data.workspaces || [];
408
+ }
409
+ /**
410
+ * Fetch projects from API
411
+ */
412
+ async function fetchProjects(apiKey, workspaceId) {
413
+ const response = await fetch(`${API_URL}/v1/workspaces/${workspaceId}/projects`, {
414
+ method: "GET",
415
+ headers: {
416
+ "Content-Type": "application/json",
417
+ "X-API-Key": apiKey,
418
+ },
419
+ });
420
+ if (!response.ok) {
421
+ throw new Error(`Failed to fetch projects: ${response.status}`);
422
+ }
423
+ const data = await response.json();
424
+ return data.projects || [];
425
+ }
426
+ /**
427
+ * Generate agent configuration files
428
+ */
429
+ function getAgentFiles(agentId, cwd, installMode = "global") {
430
+ const home = homedir();
431
+ const files = [];
432
+ const symlinks = [];
433
+ switch (agentId) {
434
+ case "claude": {
435
+ // Claude Code skill file
436
+ const skillContent = `---
437
+ name: hmy
438
+ description: Start working on a Harmony card. Use when given a card reference like #42, UUID, or card name to implement.
439
+ argument-hint: <card-reference>
440
+ ---
441
+
442
+ ${HARMONY_WORKFLOW_PROMPT.replace("Your agent identifier", "claude-code").replace("Your agent name", "Claude Code")}
443
+ `;
444
+ // hmy-plan skill file (unified plan creation + execution)
445
+ const planSkillContent = `---
446
+ name: hmy-plan
447
+ description: Create a new plan or work on an existing one. Use when asked to plan a feature, execute a plan, review a plan, or given a plan reference.
448
+ argument-hint: [plan name, ID, or topic to plan]
449
+ ---
450
+
451
+ ${HARMONY_PLAN_PROMPT.replace("$ARGUMENTS", "$ARGUMENTS")}
452
+ `;
453
+ if (installMode === "global") {
454
+ // Global mode: Write skills to ~/.agents/skills/, symlink directories to ~/.claude/skills/
455
+ files.push({
456
+ path: join(GLOBAL_SKILLS_DIR, "hmy", "SKILL.md"),
457
+ content: skillContent,
458
+ type: "text",
459
+ });
460
+ symlinks.push({
461
+ target: join(GLOBAL_SKILLS_DIR, "hmy"),
462
+ link: join(home, ".claude", "skills", "hmy"),
463
+ });
464
+ files.push({
465
+ path: join(GLOBAL_SKILLS_DIR, "hmy-plan", "SKILL.md"),
466
+ content: planSkillContent,
467
+ type: "text",
468
+ });
469
+ symlinks.push({
470
+ target: join(GLOBAL_SKILLS_DIR, "hmy-plan"),
471
+ link: join(home, ".claude", "skills", "hmy-plan"),
472
+ });
473
+ }
474
+ else {
475
+ // Local mode: Write skills directly to project directory
476
+ files.push({
477
+ path: join(cwd, ".claude", "skills", "hmy", "SKILL.md"),
478
+ content: skillContent,
479
+ type: "text",
480
+ });
481
+ files.push({
482
+ path: join(cwd, ".claude", "skills", "hmy-plan", "SKILL.md"),
483
+ content: planSkillContent,
484
+ type: "text",
485
+ });
486
+ }
487
+ // Note: MCP server registration is handled separately via `claude mcp add` CLI
488
+ // in runSetup() after file writing, with fallback to settings.json if CLI unavailable
489
+ break;
490
+ }
491
+ case "codex": {
492
+ // AGENTS.md in project root (always local - project context)
493
+ const agentsContent = `# Harmony Integration
494
+
495
+ This project uses Harmony for task management. When working on tasks:
496
+
497
+ ## Starting Work on a Card
498
+
499
+ When given a card reference (e.g., #42 or a card name), follow this workflow:
500
+
501
+ 1. Use \`harmony_get_card_by_short_id\` or \`harmony_search_cards\` to find the card
502
+ 2. Move the card to "In Progress" using \`harmony_move_card\`
503
+ 3. Add the "agent" label using \`harmony_add_label_to_card\`
504
+ 4. Start a session with \`harmony_start_agent_session\` (agentIdentifier: "codex", agentName: "OpenAI Codex")
505
+ 5. Show the card details to the user
506
+ 6. Use \`harmony_generate_prompt\` to get guidance, then implement the solution
507
+ 7. Update progress periodically with \`harmony_update_agent_progress\`
508
+ 8. When done, call \`harmony_end_agent_session\` and move to "Review"
509
+
510
+ ## Available Harmony Tools
511
+
512
+ - \`harmony_get_card\`, \`harmony_get_card_by_short_id\`, \`harmony_search_cards\` - Find cards
513
+ - \`harmony_move_card\` - Move cards between columns
514
+ - \`harmony_add_label_to_card\`, \`harmony_remove_label_from_card\` - Manage labels
515
+ - \`harmony_start_agent_session\`, \`harmony_update_agent_progress\`, \`harmony_end_agent_session\` - Track work
516
+ - \`harmony_get_board\` - Get board state
517
+ - \`harmony_generate_prompt\` - Get role-based guidance and focus areas for the card
518
+ `;
519
+ files.push({
520
+ path: join(cwd, "AGENTS.md"),
521
+ content: agentsContent,
522
+ type: "text",
523
+ });
524
+ // Codex prompt file
525
+ const promptContent = `---
526
+ name: hmy
527
+ description: Start working on a Harmony card
528
+ arguments:
529
+ - name: card
530
+ description: Card reference (#42, UUID, or name)
531
+ required: true
532
+ ---
533
+
534
+ ${HARMONY_WORKFLOW_PROMPT.replace("$ARGUMENTS", "{{card}}").replace("Your agent identifier", "codex").replace("Your agent name", "OpenAI Codex")}
535
+ `;
536
+ if (installMode === "global") {
537
+ // Global mode: Write prompt to central location, symlink to ~/.codex/prompts/
538
+ files.push({
539
+ path: join(GLOBAL_SKILLS_DIR, "codex", "hmy.md"),
540
+ content: promptContent,
541
+ type: "text",
542
+ });
543
+ symlinks.push({
544
+ target: join(GLOBAL_SKILLS_DIR, "codex", "hmy.md"),
545
+ link: join(home, ".codex", "prompts", "hmy.md"),
546
+ });
547
+ }
548
+ else {
549
+ // Local mode: Write prompt directly to ~/.codex/prompts/
550
+ files.push({
551
+ path: join(home, ".codex", "prompts", "hmy.md"),
552
+ content: promptContent,
553
+ type: "text",
554
+ });
555
+ }
556
+ // Codex config.toml (always global)
557
+ const tomlContent = `
558
+ # Harmony MCP Server
559
+ [mcp_servers.harmony]
560
+ command = "npx"
561
+ args = ["-y", "@gethmy/mcp@latest", "serve"]
562
+ `;
563
+ files.push({
564
+ path: join(home, ".codex", "config.toml"),
565
+ content: tomlContent,
566
+ type: "toml",
567
+ tomlSection: "mcp_servers.harmony",
568
+ });
569
+ break;
570
+ }
571
+ case "cursor": {
572
+ // Cursor MCP config (always project-level)
573
+ files.push({
574
+ path: join(cwd, ".cursor", "mcp.json"),
575
+ content: JSON.stringify({
576
+ mcpServers: {
577
+ harmony: {
578
+ command: "npx",
579
+ args: ["-y", "@gethmy/mcp@latest", "serve"],
580
+ },
581
+ },
582
+ }, null, 2),
583
+ type: "json",
584
+ });
585
+ // Cursor rule file
586
+ const ruleContent = `---
587
+ description: Harmony card workflow rule
588
+ globs:
589
+ - "**/*"
590
+ alwaysApply: false
591
+ ---
592
+
593
+ # Harmony Integration
594
+
595
+ When the user asks you to work on a Harmony card (references like #42, card names, or UUIDs):
596
+
597
+ ${HARMONY_WORKFLOW_PROMPT.replace("$ARGUMENTS", "the card reference").replace("Your agent identifier", "cursor").replace("Your agent name", "Cursor AI")}
598
+ `;
599
+ if (installMode === "global") {
600
+ // Global mode: Write rule to central location, symlink to ~/.cursor/rules/
601
+ files.push({
602
+ path: join(GLOBAL_SKILLS_DIR, "cursor", "harmony.mdc"),
603
+ content: ruleContent,
604
+ type: "text",
605
+ });
606
+ symlinks.push({
607
+ target: join(GLOBAL_SKILLS_DIR, "cursor", "harmony.mdc"),
608
+ link: join(home, ".cursor", "rules", "harmony.mdc"),
609
+ });
610
+ }
611
+ else {
612
+ // Local mode: Write rule directly to project directory
613
+ files.push({
614
+ path: join(cwd, ".cursor", "rules", "harmony.mdc"),
615
+ content: ruleContent,
616
+ type: "text",
617
+ });
618
+ }
619
+ break;
620
+ }
621
+ case "windsurf": {
622
+ // Windsurf global MCP config (always global)
623
+ files.push({
624
+ path: join(home, ".codeium", "windsurf", "mcp_config.json"),
625
+ content: JSON.stringify({
626
+ mcpServers: {
627
+ harmony: {
628
+ command: "npx",
629
+ args: ["-y", "@gethmy/mcp@latest", "serve"],
630
+ disabled: false,
631
+ alwaysAllow: [],
632
+ },
633
+ },
634
+ }, null, 2),
635
+ type: "json",
636
+ });
637
+ // Windsurf rule file
638
+ const ruleContent = `---
639
+ trigger: model_decision
640
+ description: Activate when user asks to work on a Harmony card (references like #42, card names, or task management)
641
+ ---
642
+
643
+ # Harmony Card Workflow
644
+
645
+ When working on a Harmony card:
646
+
647
+ ${HARMONY_WORKFLOW_PROMPT.replace("$ARGUMENTS", "the card reference").replace("Your agent identifier", "windsurf").replace("Your agent name", "Windsurf AI")}
648
+ `;
649
+ if (installMode === "global") {
650
+ // Global mode: Write rule to central location, symlink to ~/.codeium/windsurf/rules/
651
+ files.push({
652
+ path: join(GLOBAL_SKILLS_DIR, "windsurf", "harmony.md"),
653
+ content: ruleContent,
654
+ type: "text",
655
+ });
656
+ symlinks.push({
657
+ target: join(GLOBAL_SKILLS_DIR, "windsurf", "harmony.md"),
658
+ link: join(home, ".codeium", "windsurf", "rules", "harmony.md"),
659
+ });
660
+ }
661
+ else {
662
+ // Local mode: Write rule directly to project directory
663
+ files.push({
664
+ path: join(cwd, ".windsurf", "rules", "harmony.md"),
665
+ content: ruleContent,
666
+ type: "text",
667
+ });
668
+ }
669
+ break;
670
+ }
671
+ }
672
+ return { files, symlinks };
673
+ }
674
+ /**
675
+ * Main setup wizard with smart detection
676
+ */
677
+ export async function runSetup(options = {}) {
678
+ const cwd = process.cwd();
679
+ const home = homedir();
680
+ console.clear();
681
+ console.log(messages.header());
682
+ // Check existing configuration
683
+ const existingConfig = loadConfig();
684
+ const alreadyConfigured = isConfigured();
685
+ const skillsStatus = areSkillsInstalled(cwd);
686
+ const hasContext = hasProjectContext(cwd);
687
+ // Track what we need to do
688
+ let needsApiKey = !alreadyConfigured;
689
+ let needsSkills = !skillsStatus.installed || options.force;
690
+ let needsContext = !hasContext && !options.skipContext;
691
+ // If workspace/project provided via flags, we'll set context
692
+ if (options.workspaceId || options.projectId) {
693
+ needsContext = true;
694
+ }
695
+ // Step 1: API Key
696
+ let apiKey = options.apiKey || existingConfig.apiKey;
697
+ let userEmail = options.userEmail || existingConfig.userEmail || undefined;
698
+ if (needsApiKey || !apiKey || !apiKey.startsWith("hmy_")) {
699
+ const keyInput = await p.text({
700
+ message: "Enter your Harmony API key",
701
+ placeholder: "hmy_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
702
+ validate: (value) => {
703
+ if (!value)
704
+ return "API key is required";
705
+ if (!value.startsWith("hmy_"))
706
+ return 'API key must start with "hmy_"';
707
+ if (value.length < 20)
708
+ return "API key is too short";
709
+ return undefined;
710
+ },
711
+ });
712
+ if (p.isCancel(keyInput)) {
713
+ p.cancel("Setup cancelled");
714
+ process.exit(0);
715
+ }
716
+ apiKey = keyInput;
717
+ needsApiKey = true;
718
+ }
719
+ else {
720
+ p.log.success(`Using existing API key: ${apiKey.slice(0, 8)}...`);
721
+ }
722
+ // Validate API key
723
+ const spinner = p.spinner();
724
+ spinner.start("Validating API key...");
725
+ const validation = await validateApiKey(apiKey);
726
+ if (!validation.valid) {
727
+ spinner.stop(colors.error("API key validation failed"));
728
+ p.log.error(validation.error || "Could not connect to Harmony API");
729
+ p.log.info("Get an API key at: https://gethmy.com/user/keys");
730
+ process.exit(1);
731
+ }
732
+ if (!userEmail) {
733
+ userEmail = validation.email;
734
+ }
735
+ spinner.stop(colors.success(userEmail ? `Connected as ${userEmail}` : "API key validated"));
736
+ // Step 2: Check if skills are already installed
737
+ let selectedAgents = [];
738
+ let installMode = options.installMode || "global";
739
+ if (skillsStatus.installed && !options.force) {
740
+ p.log.success(`Skills already installed (${skillsStatus.location})`);
741
+ const reinstall = await p.confirm({
742
+ message: "Reinstall skills?",
743
+ initialValue: false,
744
+ });
745
+ if (p.isCancel(reinstall)) {
746
+ p.cancel("Setup cancelled");
747
+ process.exit(0);
748
+ }
749
+ needsSkills = reinstall;
750
+ }
751
+ if (needsSkills) {
752
+ // Detect and select agents
753
+ const detectedAgents = detectAgents(cwd);
754
+ if (options.agents && options.agents.length > 0) {
755
+ selectedAgents = options.agents;
756
+ }
757
+ else {
758
+ const agentOptions = detectedAgents.map((agent) => ({
759
+ value: agent.id,
760
+ label: agent.name,
761
+ hint: agent.detected
762
+ ? colors.success(`${agent.description} (detected)`)
763
+ : colors.dim(`${agent.description}`),
764
+ }));
765
+ const agentSelection = await p.multiselect({
766
+ message: "Select agents to configure",
767
+ options: agentOptions,
768
+ initialValues: detectedAgents
769
+ .filter((a) => a.detected)
770
+ .map((a) => a.id),
771
+ required: true,
772
+ });
773
+ if (p.isCancel(agentSelection)) {
774
+ p.cancel("Setup cancelled");
775
+ process.exit(0);
776
+ }
777
+ selectedAgents = agentSelection;
778
+ }
779
+ if (selectedAgents.length === 0) {
780
+ p.log.warning("No agents selected. Skipping skills installation.");
781
+ needsSkills = false;
782
+ }
783
+ else if (!options.installMode) {
784
+ // Select install mode
785
+ const modeSelection = await p.select({
786
+ message: "Where should Harmony skills be installed?",
787
+ options: [
788
+ {
789
+ value: "global",
790
+ label: "Global (shared) - Recommended",
791
+ hint: "Skills in ~/.agents/skills/, available in all projects",
792
+ },
793
+ {
794
+ value: "local",
795
+ label: "Local (project directory)",
796
+ hint: "Skills in .claude/skills/, committed to git",
797
+ },
798
+ ],
799
+ initialValue: "global",
800
+ });
801
+ if (p.isCancel(modeSelection)) {
802
+ p.cancel("Setup cancelled");
803
+ process.exit(0);
804
+ }
805
+ installMode = modeSelection;
806
+ }
807
+ }
808
+ // Step 3: Workspace and Project Selection
809
+ let selectedWorkspaceId = options.workspaceId;
810
+ let selectedProjectId = options.projectId;
811
+ let selectedWorkspaceName;
812
+ let selectedProjectName;
813
+ if (needsContext && !options.skipContext) {
814
+ // Fetch workspaces
815
+ spinner.start("Fetching workspaces...");
816
+ let workspaces = [];
817
+ try {
818
+ workspaces = await fetchWorkspaces(apiKey);
819
+ spinner.stop(colors.success(`Found ${workspaces.length} workspace(s)`));
820
+ }
821
+ catch (_error) {
822
+ spinner.stop(colors.warning("Could not fetch workspaces"));
823
+ p.log.warning("Skipping workspace/project selection. You can set this later.");
824
+ needsContext = false;
825
+ }
826
+ if (needsContext && workspaces.length > 0) {
827
+ // Select workspace
828
+ if (!selectedWorkspaceId) {
829
+ const workspaceOptions = workspaces.map((ws) => ({
830
+ value: ws.id,
831
+ label: ws.name,
832
+ }));
833
+ const workspaceSelection = await p.select({
834
+ message: "Select workspace",
835
+ options: workspaceOptions,
836
+ });
837
+ if (p.isCancel(workspaceSelection)) {
838
+ p.cancel("Setup cancelled");
839
+ process.exit(0);
840
+ }
841
+ selectedWorkspaceId = workspaceSelection;
842
+ }
843
+ selectedWorkspaceName = workspaces.find((w) => w.id === selectedWorkspaceId)?.name;
844
+ // Fetch and select project
845
+ spinner.start("Fetching projects...");
846
+ let projects = [];
847
+ try {
848
+ projects = await fetchProjects(apiKey, selectedWorkspaceId);
849
+ spinner.stop(colors.success(`Found ${projects.length} project(s)`));
850
+ }
851
+ catch (_error) {
852
+ spinner.stop(colors.warning("Could not fetch projects"));
853
+ p.log.warning("Skipping project selection. You can set this later.");
854
+ }
855
+ if (projects.length > 0 && !selectedProjectId) {
856
+ const projectOptions = projects.map((proj) => ({
857
+ value: proj.id,
858
+ label: proj.name,
859
+ hint: proj.description
860
+ ? colors.dim(proj.description.slice(0, 50))
861
+ : undefined,
862
+ }));
863
+ const projectSelection = await p.select({
864
+ message: "Select project",
865
+ options: projectOptions,
866
+ });
867
+ if (p.isCancel(projectSelection)) {
868
+ p.cancel("Setup cancelled");
869
+ process.exit(0);
870
+ }
871
+ selectedProjectId = projectSelection;
872
+ selectedProjectName = projects.find((p) => p.id === selectedProjectId)?.name;
873
+ }
874
+ }
875
+ }
876
+ // Step 4: Collect all files and symlinks to create
877
+ const allFiles = [];
878
+ const allSymlinks = [];
879
+ // Always save global config if we have an API key change
880
+ if (needsApiKey || !alreadyConfigured) {
881
+ allFiles.push({
882
+ path: getConfigPath(),
883
+ content: JSON.stringify({
884
+ apiKey,
885
+ apiUrl: API_URL,
886
+ userEmail: userEmail || null,
887
+ activeWorkspaceId: null,
888
+ activeProjectId: null,
889
+ }, null, 2),
890
+ type: "text", // Use text to avoid merging
891
+ });
892
+ }
893
+ // Project docs scaffold / verification
894
+ if (!options.skipDocs) {
895
+ const docsResult = await runDocsStep(cwd);
896
+ if (!docsResult.skipped) {
897
+ for (const file of docsResult.files) {
898
+ allFiles.push(file);
899
+ }
900
+ }
901
+ }
902
+ // Agent-specific files
903
+ if (needsSkills && selectedAgents.length > 0) {
904
+ for (const agentId of selectedAgents) {
905
+ const { files, symlinks } = getAgentFiles(agentId, cwd, installMode);
906
+ allFiles.push(...files);
907
+ allSymlinks.push(...symlinks);
908
+ }
909
+ }
910
+ // Step 5: Show summary
911
+ const detectedAgents = detectAgents(cwd);
912
+ console.log("");
913
+ p.log.step("Summary");
914
+ console.log("");
915
+ console.log(` ${colors.bold("API Key:")} ${apiKey.slice(0, 8)}...`);
916
+ if (userEmail) {
917
+ console.log(` ${colors.bold("Email:")} ${userEmail}`);
918
+ }
919
+ if (needsSkills && selectedAgents.length > 0) {
920
+ console.log(` ${colors.bold("Agents:")} ${selectedAgents.map((a) => detectedAgents.find((d) => d.id === a)?.name).join(", ")}`);
921
+ console.log(` ${colors.bold("Install:")} ${installMode === "global" ? "Global (~/.agents/skills/)" : "Local (project)"}`);
922
+ }
923
+ else {
924
+ console.log(` ${colors.bold("Skills:")} Already installed (${skillsStatus.location || "none"})`);
925
+ }
926
+ if (selectedWorkspaceId) {
927
+ console.log(` ${colors.bold("Workspace:")} ${selectedWorkspaceName || selectedWorkspaceId}`);
928
+ }
929
+ if (selectedProjectId) {
930
+ console.log(` ${colors.bold("Project:")} ${selectedProjectName || selectedProjectId}`);
931
+ }
932
+ if (allFiles.length > 0) {
933
+ const summary = getWriteSummary(allFiles, { force: options.force });
934
+ if (summary.toCreate.length > 0) {
935
+ console.log("");
936
+ console.log(` ${colors.success("Files to create:")}`);
937
+ for (const path of summary.toCreate) {
938
+ console.log(` ${colors.dim("\u2022")} ${path}`);
939
+ }
940
+ }
941
+ if (allSymlinks.length > 0) {
942
+ console.log("");
943
+ console.log(` ${colors.info("Symlinks to create:")}`);
944
+ for (const symlink of allSymlinks) {
945
+ console.log(` ${colors.dim("\u{1F517}")} ${formatPath(symlink.link, home)} → ${formatPath(symlink.target, home)}`);
946
+ }
947
+ }
948
+ if (summary.toUpdate.length > 0) {
949
+ console.log("");
950
+ console.log(` ${colors.info("Files to update:")}`);
951
+ for (const path of summary.toUpdate) {
952
+ console.log(` ${colors.dim("\u2022")} ${path}`);
953
+ }
954
+ }
955
+ if (summary.toSkip.length > 0 && !options.force) {
956
+ console.log("");
957
+ console.log(` ${colors.dim("Files to skip (already exist):")}`);
958
+ for (const path of summary.toSkip) {
959
+ console.log(` ${colors.dim("\u2022")} ${path}`);
960
+ }
961
+ }
962
+ }
963
+ console.log("");
964
+ // Step 6: Confirm and execute
965
+ const shouldProceed = await p.confirm({
966
+ message: "Proceed with setup?",
967
+ initialValue: true,
968
+ });
969
+ if (p.isCancel(shouldProceed) || !shouldProceed) {
970
+ p.cancel("Setup cancelled");
971
+ process.exit(0);
972
+ }
973
+ console.log("");
974
+ // Step 7: Write files
975
+ if (allFiles.length > 0) {
976
+ await writeFilesWithProgress(allFiles, { force: options.force });
977
+ }
978
+ // Step 8: Create symlinks
979
+ if (allSymlinks.length > 0) {
980
+ for (const symlink of allSymlinks) {
981
+ try {
982
+ // Ensure parent directory exists
983
+ const linkDir = dirname(symlink.link);
984
+ if (!existsSync(linkDir)) {
985
+ mkdirSync(linkDir, { recursive: true });
986
+ }
987
+ // Check if link already exists
988
+ let linkExists = false;
989
+ try {
990
+ lstatSync(symlink.link);
991
+ linkExists = true;
992
+ }
993
+ catch {
994
+ // Link doesn't exist
995
+ }
996
+ if (linkExists) {
997
+ if (options.force) {
998
+ unlinkSync(symlink.link);
999
+ }
1000
+ else {
1001
+ // Skip existing symlink
1002
+ continue;
1003
+ }
1004
+ }
1005
+ symlinkSync(symlink.target, symlink.link);
1006
+ }
1007
+ catch {
1008
+ p.log.warning(`Failed to create symlink: ${symlink.link}`);
1009
+ }
1010
+ }
1011
+ }
1012
+ // Step 8b: Register MCP server for Claude (project-local scope)
1013
+ const claudeDetected = detectAgents(cwd).some((a) => a.id === "claude" && a.detected);
1014
+ if (claudeDetected || selectedAgents.includes("claude")) {
1015
+ const mcpRegistered = await registerMcpServer();
1016
+ if (mcpRegistered) {
1017
+ console.log(` ${colors.success("\u2713")} ${colors.dim("MCP server registered via claude CLI")}`);
1018
+ }
1019
+ else {
1020
+ // Fallback: write directly to settings.json
1021
+ try {
1022
+ await writeMcpConfigFallback(home);
1023
+ console.log(` ${colors.success("\u2713")} ${colors.dim(formatPath(join(home, ".claude", "settings.json"), home))} ${colors.dim("(updated)")}`);
1024
+ }
1025
+ catch {
1026
+ p.log.warning("Could not register MCP server. Run manually: claude mcp add --transport stdio harmony -- npx -y @gethmy/mcp@latest serve");
1027
+ }
1028
+ }
1029
+ }
1030
+ // Step 9: Save local context
1031
+ if (selectedWorkspaceId || selectedProjectId) {
1032
+ const localConfig = {};
1033
+ if (selectedWorkspaceId)
1034
+ localConfig.workspaceId = selectedWorkspaceId;
1035
+ if (selectedProjectId)
1036
+ localConfig.projectId = selectedProjectId;
1037
+ saveLocalConfig(localConfig, cwd);
1038
+ console.log(` ${colors.success("\u2713")} ${colors.dim(formatPath(getLocalConfigPath(cwd), home))} ${colors.dim("(created)")}`);
1039
+ }
1040
+ // Step 10: Show completion message
1041
+ console.log("");
1042
+ p.outro(colors.success("Setup complete!"));
1043
+ console.log("");
1044
+ console.log(` ${colors.bold("Configuration:")}`);
1045
+ console.log(` API key: ${formatPath(getConfigPath(), home)}`);
1046
+ if (needsSkills && selectedAgents.length > 0) {
1047
+ console.log(` Skills: ${installMode === "global" ? "~/.agents/skills/ (global)" : ".claude/skills/ (local)"}`);
1048
+ }
1049
+ if (selectedWorkspaceId || selectedProjectId) {
1050
+ console.log(` Context: ${formatPath(getLocalConfigPath(cwd), home)}`);
1051
+ }
1052
+ console.log("");
1053
+ console.log(` ${colors.bold("Usage:")}`);
1054
+ if (!needsSkills || selectedAgents.includes("claude")) {
1055
+ console.log(` ${colors.brand("Claude Code:")} ${colors.highlight("/hmy #42")} or ${colors.highlight("/hmy-plan")} ${colors.dim("(create or execute plans)")}`);
1056
+ }
1057
+ if (selectedAgents.includes("codex")) {
1058
+ console.log(` ${colors.brand("Codex:")} ${colors.highlight("/prompts:hmy #42")}`);
1059
+ }
1060
+ if (selectedAgents.includes("cursor") ||
1061
+ selectedAgents.includes("windsurf")) {
1062
+ console.log(` ${colors.brand("Cursor/Windsurf:")} MCP tools available automatically`);
1063
+ }
1064
+ console.log("");
1065
+ console.log(` ${colors.dim("Add to new project: npx @gethmy/mcp setup")}`);
1066
+ console.log(` ${colors.dim("Need help? Visit https://gethmy.com/docs/mcp")}`);
1067
+ console.log("");
1068
+ }