mcp-task-server 0.2.0 → 0.2.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/README.md +161 -25
- package/dist/agents.js +1 -1
- package/dist/context.d.ts +19 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +54 -0
- package/dist/context.js.map +1 -1
- package/dist/index.js +240 -8
- package/dist/index.js.map +1 -1
- package/dist/prompts.d.ts +5 -1
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +76 -4
- package/dist/prompts.js.map +1 -1
- package/dist/templates.d.ts.map +1 -1
- package/dist/templates.js +58 -176
- package/dist/templates.js.map +1 -1
- package/dist/tools.d.ts +14 -3
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +100 -18
- package/dist/tools.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,21 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
A Model Context Protocol (MCP) server for task management with multi-agent coordination. Designed for use with Cursor IDE and other MCP-compatible AI tools.
|
|
4
4
|
|
|
5
|
+
```mermaid
|
|
6
|
+
flowchart TB
|
|
7
|
+
subgraph Cursor IDE
|
|
8
|
+
A[AI Assistant]
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
subgraph MCP Task Server
|
|
12
|
+
B[21 Tools]
|
|
13
|
+
C[Preferences Engine]
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
subgraph Your Machine
|
|
17
|
+
D[~/.cursor/shared-context.json]
|
|
18
|
+
E[memory_bank/tasks/]
|
|
19
|
+
F[memory_bank/execution/progress.md]
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
A <-->|MCP Protocol| B
|
|
23
|
+
B --> C
|
|
24
|
+
C -->|read/write| D
|
|
25
|
+
B -->|read/write| E
|
|
26
|
+
B -->|auto-sync| F
|
|
27
|
+
D -->|inject into responses| A
|
|
28
|
+
```
|
|
29
|
+
|
|
5
30
|
## Features
|
|
6
31
|
|
|
7
|
-
- **
|
|
32
|
+
- **22 MCP Tools**: Comprehensive task management and coordination
|
|
8
33
|
- **Multi-Agent Coordination**: Support for Planner, Worker, and Judge roles
|
|
9
34
|
- **Dependency Tracking**: Tasks can depend on other tasks
|
|
10
35
|
- **Priority Levels**: Critical, High, Medium, Low
|
|
11
36
|
- **Scalable Storage**: Individual task files with JSON registry and markdown summary
|
|
12
37
|
- **Prompt-Based Operations**: PRD parsing, task expansion, complexity analysis
|
|
13
38
|
- **Shared Context**: Reads user preferences from `~/.cursor/shared-context.json` to personalise prompts
|
|
14
|
-
- **Project
|
|
39
|
+
- **Project Initialisation**: Scaffolds 22 template files across agent-kit, memory_bank (architecture, context, execution, reference), and cursor rules
|
|
15
40
|
|
|
16
41
|
## Quick Start
|
|
17
42
|
|
|
18
43
|
```bash
|
|
19
|
-
# Add to a new project and
|
|
44
|
+
# Add to a new project and initialise
|
|
20
45
|
init_project({ project_name: "my-app" })
|
|
21
46
|
|
|
22
47
|
# Add your first task
|
|
@@ -26,9 +51,50 @@ add_task({ title: "Set up development environment" })
|
|
|
26
51
|
next_task()
|
|
27
52
|
```
|
|
28
53
|
|
|
29
|
-
## Shared Context
|
|
54
|
+
## Shared Context & Preferences
|
|
55
|
+
|
|
56
|
+
The server reads `~/.cursor/shared-context.json` for user preferences and automatically injects them into tool responses and prompts.
|
|
57
|
+
|
|
58
|
+
### How Preferences Flow
|
|
59
|
+
|
|
60
|
+
```mermaid
|
|
61
|
+
flowchart LR
|
|
62
|
+
A[~/.cursor/shared-context.json] -->|read at runtime| B[MCP Task Server]
|
|
63
|
+
B -->|inject into| C[Tool Responses]
|
|
64
|
+
B -->|inject into| D[Generated Prompts]
|
|
65
|
+
C -->|AI sees| E[preferences hint]
|
|
66
|
+
D -->|AI uses| F[full context]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Memory Storage Architecture
|
|
70
|
+
|
|
71
|
+
```mermaid
|
|
72
|
+
flowchart TB
|
|
73
|
+
subgraph Your Machine
|
|
74
|
+
A[shared-context.json]
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
subgraph MCP Server
|
|
78
|
+
B[show_memory] -->|read| A
|
|
79
|
+
C[update_memory] -->|write| A
|
|
80
|
+
D[Tool Responses] -->|include hint from| A
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
subgraph AI Assistant
|
|
84
|
+
E[Sees preferences in responses]
|
|
85
|
+
F[Applies to content creation]
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
D --> E --> F
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Where Preferences Are Used
|
|
30
92
|
|
|
31
|
-
|
|
93
|
+
| Tool Type | How Preferences Are Applied |
|
|
94
|
+
|-----------|----------------------------|
|
|
95
|
+
| `list_tasks`, `get_task`, `add_task`, `update_task`, `next_task` | Brief hint in response |
|
|
96
|
+
| `parse_prd`, `expand_task`, `research_task` | Full context in generated prompt |
|
|
97
|
+
| `check_compliance` | All preferences for validation |
|
|
32
98
|
|
|
33
99
|
### Compliance Checking
|
|
34
100
|
|
|
@@ -172,7 +238,7 @@ Human-readable detailed task files for each top-level task:
|
|
|
172
238
|
# Status: done
|
|
173
239
|
# Dependencies: None
|
|
174
240
|
# Priority: high
|
|
175
|
-
# Description:
|
|
241
|
+
# Description: Initialise the project with required tooling.
|
|
176
242
|
# Details:
|
|
177
243
|
Full implementation details here...
|
|
178
244
|
|
|
@@ -200,17 +266,17 @@ This architecture scales well for complex projects with many tasks and subtasks.
|
|
|
200
266
|
|
|
201
267
|
## Tools
|
|
202
268
|
|
|
203
|
-
### Project
|
|
269
|
+
### Project Initialisation
|
|
204
270
|
|
|
205
271
|
| Tool | Description |
|
|
206
272
|
|------|-------------|
|
|
207
|
-
| `init_project` |
|
|
273
|
+
| `init_project` | Initialise project with agent-kit, memory_bank, and cursor rules |
|
|
208
274
|
|
|
209
275
|
```typescript
|
|
210
|
-
//
|
|
276
|
+
// Initialise with auto-detected project name
|
|
211
277
|
init_project()
|
|
212
278
|
|
|
213
|
-
//
|
|
279
|
+
// Initialise with custom name
|
|
214
280
|
init_project({ project_name: "my-app" })
|
|
215
281
|
|
|
216
282
|
// Force overwrite existing files
|
|
@@ -219,14 +285,14 @@ init_project({ force: true })
|
|
|
219
285
|
|
|
220
286
|
### Core Tools
|
|
221
287
|
|
|
222
|
-
| Tool | Description |
|
|
223
|
-
|
|
224
|
-
| `list_tasks` | List all tasks, optionally filtered by status or assignee |
|
|
225
|
-
| `get_task` | Get a specific task by ID with subtasks |
|
|
226
|
-
| `add_task` | Create a new task |
|
|
227
|
-
| `update_task` | Update task title, description, status, priority, or metadata |
|
|
228
|
-
| `complete_task` | Mark a task as completed |
|
|
229
|
-
| `next_task` | Get the next recommended task based on priority/dependencies |
|
|
288
|
+
| Tool | Description | Preferences |
|
|
289
|
+
|------|-------------|-------------|
|
|
290
|
+
| `list_tasks` | List all tasks, optionally filtered by status or assignee | ✓ hint |
|
|
291
|
+
| `get_task` | Get a specific task by ID with subtasks | ✓ hint |
|
|
292
|
+
| `add_task` | Create a new task | ✓ hint |
|
|
293
|
+
| `update_task` | Update task title, description, status, priority, or metadata | ✓ hint |
|
|
294
|
+
| `complete_task` | Mark a task as completed | |
|
|
295
|
+
| `next_task` | Get the next recommended task based on priority/dependencies | ✓ hint |
|
|
230
296
|
|
|
231
297
|
### Multi-Agent Coordination
|
|
232
298
|
|
|
@@ -250,12 +316,63 @@ init_project({ force: true })
|
|
|
250
316
|
|
|
251
317
|
### Prompt-Based Tools
|
|
252
318
|
|
|
319
|
+
| Tool | Description | Preferences |
|
|
320
|
+
|------|-------------|-------------|
|
|
321
|
+
| `parse_prd` | Get prompt to parse PRD into tasks | ✓ full |
|
|
322
|
+
| `research_task` | Get prompt to research a task | ✓ full |
|
|
323
|
+
| `analyse_complexity` | Get prompt to analyse task complexity | ✓ full |
|
|
324
|
+
| `check_compliance` | Check file/folder against user preferences from shared context | ✓ full |
|
|
325
|
+
| `analyse_project` | Analyse project structure and suggest memory_bank updates | ✓ full |
|
|
326
|
+
|
|
327
|
+
### Utility Tools
|
|
328
|
+
|
|
253
329
|
| Tool | Description |
|
|
254
330
|
|------|-------------|
|
|
255
|
-
| `
|
|
256
|
-
| `
|
|
257
|
-
| `
|
|
258
|
-
|
|
331
|
+
| `get_version` | Get the current version of the MCP task server |
|
|
332
|
+
| `show_memory` | Show shared context memories from `~/.cursor/shared-context.json` |
|
|
333
|
+
| `update_memory` | Create, update, or delete memories in shared context |
|
|
334
|
+
|
|
335
|
+
```typescript
|
|
336
|
+
// Check the server version
|
|
337
|
+
get_version()
|
|
338
|
+
// Returns: { name: "mcp-task-server", version: "0.2.0", description: "..." }
|
|
339
|
+
|
|
340
|
+
// Show all memories
|
|
341
|
+
show_memory()
|
|
342
|
+
|
|
343
|
+
// Search for specific memories
|
|
344
|
+
show_memory({ search: "writing" })
|
|
345
|
+
|
|
346
|
+
// Force reload from file (clears cache)
|
|
347
|
+
show_memory({ reload: true })
|
|
348
|
+
|
|
349
|
+
// Create a new memory
|
|
350
|
+
update_memory({
|
|
351
|
+
action: "create",
|
|
352
|
+
title: "Project conventions",
|
|
353
|
+
content: "Use TypeScript strict mode. Prefer functional components."
|
|
354
|
+
})
|
|
355
|
+
|
|
356
|
+
// Update an existing memory
|
|
357
|
+
update_memory({
|
|
358
|
+
action: "update",
|
|
359
|
+
id: "mem_123",
|
|
360
|
+
title: "Writing preferences",
|
|
361
|
+
content: "Updated content..."
|
|
362
|
+
})
|
|
363
|
+
|
|
364
|
+
// Delete a memory
|
|
365
|
+
update_memory({ action: "delete", id: "mem_123" })
|
|
366
|
+
|
|
367
|
+
// Analyse project and get suggestions for memory_bank
|
|
368
|
+
analyse_project()
|
|
369
|
+
|
|
370
|
+
// Focus on specific area
|
|
371
|
+
analyse_project({ focus: "tech" }) // Just tech stack
|
|
372
|
+
analyse_project({ focus: "brief" }) // Just project brief
|
|
373
|
+
analyse_project({ focus: "active" }) // Just current focus
|
|
374
|
+
analyse_project({ focus: "architecture" }) // Just architecture
|
|
375
|
+
```
|
|
259
376
|
|
|
260
377
|
## Multi-Agent Mode
|
|
261
378
|
|
|
@@ -264,7 +381,7 @@ The server supports three agent roles:
|
|
|
264
381
|
### Planner
|
|
265
382
|
- Creates and organizes tasks
|
|
266
383
|
- Sets dependencies and priorities
|
|
267
|
-
-
|
|
384
|
+
- Analyses complexity
|
|
268
385
|
- Cannot execute tasks
|
|
269
386
|
|
|
270
387
|
### Worker
|
|
@@ -311,12 +428,29 @@ your-project/
|
|
|
311
428
|
│ ├── HANDOFF.md # Handoff protocol reference
|
|
312
429
|
│ └── SHARED_CONTEXT.md # Shared context documentation
|
|
313
430
|
├── memory_bank/
|
|
431
|
+
│ ├── architecture/
|
|
432
|
+
│ │ ├── architecture.md # High-level architecture overview
|
|
433
|
+
│ │ ├── tech.md # Technical stack and context
|
|
434
|
+
│ │ ├── models.md # Data models
|
|
435
|
+
│ │ ├── services.md # System services
|
|
436
|
+
│ │ ├── deployment.md # Deployment guide
|
|
437
|
+
│ │ ├── kubernetes.md # Kubernetes deployment (if applicable)
|
|
438
|
+
│ │ └── webhooks.md # Webhooks implementation (if applicable)
|
|
314
439
|
│ ├── context/
|
|
440
|
+
│ │ ├── context.md # Context index
|
|
315
441
|
│ │ ├── brief.md # Project overview
|
|
316
|
-
│ │
|
|
442
|
+
│ │ ├── active.md # Current focus
|
|
443
|
+
│ │ ├── product.md # Product context
|
|
444
|
+
│ │ ├── canvas.md # Lean canvas
|
|
445
|
+
│ │ └── changelog.md # Change log
|
|
317
446
|
│ ├── execution/
|
|
447
|
+
│ │ ├── execution.md # Execution overview
|
|
318
448
|
│ │ ├── progress.md # Task summary (auto-synced)
|
|
319
|
-
│ │
|
|
449
|
+
│ │ ├── decisions.md # Decision log
|
|
450
|
+
│ │ ├── debug.md # Debug diary
|
|
451
|
+
│ │ └── git.md # Git setup and code quality
|
|
452
|
+
│ ├── reference/
|
|
453
|
+
│ │ └── README.md # Reference materials folder
|
|
320
454
|
│ └── tasks/
|
|
321
455
|
│ ├── tasks.json # Task registry (source of truth)
|
|
322
456
|
│ ├── task_001.txt # Detailed task file
|
|
@@ -327,6 +461,8 @@ your-project/
|
|
|
327
461
|
└── agent-workflow.mdc # Cursor agent rules
|
|
328
462
|
```
|
|
329
463
|
|
|
464
|
+
The full structure includes 22 template files covering architecture, context, and execution tracking.
|
|
465
|
+
|
|
330
466
|
## Migration from v1.x
|
|
331
467
|
|
|
332
468
|
If you have existing `.taskmaster/tasks.json`:
|
package/dist/agents.js
CHANGED
package/dist/context.d.ts
CHANGED
|
@@ -35,4 +35,23 @@ export declare function getWorkflowPreferences(): string | null;
|
|
|
35
35
|
* Clear the cached context (useful for testing or reloading)
|
|
36
36
|
*/
|
|
37
37
|
export declare function clearContextCache(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Save shared context to ~/.cursor/shared-context.json
|
|
40
|
+
*/
|
|
41
|
+
export declare function saveSharedContext(context: SharedContext): void;
|
|
42
|
+
/**
|
|
43
|
+
* Add or update a memory in shared context
|
|
44
|
+
*/
|
|
45
|
+
export declare function upsertMemory(memory: CursorMemory): SharedContext;
|
|
46
|
+
/**
|
|
47
|
+
* Delete a memory from shared context by ID
|
|
48
|
+
*/
|
|
49
|
+
export declare function deleteMemory(id: string): {
|
|
50
|
+
deleted: boolean;
|
|
51
|
+
context: SharedContext | null;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Generate a unique ID for a new memory
|
|
55
|
+
*/
|
|
56
|
+
export declare function generateMemoryId(): string;
|
|
38
57
|
//# sourceMappingURL=context.d.ts.map
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,W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,IAAI,CAExC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAY9D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CAiBhE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAA;CAAE,CAgB5F;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC"}
|
package/dist/context.js
CHANGED
|
@@ -67,4 +67,58 @@ export function getWorkflowPreferences() {
|
|
|
67
67
|
export function clearContextCache() {
|
|
68
68
|
cachedContext = null;
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Save shared context to ~/.cursor/shared-context.json
|
|
72
|
+
*/
|
|
73
|
+
export function saveSharedContext(context) {
|
|
74
|
+
const contextPath = join(homedir(), ".cursor", "shared-context.json");
|
|
75
|
+
const { writeFileSync, mkdirSync } = require("fs");
|
|
76
|
+
// Ensure .cursor directory exists
|
|
77
|
+
const cursorDir = join(homedir(), ".cursor");
|
|
78
|
+
if (!existsSync(cursorDir)) {
|
|
79
|
+
mkdirSync(cursorDir, { recursive: true });
|
|
80
|
+
}
|
|
81
|
+
writeFileSync(contextPath, JSON.stringify(context, null, 2));
|
|
82
|
+
cachedContext = context;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Add or update a memory in shared context
|
|
86
|
+
*/
|
|
87
|
+
export function upsertMemory(memory) {
|
|
88
|
+
let ctx = loadSharedContext();
|
|
89
|
+
if (!ctx) {
|
|
90
|
+
ctx = { cursor_memories: [] };
|
|
91
|
+
}
|
|
92
|
+
const existingIndex = ctx.cursor_memories.findIndex((m) => m.id === memory.id);
|
|
93
|
+
if (existingIndex >= 0) {
|
|
94
|
+
ctx.cursor_memories[existingIndex] = memory;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
ctx.cursor_memories.push(memory);
|
|
98
|
+
}
|
|
99
|
+
saveSharedContext(ctx);
|
|
100
|
+
return ctx;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Delete a memory from shared context by ID
|
|
104
|
+
*/
|
|
105
|
+
export function deleteMemory(id) {
|
|
106
|
+
const ctx = loadSharedContext();
|
|
107
|
+
if (!ctx) {
|
|
108
|
+
return { deleted: false, context: null };
|
|
109
|
+
}
|
|
110
|
+
const initialLength = ctx.cursor_memories.length;
|
|
111
|
+
ctx.cursor_memories = ctx.cursor_memories.filter((m) => m.id !== id);
|
|
112
|
+
if (ctx.cursor_memories.length < initialLength) {
|
|
113
|
+
saveSharedContext(ctx);
|
|
114
|
+
return { deleted: true, context: ctx };
|
|
115
|
+
}
|
|
116
|
+
return { deleted: false, context: ctx };
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Generate a unique ID for a new memory
|
|
120
|
+
*/
|
|
121
|
+
export function generateMemoryId() {
|
|
122
|
+
return `mem_${Date.now()}_${Math.random().toString(36).substring(2, 8)}`;
|
|
123
|
+
}
|
|
70
124
|
//# sourceMappingURL=context.js.map
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAY9C,IAAI,aAAa,GAAyB,IAAI,CAAC;AAE/C;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAC/B,IAAI,aAAa;QAAE,OAAO,aAAa,CAAC;IAExC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,qBAAqB,CAAC,CAAC;IAEtE,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AAC;IAC3C,CAAC;IAED,MAAM,aAAa,GAAG,GAAG,CAAC,eAAe,CAAC,MAAM,CAAC;IACjD,GAAG,CAAC,eAAe,GAAG,GAAG,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAErE,IAAI,GAAG,CAAC,eAAe,CAAC,MAAM,GAAG,aAAa,EAAE,CAAC;QAC/C,iBAAiB,CAAC,GAAG,CAAC,CAAC;QACvB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IACzC,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,OAAO,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAC3E,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,10 +4,13 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
5
|
import { getConfig } from "./config.js";
|
|
6
6
|
import * as tools from "./tools.js";
|
|
7
|
+
import { loadSharedContext, getWritingPreferences, getUserIdentity, getWorkflowPreferences, clearContextCache, upsertMemory, deleteMemory, generateMemoryId, } from "./context.js";
|
|
8
|
+
// Version constant - update with each release
|
|
9
|
+
const VERSION = "0.2.1";
|
|
7
10
|
const config = getConfig();
|
|
8
11
|
const server = new Server({
|
|
9
12
|
name: "mcp-task-server",
|
|
10
|
-
version:
|
|
13
|
+
version: VERSION,
|
|
11
14
|
}, {
|
|
12
15
|
capabilities: {
|
|
13
16
|
tools: {},
|
|
@@ -287,12 +290,12 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
287
290
|
},
|
|
288
291
|
},
|
|
289
292
|
{
|
|
290
|
-
name: "
|
|
291
|
-
description: "Get a prompt to
|
|
293
|
+
name: "analyse_complexity",
|
|
294
|
+
description: "Get a prompt to analyse task complexity (Planner role)",
|
|
292
295
|
inputSchema: {
|
|
293
296
|
type: "object",
|
|
294
297
|
properties: {
|
|
295
|
-
task_id: { type: "string", description: "ID of the task to
|
|
298
|
+
task_id: { type: "string", description: "ID of the task to analyse" },
|
|
296
299
|
agent_id: { type: "string" },
|
|
297
300
|
role: { type: "string", enum: ["planner", "worker", "judge"] },
|
|
298
301
|
},
|
|
@@ -313,10 +316,10 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
313
316
|
required: ["path"],
|
|
314
317
|
},
|
|
315
318
|
},
|
|
316
|
-
// Project
|
|
319
|
+
// Project Initialisation
|
|
317
320
|
{
|
|
318
321
|
name: "init_project",
|
|
319
|
-
description: "
|
|
322
|
+
description: "Initialise a project with agent-kit, memory_bank, and cursor rules. Creates directory structure and template files. Safe to run on existing projects (will not overwrite files with content unless force: true).",
|
|
320
323
|
inputSchema: {
|
|
321
324
|
type: "object",
|
|
322
325
|
properties: {
|
|
@@ -325,6 +328,74 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
325
328
|
},
|
|
326
329
|
},
|
|
327
330
|
},
|
|
331
|
+
// Utility Tools
|
|
332
|
+
{
|
|
333
|
+
name: "get_version",
|
|
334
|
+
description: "Get the current version of the MCP task server",
|
|
335
|
+
inputSchema: {
|
|
336
|
+
type: "object",
|
|
337
|
+
properties: {},
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
name: "show_memory",
|
|
342
|
+
description: "Show shared context memories from ~/.cursor/shared-context.json. Displays all memories or filter by search term.",
|
|
343
|
+
inputSchema: {
|
|
344
|
+
type: "object",
|
|
345
|
+
properties: {
|
|
346
|
+
search: {
|
|
347
|
+
type: "string",
|
|
348
|
+
description: "Optional search term to filter memories by title",
|
|
349
|
+
},
|
|
350
|
+
reload: {
|
|
351
|
+
type: "boolean",
|
|
352
|
+
description: "Force reload from file (clears cache)",
|
|
353
|
+
default: false,
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
name: "update_memory",
|
|
360
|
+
description: "Create, update, or delete a memory in ~/.cursor/shared-context.json. Use action: 'create' or 'update' with title and content, or action: 'delete' with id.",
|
|
361
|
+
inputSchema: {
|
|
362
|
+
type: "object",
|
|
363
|
+
properties: {
|
|
364
|
+
action: {
|
|
365
|
+
type: "string",
|
|
366
|
+
enum: ["create", "update", "delete"],
|
|
367
|
+
description: "Action to perform: create new memory, update existing, or delete",
|
|
368
|
+
},
|
|
369
|
+
id: {
|
|
370
|
+
type: "string",
|
|
371
|
+
description: "Memory ID (required for update/delete, auto-generated for create)",
|
|
372
|
+
},
|
|
373
|
+
title: {
|
|
374
|
+
type: "string",
|
|
375
|
+
description: "Memory title (required for create/update)",
|
|
376
|
+
},
|
|
377
|
+
content: {
|
|
378
|
+
type: "string",
|
|
379
|
+
description: "Memory content (required for create/update)",
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
required: ["action"],
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
name: "analyse_project",
|
|
387
|
+
description: "Analyse the project structure and generate suggestions for memory_bank files. Scans the codebase and returns a prompt with suggested updates for brief.md, tech.md, active.md, etc.",
|
|
388
|
+
inputSchema: {
|
|
389
|
+
type: "object",
|
|
390
|
+
properties: {
|
|
391
|
+
focus: {
|
|
392
|
+
type: "string",
|
|
393
|
+
enum: ["all", "brief", "tech", "architecture", "active"],
|
|
394
|
+
description: "Which memory_bank area to focus on (default: all)",
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
},
|
|
328
399
|
],
|
|
329
400
|
};
|
|
330
401
|
});
|
|
@@ -374,13 +445,174 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
374
445
|
return tools.parsePrd(config, tools.ParsePrdSchema.parse(args));
|
|
375
446
|
case "research_task":
|
|
376
447
|
return tools.researchTask(config, tools.ResearchTaskSchema.parse(args));
|
|
377
|
-
case "
|
|
378
|
-
return tools.
|
|
448
|
+
case "analyse_complexity":
|
|
449
|
+
return tools.analyseComplexity(config, tools.AnalyseComplexitySchema.parse(args));
|
|
379
450
|
case "check_compliance":
|
|
380
451
|
return tools.checkCompliance(config, tools.CheckComplianceSchema.parse(args));
|
|
381
452
|
// Project Initialization
|
|
382
453
|
case "init_project":
|
|
383
454
|
return tools.initProject(config, tools.InitProjectSchema.parse(args));
|
|
455
|
+
// Project Analysis
|
|
456
|
+
case "analyse_project":
|
|
457
|
+
return tools.analyseProject(config, tools.AnalyseProjectSchema.parse(args));
|
|
458
|
+
// Utility Tools
|
|
459
|
+
case "get_version":
|
|
460
|
+
return {
|
|
461
|
+
content: [
|
|
462
|
+
{
|
|
463
|
+
type: "text",
|
|
464
|
+
text: JSON.stringify({
|
|
465
|
+
name: "mcp-task-server",
|
|
466
|
+
version: VERSION,
|
|
467
|
+
description: "MCP server for task management with multi-agent coordination",
|
|
468
|
+
}, null, 2),
|
|
469
|
+
},
|
|
470
|
+
],
|
|
471
|
+
};
|
|
472
|
+
case "show_memory": {
|
|
473
|
+
const { search, reload } = args;
|
|
474
|
+
// Clear cache if reload requested
|
|
475
|
+
if (reload) {
|
|
476
|
+
clearContextCache();
|
|
477
|
+
}
|
|
478
|
+
const ctx = loadSharedContext();
|
|
479
|
+
if (!ctx || !ctx.cursor_memories?.length) {
|
|
480
|
+
return {
|
|
481
|
+
content: [
|
|
482
|
+
{
|
|
483
|
+
type: "text",
|
|
484
|
+
text: JSON.stringify({
|
|
485
|
+
status: "no_context",
|
|
486
|
+
message: "No shared context found.",
|
|
487
|
+
path: "~/.cursor/shared-context.json",
|
|
488
|
+
hint: "Use update_memory to create your first memory, or the file will be created automatically.",
|
|
489
|
+
file_format: {
|
|
490
|
+
cursor_memories: [
|
|
491
|
+
{ id: "string", title: "string", content: "string" }
|
|
492
|
+
],
|
|
493
|
+
},
|
|
494
|
+
}, null, 2),
|
|
495
|
+
},
|
|
496
|
+
],
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
// Filter memories if search provided
|
|
500
|
+
let memories = ctx.cursor_memories;
|
|
501
|
+
if (search) {
|
|
502
|
+
memories = memories.filter((m) => m.title.toLowerCase().includes(search.toLowerCase()) ||
|
|
503
|
+
m.content.toLowerCase().includes(search.toLowerCase()));
|
|
504
|
+
}
|
|
505
|
+
// Build recognized categories
|
|
506
|
+
const recognized = {
|
|
507
|
+
identity: getUserIdentity() ? "✓ found" : "✗ not found",
|
|
508
|
+
writing_preferences: getWritingPreferences() ? "✓ found" : "✗ not found",
|
|
509
|
+
workflow: getWorkflowPreferences() ? "✓ found" : "✗ not found",
|
|
510
|
+
};
|
|
511
|
+
return {
|
|
512
|
+
content: [
|
|
513
|
+
{
|
|
514
|
+
type: "text",
|
|
515
|
+
text: JSON.stringify({
|
|
516
|
+
status: "ok",
|
|
517
|
+
total_memories: ctx.cursor_memories.length,
|
|
518
|
+
showing: memories.length,
|
|
519
|
+
search: search || null,
|
|
520
|
+
recognized_categories: recognized,
|
|
521
|
+
memories: memories.map((m) => ({
|
|
522
|
+
id: m.id,
|
|
523
|
+
title: m.title,
|
|
524
|
+
content_preview: m.content.length > 200
|
|
525
|
+
? m.content.substring(0, 200) + "..."
|
|
526
|
+
: m.content,
|
|
527
|
+
})),
|
|
528
|
+
}, null, 2),
|
|
529
|
+
},
|
|
530
|
+
],
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
case "update_memory": {
|
|
534
|
+
const { action, id, title, content } = args;
|
|
535
|
+
if (action === "delete") {
|
|
536
|
+
if (!id) {
|
|
537
|
+
return {
|
|
538
|
+
content: [
|
|
539
|
+
{
|
|
540
|
+
type: "text",
|
|
541
|
+
text: JSON.stringify({
|
|
542
|
+
status: "error",
|
|
543
|
+
message: "id is required for delete action",
|
|
544
|
+
}, null, 2),
|
|
545
|
+
},
|
|
546
|
+
],
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
const result = deleteMemory(id);
|
|
550
|
+
return {
|
|
551
|
+
content: [
|
|
552
|
+
{
|
|
553
|
+
type: "text",
|
|
554
|
+
text: JSON.stringify({
|
|
555
|
+
status: result.deleted ? "deleted" : "not_found",
|
|
556
|
+
id,
|
|
557
|
+
total_memories: result.context?.cursor_memories?.length || 0,
|
|
558
|
+
}, null, 2),
|
|
559
|
+
},
|
|
560
|
+
],
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
// Create or update
|
|
564
|
+
if (!title || !content) {
|
|
565
|
+
return {
|
|
566
|
+
content: [
|
|
567
|
+
{
|
|
568
|
+
type: "text",
|
|
569
|
+
text: JSON.stringify({
|
|
570
|
+
status: "error",
|
|
571
|
+
message: "title and content are required for create/update action",
|
|
572
|
+
}, null, 2),
|
|
573
|
+
},
|
|
574
|
+
],
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
const memoryId = action === "create" ? generateMemoryId() : id;
|
|
578
|
+
if (action === "update" && !id) {
|
|
579
|
+
return {
|
|
580
|
+
content: [
|
|
581
|
+
{
|
|
582
|
+
type: "text",
|
|
583
|
+
text: JSON.stringify({
|
|
584
|
+
status: "error",
|
|
585
|
+
message: "id is required for update action",
|
|
586
|
+
}, null, 2),
|
|
587
|
+
},
|
|
588
|
+
],
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
const memory = {
|
|
592
|
+
id: memoryId,
|
|
593
|
+
title,
|
|
594
|
+
content,
|
|
595
|
+
};
|
|
596
|
+
const ctx = upsertMemory(memory);
|
|
597
|
+
return {
|
|
598
|
+
content: [
|
|
599
|
+
{
|
|
600
|
+
type: "text",
|
|
601
|
+
text: JSON.stringify({
|
|
602
|
+
status: action === "create" ? "created" : "updated",
|
|
603
|
+
memory: {
|
|
604
|
+
id: memory.id,
|
|
605
|
+
title: memory.title,
|
|
606
|
+
content_preview: memory.content.length > 200
|
|
607
|
+
? memory.content.substring(0, 200) + "..."
|
|
608
|
+
: memory.content,
|
|
609
|
+
},
|
|
610
|
+
total_memories: ctx.cursor_memories.length,
|
|
611
|
+
}, null, 2),
|
|
612
|
+
},
|
|
613
|
+
],
|
|
614
|
+
};
|
|
615
|
+
}
|
|
384
616
|
default:
|
|
385
617
|
throw new Error(`Unknown tool: ${name}`);
|
|
386
618
|
}
|