@gwdn/nexus-mcp 0.8.7 → 0.8.9

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 (53) hide show
  1. package/dist/server.js +1 -1
  2. package/dist/tools/create-task.d.ts +1 -1
  3. package/dist/tools/create-task.js +3 -3
  4. package/dist/tools/directives.d.ts +2 -2
  5. package/dist/tools/letters.d.ts +1 -1
  6. package/dist/tools/update-task-status.d.ts +1 -1
  7. package/package.json +8 -2
  8. package/.github/workflows/ci.yml +0 -38
  9. package/.github/workflows/release.yml +0 -57
  10. package/src/__tests__/auth.test.ts +0 -162
  11. package/src/__tests__/decision-comments.test.ts +0 -173
  12. package/src/__tests__/e2e-integration.test.ts +0 -443
  13. package/src/__tests__/helpers.ts +0 -58
  14. package/src/__tests__/layer1-knowledge.test.ts +0 -302
  15. package/src/__tests__/layer2-coordination.test.ts +0 -918
  16. package/src/__tests__/layer3-governance.test.ts +0 -205
  17. package/src/__tests__/machine-id.test.ts +0 -136
  18. package/src/__tests__/nexus-api.test.ts +0 -127
  19. package/src/__tests__/project-list-and-skill-assign.test.ts +0 -282
  20. package/src/__tests__/reviews.test.ts +0 -420
  21. package/src/__tests__/server.test.ts +0 -251
  22. package/src/__tests__/setup.ts +0 -15
  23. package/src/__tests__/task-list-and-doc-list.test.ts +0 -226
  24. package/src/auth.ts +0 -81
  25. package/src/machine-id.ts +0 -60
  26. package/src/nexus-api.ts +0 -149
  27. package/src/server.ts +0 -629
  28. package/src/tools/add-task-note.ts +0 -50
  29. package/src/tools/append-session-entry.ts +0 -113
  30. package/src/tools/classify-document.ts +0 -55
  31. package/src/tools/create-task.ts +0 -66
  32. package/src/tools/decision-comments.ts +0 -103
  33. package/src/tools/delete-document.ts +0 -43
  34. package/src/tools/directives.ts +0 -303
  35. package/src/tools/get-document.ts +0 -80
  36. package/src/tools/get-project-memory.ts +0 -65
  37. package/src/tools/get-related-entities.ts +0 -73
  38. package/src/tools/governance.ts +0 -165
  39. package/src/tools/ingest-document.ts +0 -65
  40. package/src/tools/letter-inbox.ts +0 -157
  41. package/src/tools/letters.ts +0 -144
  42. package/src/tools/list-documents.ts +0 -58
  43. package/src/tools/list-tasks.ts +0 -57
  44. package/src/tools/project-list.ts +0 -52
  45. package/src/tools/reviews.ts +0 -281
  46. package/src/tools/search-knowledge.ts +0 -68
  47. package/src/tools/sessions.ts +0 -157
  48. package/src/tools/skill-assign.ts +0 -142
  49. package/src/tools/skills.ts +0 -255
  50. package/src/tools/update-document.ts +0 -66
  51. package/src/tools/update-task-status.ts +0 -64
  52. package/tsconfig.json +0 -21
  53. package/vitest.config.ts +0 -8
package/src/server.ts DELETED
@@ -1,629 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * nexus-mcp -- MCP Server for Nexus
4
- *
5
- * Provides Knowledge Access (Layer 1), Coordination (Layer 2),
6
- * Governance (Layer 3), and Reviews (Layer 4) tools.
7
- * Runs as a standalone stdio MCP server.
8
- *
9
- * Authentication:
10
- * Identity is resolved once at startup from NEXUS_PRIVATE_TOKEN (nxs_pat_*).
11
- * All write tools receive user_id automatically from the resolved identity.
12
- * Callers no longer pass user_id as a parameter.
13
- *
14
- * Layer 1 - Knowledge Access:
15
- * - kb_search: Search project knowledge (keyword/semantic/hybrid)
16
- * - kb_memory: Curated project context for agent bootstrapping
17
- * - kb_get: Fetch a single knowledge object
18
- * - kb_related: Navigate entity relationships
19
- * - project_list: List accessible projects
20
- *
21
- * Layer 2 - Coordination:
22
- * - vl_create: Create a new vault letter
23
- * - vl_reply: Reply to an existing vault letter
24
- * - vl_inbox: List letters addressed to the calling agent/user
25
- * - vl_outbox: List letters sent by the calling agent/user
26
- * - vl_ack: Acknowledge receipt of a new vault letter
27
- * - task_create: Create a task in a project
28
- * - task_update: Update task status, priority, or assignee
29
- * - task_note: Append a note to a task (append-only)
30
- * - task_list: List tasks for a project with filters
31
- * - dc_add: Add a comment to an ADR (append-only)
32
- * - dc_list: List comments for an ADR
33
- * - sk_list: List skills for the current tenant
34
- * - sk_get: Get full skill content by identifier
35
- * - sk_create: Create a new skill in draft status
36
- * - sk_update: Update skill content or metadata
37
- * - sk_activate: Change skill status (draft/active/archived)
38
- * - sk_assign: Assign a skill to a project
39
- * - sk_unassign: Remove a skill assignment from a project
40
- * - sk_export: Export all skill assignments for a project
41
- * - pd_list: List project directives
42
- * - pd_get: Get a specific directive
43
- * - pd_create: Create a new directive
44
- * - pd_update: Update an existing directive
45
- * - pd_delete: Delete a directive
46
- * - pd_toggle: Toggle directive enabled/disabled
47
- * - directive_export: Export enabled directives (CLI format)
48
- * - doc_ingest: Push text/markdown content into project knowledge base
49
- * - doc_list: List ingested documents for a project
50
- * - session_append: Append to a session (write-isolated)
51
- * - session_create: Start a new work session
52
- * - session_close: End a session with summary and next entry point
53
- * - session_list: List open sessions for a project
54
- *
55
- * Layer 3 - Governance:
56
- * - adr_create: Create a new ADR draft
57
- * - adr_submit: Submit an ADR for review
58
- * - adr_decide: Accept or reject an ADR
59
- *
60
- * Layer 4 - Reviews:
61
- * - rv_list: List reviews with optional filters
62
- * - rv_get: Get a review by ID or entity reference
63
- * - rv_create: Create a new review for an entity
64
- * - rv_decide: Transition a review state
65
- * - rv_comment: Add a comment to a review
66
- *
67
- * Usage:
68
- * npx tsx src/mcp/server.ts
69
- *
70
- * Or via .mcp.json configuration:
71
- * { "command": "npx", "args": ["tsx", "src/mcp/server.ts"] }
72
- */
73
-
74
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
75
- import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
76
-
77
- import { getIdentity, initIdentity } from './auth.js'
78
-
79
- // Layer 1: Knowledge Access
80
- import { projectList, projectListSchema } from './tools/project-list.js'
81
- import { getDocument, getDocumentSchema } from './tools/get-document.js'
82
- import {
83
- getProjectMemory,
84
- getProjectMemorySchema,
85
- } from './tools/get-project-memory.js'
86
- import {
87
- getRelatedEntities,
88
- getRelatedEntitiesSchema,
89
- } from './tools/get-related-entities.js'
90
- import {
91
- searchKnowledge,
92
- searchKnowledgeSchema,
93
- } from './tools/search-knowledge.js'
94
-
95
- // Layer 2: Coordination
96
- import { addTaskNote, addTaskNoteSchema } from './tools/add-task-note.js'
97
- import {
98
- appendSessionEntry,
99
- appendSessionEntrySchema,
100
- } from './tools/append-session-entry.js'
101
- import { createTask, createTaskSchema } from './tools/create-task.js'
102
- import {
103
- addDecisionComment,
104
- addDecisionCommentSchema,
105
- listDecisionComments,
106
- listDecisionCommentsSchema,
107
- } from './tools/decision-comments.js'
108
- import {
109
- ingestDocument,
110
- ingestDocumentSchema,
111
- } from './tools/ingest-document.js'
112
- import {
113
- classifyDocument,
114
- classifyDocumentSchema,
115
- } from './tools/classify-document.js'
116
- import {
117
- updateDocument,
118
- updateDocumentSchema,
119
- } from './tools/update-document.js'
120
- import {
121
- deleteDocument,
122
- deleteDocumentSchema,
123
- } from './tools/delete-document.js'
124
- import {
125
- acknowledgeLetter,
126
- acknowledgeLetterSchema,
127
- listInbox,
128
- listInboxSchema,
129
- listOutbox,
130
- listOutboxSchema,
131
- } from './tools/letter-inbox.js'
132
- import {
133
- createLetter,
134
- createLetterSchema,
135
- replyLetter,
136
- replyLetterSchema,
137
- } from './tools/letters.js'
138
- import {
139
- listDocuments,
140
- listDocumentsSchema,
141
- } from './tools/list-documents.js'
142
- import { listTasks, listTasksSchema } from './tools/list-tasks.js'
143
- import {
144
- closeSession,
145
- closeSessionSchema,
146
- createSession,
147
- createSessionSchema,
148
- listOpenSessions,
149
- listOpenSessionsSchema,
150
- } from './tools/sessions.js'
151
- import {
152
- skActivate,
153
- skActivateSchema,
154
- skCreate,
155
- skCreateSchema,
156
- skGet,
157
- skGetSchema,
158
- skList,
159
- skListSchema,
160
- skUpdate,
161
- skUpdateSchema,
162
- } from './tools/skills.js'
163
- import {
164
- skAssign,
165
- skAssignSchema,
166
- skExport,
167
- skExportSchema,
168
- skUnassign,
169
- skUnassignSchema,
170
- } from './tools/skill-assign.js'
171
- import {
172
- pdList,
173
- pdListSchema,
174
- pdGet,
175
- pdGetSchema,
176
- pdCreate,
177
- pdCreateSchema,
178
- pdUpdate,
179
- pdUpdateSchema,
180
- pdDelete,
181
- pdDeleteSchema,
182
- pdToggle,
183
- pdToggleSchema,
184
- directiveExport,
185
- directiveExportSchema,
186
- } from './tools/directives.js'
187
- import {
188
- updateTaskStatus,
189
- updateTaskStatusSchema,
190
- } from './tools/update-task-status.js'
191
-
192
- // Layer 3: Governance
193
- import {
194
- createAdrDraft,
195
- createAdrDraftSchema,
196
- recordAdrDecision,
197
- recordAdrDecisionSchema,
198
- submitAdrReview,
199
- submitAdrReviewSchema,
200
- } from './tools/governance.js'
201
-
202
- // Layer 4: Reviews
203
- import {
204
- rvComment,
205
- rvCommentSchema,
206
- rvCreate,
207
- rvCreateSchema,
208
- rvDecide,
209
- rvDecideSchema,
210
- rvGet,
211
- rvGetSchema,
212
- rvList,
213
- rvListSchema,
214
- } from './tools/reviews.js'
215
-
216
- // ---------------------------------------------------------------------------
217
- // Identity injection helper
218
- // ---------------------------------------------------------------------------
219
-
220
- /**
221
- * Wrap a write-tool handler to inject user_id from the resolved identity.
222
- * The caller does not need to pass user_id — it comes from the token.
223
- */
224
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
225
- function withIdentity(handler: (args: any) => Promise<any>) {
226
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
227
- return async (args: any) => {
228
- const identity = getIdentity()
229
- return handler({ ...args, user_id: identity.userId })
230
- }
231
- }
232
-
233
- // ---------------------------------------------------------------------------
234
- // Server setup
235
- // ---------------------------------------------------------------------------
236
-
237
- const server = new McpServer(
238
- {
239
- name: 'nexus-mcp',
240
- version: '0.8.7',
241
- },
242
- {
243
- capabilities: {
244
- tools: {},
245
- },
246
- },
247
- )
248
-
249
- // ---------------------------------------------------------------------------
250
- // Layer 1: Knowledge Access tools
251
- // ---------------------------------------------------------------------------
252
-
253
- server.tool(
254
- 'kb_search',
255
- 'Search project knowledge using keyword, semantic, or hybrid mode. Applies project scope filters before retrieval. Returns matching entities with relevance ranking.',
256
- searchKnowledgeSchema,
257
- async (args) => searchKnowledge(args),
258
- )
259
-
260
- server.tool(
261
- 'kb_memory',
262
- 'Get curated project context for agent bootstrapping. Returns ADRs, active tasks, recent sessions, open letters, and other project knowledge based on selected categories and depth.',
263
- getProjectMemorySchema,
264
- async (args) => getProjectMemory(args),
265
- )
266
-
267
- server.tool(
268
- 'kb_get',
269
- 'Fetch a single knowledge object (session, decision, letter, task, etc.) in structured, markdown, or summary format. Includes child entries for sessions and letters.',
270
- getDocumentSchema,
271
- async (args) => getDocument(args),
272
- )
273
-
274
- server.tool(
275
- 'kb_related',
276
- 'Navigate entity relationships. Returns graph-neighbor entities related to a given item, such as supersession chains for ADRs, thread siblings for letters, or tasks created during sessions.',
277
- getRelatedEntitiesSchema,
278
- async (args) => getRelatedEntities(args),
279
- )
280
-
281
- server.tool(
282
- 'project_list',
283
- 'List accessible projects for the authenticated user or agent. Returns project metadata ordered by name.',
284
- projectListSchema,
285
- async (args) => projectList(args),
286
- )
287
-
288
- // ---------------------------------------------------------------------------
289
- // Layer 2: Coordination tools
290
- // ---------------------------------------------------------------------------
291
-
292
- server.tool(
293
- 'vl_create',
294
- 'Create a new vault letter for agent-to-agent or agent-to-human coordination. Returns the new letter ID and status.',
295
- createLetterSchema,
296
- withIdentity(createLetter),
297
- )
298
-
299
- server.tool(
300
- 'vl_reply',
301
- 'Reply to an existing vault letter with a new message. Optionally update the letter status. Enforces append-only semantics.',
302
- replyLetterSchema,
303
- withIdentity(replyLetter),
304
- )
305
-
306
- server.tool(
307
- 'vl_inbox',
308
- 'List vault letters addressed to the calling agent or user. Returns letters scoped to the given project, ordered by blocking status and recency. Supports status filtering.',
309
- listInboxSchema,
310
- withIdentity(listInbox),
311
- )
312
-
313
- server.tool(
314
- 'vl_outbox',
315
- 'List vault letters sent by the calling agent or user. Returns letters scoped to the given project, ordered by recency. Supports status filtering.',
316
- listOutboxSchema,
317
- withIdentity(listOutbox),
318
- )
319
-
320
- server.tool(
321
- 'vl_ack',
322
- 'Acknowledge receipt of a new vault letter. Transitions the letter from new to acknowledged status and appends an acknowledgment message.',
323
- acknowledgeLetterSchema,
324
- withIdentity(acknowledgeLetter),
325
- )
326
-
327
- server.tool(
328
- 'task_create',
329
- 'Create a new task within a project scope. Returns the new task ID.',
330
- createTaskSchema,
331
- withIdentity(createTask),
332
- )
333
-
334
- server.tool(
335
- 'task_update',
336
- 'Update the status of an existing task. Optionally change priority or assignee. Automatically records a status-change note for audit trail.',
337
- updateTaskStatusSchema,
338
- withIdentity(updateTaskStatus),
339
- )
340
-
341
- server.tool(
342
- 'task_note',
343
- 'Append a note to an existing task. Notes are append-only and maintain a chronological audit trail. Useful for recording progress, blockers, or decisions.',
344
- addTaskNoteSchema,
345
- withIdentity(addTaskNote),
346
- )
347
-
348
- server.tool(
349
- 'task_list',
350
- 'List tasks for a project with optional status filtering. Returns tasks ordered by creation date (newest first).',
351
- listTasksSchema,
352
- withIdentity(listTasks),
353
- )
354
-
355
- server.tool(
356
- 'doc_ingest',
357
- 'Push text or markdown content into a project knowledge base. Creates an ingest item that can later be classified. Useful for agents to persist research results, generated documents, or extracted knowledge.',
358
- ingestDocumentSchema,
359
- withIdentity(ingestDocument),
360
- )
361
-
362
- server.tool(
363
- 'doc_list',
364
- 'List ingested documents for a project with optional source filtering. Returns documents ordered by creation date (newest first).',
365
- listDocumentsSchema,
366
- withIdentity(listDocuments),
367
- )
368
-
369
- server.tool(
370
- 'doc_classify',
371
- 'Update the classification of an ingest item. Valid classifications: unclassified, research_note, planning_item, decision_input, reference, archive.',
372
- classifyDocumentSchema,
373
- withIdentity(classifyDocument),
374
- )
375
-
376
- server.tool(
377
- 'doc_update',
378
- 'Update title, body, or source_url of an ingest item. Supports full body replacement or append mode via append_body. At least one field must be provided.',
379
- updateDocumentSchema,
380
- withIdentity(updateDocument),
381
- )
382
-
383
- server.tool(
384
- 'doc_delete',
385
- 'Delete an ingest item from a project knowledge base. This action is irreversible.',
386
- deleteDocumentSchema,
387
- withIdentity(deleteDocument),
388
- )
389
-
390
- server.tool(
391
- 'session_append',
392
- 'Append an entry to an existing session. Enforces session write isolation: only the session creator can append entries.',
393
- appendSessionEntrySchema,
394
- withIdentity(appendSessionEntry),
395
- )
396
-
397
- server.tool(
398
- 'session_create',
399
- 'Create a new work session for a project. Returns the session ID. The session starts in open status and must be closed explicitly via session_close.',
400
- createSessionSchema,
401
- withIdentity(createSession),
402
- )
403
-
404
- server.tool(
405
- 'session_close',
406
- 'Close an open session. Sets status to closed, optionally records a summary and next entry point. Only the session creator can close it.',
407
- closeSessionSchema,
408
- withIdentity(closeSession),
409
- )
410
-
411
- server.tool(
412
- 'session_list',
413
- 'List open sessions for a project. Returns sessions ordered by creation date (newest first). Useful for checking active work before starting a new session.',
414
- listOpenSessionsSchema,
415
- async (args) => listOpenSessions(args),
416
- )
417
-
418
- // ---------------------------------------------------------------------------
419
- // Layer 2 (continued): Decision comment tools
420
- // ---------------------------------------------------------------------------
421
-
422
- server.tool(
423
- 'dc_add',
424
- 'Add a comment to an ADR decision. Comments are append-only and support both human and agent actors.',
425
- addDecisionCommentSchema,
426
- withIdentity(addDecisionComment),
427
- )
428
-
429
- server.tool(
430
- 'dc_list',
431
- 'List comments for an ADR decision in chronological order.',
432
- listDecisionCommentsSchema,
433
- async (args) => listDecisionComments(args),
434
- )
435
-
436
- // ---------------------------------------------------------------------------
437
- // Layer 2 (continued): Skill management tools
438
- // ---------------------------------------------------------------------------
439
-
440
- server.tool(
441
- 'sk_list',
442
- 'List skills for the current tenant. Supports status filtering (draft, active, archived). Returns skill metadata without full body content.',
443
- skListSchema,
444
- withIdentity(skList),
445
- )
446
-
447
- server.tool(
448
- 'sk_get',
449
- 'Get full skill content by skill identifier or UUID. Includes associated command information.',
450
- skGetSchema,
451
- withIdentity(skGet),
452
- )
453
-
454
- server.tool(
455
- 'sk_create',
456
- 'Create a new skill in draft status. Optionally auto-generates an OpenCode command. Skill content is markdown-based instruction text.',
457
- skCreateSchema,
458
- withIdentity(skCreate),
459
- )
460
-
461
- server.tool(
462
- 'sk_update',
463
- 'Update an existing skill content, metadata, or command auto-generation setting. Increments version when body changes.',
464
- skUpdateSchema,
465
- withIdentity(skUpdate),
466
- )
467
-
468
- server.tool(
469
- 'sk_activate',
470
- 'Change a skill status (draft, active, archived). Active skills are available for agent loading and project selection.',
471
- skActivateSchema,
472
- withIdentity(skActivate),
473
- )
474
-
475
- server.tool(
476
- 'sk_assign',
477
- 'Assign a skill to a project. Optionally pin to a specific version and set enabled state.',
478
- skAssignSchema,
479
- withIdentity(skAssign),
480
- )
481
-
482
- server.tool(
483
- 'sk_unassign',
484
- 'Remove a skill assignment from a project.',
485
- skUnassignSchema,
486
- withIdentity(skUnassign),
487
- )
488
-
489
- server.tool(
490
- 'sk_export',
491
- 'Export all skill assignments for a project. Returns the full assignment list with pinned versions and enabled states.',
492
- skExportSchema,
493
- withIdentity(skExport),
494
- )
495
-
496
- // ---------------------------------------------------------------------------
497
- // Layer 2 (continued): Project Directives tools
498
- // ---------------------------------------------------------------------------
499
-
500
- server.tool(
501
- 'pd_list',
502
- 'List project directives with optional enabled filter. Returns directives ordered by priority and creation date.',
503
- pdListSchema,
504
- withIdentity(pdList),
505
- )
506
-
507
- server.tool(
508
- 'pd_get',
509
- 'Get a specific project directive by UUID. Returns full directive details.',
510
- pdGetSchema,
511
- withIdentity(pdGet),
512
- )
513
-
514
- server.tool(
515
- 'pd_create',
516
- 'Create a new project directive. Directives are project-scoped rules/policies that guide agent behavior.',
517
- pdCreateSchema,
518
- withIdentity(pdCreate),
519
- )
520
-
521
- server.tool(
522
- 'pd_update',
523
- 'Update an existing project directive. Supports partial updates for title, body, category, priority, and enabled state.',
524
- pdUpdateSchema,
525
- withIdentity(pdUpdate),
526
- )
527
-
528
- server.tool(
529
- 'pd_delete',
530
- 'Delete a project directive by UUID.',
531
- pdDeleteSchema,
532
- withIdentity(pdDelete),
533
- )
534
-
535
- server.tool(
536
- 'pd_toggle',
537
- 'Toggle a project directive enabled/disabled. Omit enabled parameter to invert current state.',
538
- pdToggleSchema,
539
- withIdentity(pdToggle),
540
- )
541
-
542
- server.tool(
543
- 'directive_export',
544
- 'Export all enabled directives for a project in CLI-compatible format.',
545
- directiveExportSchema,
546
- withIdentity(directiveExport),
547
- )
548
-
549
- // ---------------------------------------------------------------------------
550
- // Layer 3: Governance tools
551
- // ---------------------------------------------------------------------------
552
-
553
- server.tool(
554
- 'adr_create',
555
- 'Create a new ADR (Architecture Decision Record) in draft state. Auto-assigns the next ADR number for the project. Optionally links to a superseded ADR.',
556
- createAdrDraftSchema,
557
- withIdentity(createAdrDraft),
558
- )
559
-
560
- server.tool(
561
- 'adr_submit',
562
- 'Submit an ADR for review. Transitions an ADR from draft to under_review state. Only drafts can be submitted.',
563
- submitAdrReviewSchema,
564
- withIdentity(submitAdrReview),
565
- )
566
-
567
- server.tool(
568
- 'adr_decide',
569
- 'Accept or reject an ADR that is under review. If accepted and it supersedes another ADR, the superseded ADR is automatically marked. Optional rationale is appended to the ADR body.',
570
- recordAdrDecisionSchema,
571
- withIdentity(recordAdrDecision),
572
- )
573
-
574
- // ---------------------------------------------------------------------------
575
- // Layer 4: Review tools
576
- // ---------------------------------------------------------------------------
577
-
578
- server.tool(
579
- 'rv_list',
580
- 'List reviews with optional filters by entity type and status. Returns reviews ordered by recency.',
581
- rvListSchema,
582
- withIdentity(rvList),
583
- )
584
-
585
- server.tool(
586
- 'rv_get',
587
- 'Get a review by review ID, or by entity type and entity ID. Returns full review details including status and history.',
588
- rvGetSchema,
589
- withIdentity(rvGet),
590
- )
591
-
592
- server.tool(
593
- 'rv_create',
594
- 'Create a new review for a skill or agent entity. Returns the new review ID and initial status.',
595
- rvCreateSchema,
596
- withIdentity(rvCreate),
597
- )
598
-
599
- server.tool(
600
- 'rv_decide',
601
- 'Transition a review state (submit, accept, reject, request_revision, resubmit, archive). Enforces valid state transitions. Optional rationale is recorded.',
602
- rvDecideSchema,
603
- withIdentity(rvDecide),
604
- )
605
-
606
- server.tool(
607
- 'rv_comment',
608
- 'Add a comment to a review. Supports inline comments with optional line range. Comments are append-only and maintain a chronological audit trail.',
609
- rvCommentSchema,
610
- withIdentity(rvComment),
611
- )
612
-
613
- // ---------------------------------------------------------------------------
614
- // Start
615
- // ---------------------------------------------------------------------------
616
-
617
- async function main() {
618
- // Resolve identity from NEXUS_PRIVATE_TOKEN before accepting connections
619
- await initIdentity()
620
-
621
- const transport = new StdioServerTransport()
622
- await server.connect(transport)
623
- console.error('[nexus-mcp] Server started on stdio')
624
- }
625
-
626
- main().catch((err) => {
627
- console.error('[nexus-mcp] Fatal error:', err)
628
- process.exit(1)
629
- })
@@ -1,50 +0,0 @@
1
- /**
2
- * task_note -- Layer 2 Coordination
3
- *
4
- * Appends a note to an existing task. Notes are append-only and
5
- * maintain a chronological history/timeline.
6
- * Delegates to POST /api/mcp/tasks (action: task_note).
7
- */
8
-
9
- import { z } from 'zod'
10
- import { nexusPost } from '../nexus-api.js'
11
-
12
- export const addTaskNoteSchema = {
13
- task_id: z.string().uuid().describe('Task UUID to add a note to'),
14
- note: z.string().max(10_000).describe('Note content to append'),
15
- agent_id: z.string().max(200).optional().describe('Agent identifier if applicable'),
16
- }
17
-
18
- type AddTaskNoteArgs = {
19
- task_id: string
20
- note: string
21
- user_id: string
22
- agent_id?: string
23
- }
24
-
25
- export async function addTaskNote(args: AddTaskNoteArgs) {
26
- const result = await nexusPost('/api/mcp/tasks', {
27
- action: 'task_note',
28
- task_id: args.task_id,
29
- note: args.note,
30
- agent_id: args.agent_id,
31
- })
32
-
33
- if (!result.ok) {
34
- return {
35
- content: [
36
- {
37
- type: 'text' as const,
38
- text: JSON.stringify({ error: result.error }, null, 2),
39
- },
40
- ],
41
- isError: true,
42
- }
43
- }
44
-
45
- return {
46
- content: [
47
- { type: 'text' as const, text: JSON.stringify(result.data, null, 2) },
48
- ],
49
- }
50
- }