@cognistore/mcp-server 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/index.js +62 -3
- package/package.json +9 -11
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sithionRT
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.js
CHANGED
|
@@ -1427,7 +1427,32 @@ var KnowledgeService = class {
|
|
|
1427
1427
|
};
|
|
1428
1428
|
}
|
|
1429
1429
|
deletePlanTask(id) {
|
|
1430
|
-
|
|
1430
|
+
const planId = this.repository.getTaskPlanId(id) ?? "";
|
|
1431
|
+
const deleted = this.repository.deletePlanTask(id);
|
|
1432
|
+
if (!deleted) {
|
|
1433
|
+
return { deleted: false, planId: "", planStatus: "unknown", progress: "0/0 completed", autoActions: [] };
|
|
1434
|
+
}
|
|
1435
|
+
const autoActions = [];
|
|
1436
|
+
if (planId) {
|
|
1437
|
+
const remaining = this.repository.listPlanTasks(planId);
|
|
1438
|
+
const incomplete = this.repository.countIncompleteTasks(planId);
|
|
1439
|
+
const plan = this.repository.getPlanById(planId);
|
|
1440
|
+
if (remaining.length > 0 && incomplete === 0 && plan?.status === "active") {
|
|
1441
|
+
this.repository.updatePlan(planId, { status: "completed" });
|
|
1442
|
+
autoActions.push("Plan auto-completed \u2014 all remaining tasks done");
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
const currentPlan = planId ? this.repository.getPlanById(planId) : null;
|
|
1446
|
+
const allTasks = planId ? this.repository.listPlanTasks(planId) : [];
|
|
1447
|
+
const completedCount = allTasks.filter((t) => t.status === "completed").length;
|
|
1448
|
+
const progress = `${completedCount}/${allTasks.length} completed`;
|
|
1449
|
+
return {
|
|
1450
|
+
deleted: true,
|
|
1451
|
+
planId,
|
|
1452
|
+
planStatus: currentPlan?.status ?? "unknown",
|
|
1453
|
+
progress,
|
|
1454
|
+
autoActions
|
|
1455
|
+
};
|
|
1431
1456
|
}
|
|
1432
1457
|
listPlanTasks(planId) {
|
|
1433
1458
|
return this.repository.listPlanTasks(planId).map((r) => this.toPlanTask(r));
|
|
@@ -3570,13 +3595,14 @@ function createServer(sdk) {
|
|
|
3570
3595
|
);
|
|
3571
3596
|
server.tool(
|
|
3572
3597
|
"updatePlanTask",
|
|
3573
|
-
|
|
3598
|
+
'Update a task status. Plan auto-activates on first in_progress and auto-completes when all tasks are done. Set "position" to reorder the task within the plan.',
|
|
3574
3599
|
{
|
|
3575
3600
|
taskId: z3.string().describe("UUID of the task"),
|
|
3576
3601
|
status: z3.enum(["pending", "in_progress", "completed"]).optional().describe("New status"),
|
|
3577
3602
|
description: z3.string().optional().describe("New description"),
|
|
3578
3603
|
priority: z3.enum(["low", "medium", "high"]).optional().describe("New priority"),
|
|
3579
|
-
notes: z3.string().nullable().optional().describe("Notes about progress or blockers")
|
|
3604
|
+
notes: z3.string().nullable().optional().describe("Notes about progress or blockers"),
|
|
3605
|
+
position: z3.number().optional().describe("New 0-based position; reorders the task within the plan (tasks are listed by position ascending)")
|
|
3580
3606
|
},
|
|
3581
3607
|
WRITE,
|
|
3582
3608
|
async (params) => {
|
|
@@ -3617,6 +3643,39 @@ function createServer(sdk) {
|
|
|
3617
3643
|
return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] };
|
|
3618
3644
|
}
|
|
3619
3645
|
);
|
|
3646
|
+
server.tool(
|
|
3647
|
+
"deletePlanTask",
|
|
3648
|
+
"Remove a task from a plan. If the remaining tasks are all completed (and at least one remains), the plan auto-completes. Returns the updated plan context.",
|
|
3649
|
+
{
|
|
3650
|
+
taskId: z3.string().describe("UUID of the task to remove")
|
|
3651
|
+
},
|
|
3652
|
+
DESTRUCTIVE,
|
|
3653
|
+
async (params) => {
|
|
3654
|
+
const result = sdk.deletePlanTask(params.taskId);
|
|
3655
|
+
if (!result.deleted) return { content: [{ type: "text", text: JSON.stringify({ error: "not_found", type: "plan_task", id: params.taskId }) }] };
|
|
3656
|
+
const response = {
|
|
3657
|
+
deleted: true,
|
|
3658
|
+
id: params.taskId,
|
|
3659
|
+
plan: { id: result.planId, status: result.planStatus, progress: result.progress },
|
|
3660
|
+
...result.autoActions.length > 0 ? { autoActions: result.autoActions } : {},
|
|
3661
|
+
reminder: `Plan ID: "${result.planId}". Pass this planId to addKnowledge calls for output linking.`
|
|
3662
|
+
};
|
|
3663
|
+
return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] };
|
|
3664
|
+
}
|
|
3665
|
+
);
|
|
3666
|
+
server.tool(
|
|
3667
|
+
"archivePlan",
|
|
3668
|
+
'Archive a plan (status \u2192 "archived") to take it out of active circulation. Reversible \u2014 re-activate via updatePlan. Preferred over deletion: keeps the plan and its linked knowledge.',
|
|
3669
|
+
{
|
|
3670
|
+
planId: z3.string().describe("UUID of the plan to archive")
|
|
3671
|
+
},
|
|
3672
|
+
WRITE,
|
|
3673
|
+
async (params) => {
|
|
3674
|
+
const result = sdk.updatePlan(params.planId, { status: "archived" });
|
|
3675
|
+
if (!result) return { content: [{ type: "text", text: JSON.stringify({ error: "not_found", type: "plan", id: params.planId }) }] };
|
|
3676
|
+
return { content: [{ type: "text", text: JSON.stringify({ archived: true, id: result.id, status: result.status }, null, 2) }] };
|
|
3677
|
+
}
|
|
3678
|
+
);
|
|
3620
3679
|
server.tool(
|
|
3621
3680
|
"listPlanTasks",
|
|
3622
3681
|
"List all tasks for a plan, ordered by position. Shows progress.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognistore/mcp-server",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "MCP server for CogniStore — integrates with Claude Code and GitHub Copilot",
|
|
@@ -17,13 +17,6 @@
|
|
|
17
17
|
"files": [
|
|
18
18
|
"dist"
|
|
19
19
|
],
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "pnpm build:deps && tsup",
|
|
22
|
-
"build:deps": "pnpm --filter @cognistore/shared build && pnpm --filter @cognistore/core build && pnpm --filter @cognistore/embeddings build && pnpm --filter @cognistore/sdk build",
|
|
23
|
-
"dev": "tsx src/index.ts",
|
|
24
|
-
"clean": "rm -rf dist",
|
|
25
|
-
"test": "if find . -name '*.test.ts' -o -name '*.spec.ts' | grep -q .; then npx playwright test; else echo 'No tests found, skipping'; fi"
|
|
26
|
-
},
|
|
27
20
|
"dependencies": {
|
|
28
21
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
29
22
|
"better-sqlite3": "^12.8.0",
|
|
@@ -32,11 +25,16 @@
|
|
|
32
25
|
"zod": "^3.23.0"
|
|
33
26
|
},
|
|
34
27
|
"devDependencies": {
|
|
35
|
-
"@cognistore/sdk": "workspace:*",
|
|
36
|
-
"@cognistore/shared": "workspace:*",
|
|
37
28
|
"@playwright/test": "^1.50.0",
|
|
38
29
|
"tsup": "^8.5.1",
|
|
39
30
|
"tsx": "^4.0.0",
|
|
40
31
|
"typescript": "^5.7.0"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "pnpm build:deps && tsup",
|
|
35
|
+
"build:deps": "pnpm --filter @cognistore/shared build && pnpm --filter @cognistore/core build && pnpm --filter @cognistore/embeddings build && pnpm --filter @cognistore/sdk build",
|
|
36
|
+
"dev": "tsx src/index.ts",
|
|
37
|
+
"clean": "rm -rf dist",
|
|
38
|
+
"test": "if find . -name '*.test.ts' -o -name '*.spec.ts' | grep -q .; then npx playwright test; else echo 'No tests found, skipping'; fi"
|
|
41
39
|
}
|
|
42
|
-
}
|
|
40
|
+
}
|