Skip to content

Commit 3e225bb

Browse files
Change 'request' abstraction to 'project'
1 parent 5b974cd commit 3e225bb

File tree

14 files changed

+1271
-763
lines changed

14 files changed

+1271
-763
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ node_modules
77
.env
88
.env.local
99
.cursor
10-
artifacts
10+
artifacts
11+
repomix-output.txt
12+
13+
# Task files
14+
tasks.json
15+
*.tasks.json

README.md

Lines changed: 137 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ A Model Context Protocol (MCP) server for AI task management. This tool helps AI
77
- Task planning with multiple steps
88
- Progress tracking
99
- User approval of completed tasks
10-
- Request completion approval
10+
- Project completion approval
1111
- Task details visualization
12+
- Task status state management
13+
- Enhanced CLI for task inspection and management
1214

1315
## Structure
1416

@@ -17,6 +19,7 @@ The codebase has been refactored into a modular structure:
1719
```
1820
src/
1921
├── index.ts # Main entry point
22+
├── cli.ts # CLI for task approval and listing
2023
├── server/
2124
│ └── TaskManagerServer.ts # Core server functionality
2225
└── types/
@@ -26,8 +29,12 @@ src/
2629

2730
## Data Schema and Storage
2831

29-
The task manager stores data in a JSON file:
30-
- **Default location**: `~/Documents/tasks.json` (in user's home directory)
32+
The task manager stores data in a JSON file with platform-specific default locations:
33+
34+
- **Default locations**:
35+
- **Linux**: `~/.local/share/mcp-taskmanager/tasks.json` (following XDG Base Directory specification)
36+
- **macOS**: `~/Library/Application Support/mcp-taskmanager/tasks.json`
37+
- **Windows**: `%APPDATA%\mcp-taskmanager\tasks.json` (typically `C:\Users\<username>\AppData\Roaming\mcp-taskmanager\tasks.json`)
3138
- **Custom location**: Set via `TASK_MANAGER_FILE_PATH` environment variable
3239

3340
```bash
@@ -39,18 +46,18 @@ The data schema is organized as follows:
3946

4047
```
4148
TaskManagerFile
42-
├── requests: RequestEntry[]
43-
├── requestId: string # Format: "req-{number}"
44-
├── originalRequest: string # Original user request text
45-
├── splitDetails: string # Additional request details
46-
├── completed: boolean # Request completion status
49+
├── projects: Project[]
50+
├── projectId: string # Format: "proj-{number}"
51+
├── initialPrompt: string # Original user request text
52+
├── projectPlan: string # Additional project details
53+
├── completed: boolean # Project completion status
4754
└── tasks: Task[] # Array of tasks
4855
├── id: string # Format: "task-{number}"
4956
├── title: string # Short task title
5057
├── description: string # Detailed task description
51-
├── done: boolean # Task completion status
58+
├── status: string # Task status: "not started", "in progress", or "done"
5259
├── approved: boolean # Task approval status
53-
└── completedDetails: string # Completion information
60+
└── completedDetails: string # Completion information (required when status is "done")
5461
```
5562

5663
The system persists this structure to the JSON file after each operation.
@@ -110,7 +117,7 @@ You can find this through the Claude Desktop menu:
110117
"tools": {
111118
"taskmanager": {
112119
"command": "npx",
113-
"args": ["-y", "@kazuph/mcp-taskmanager"]
120+
"args": ["-y", "@chriscarrollsmith/mcp-taskmanager"]
114121
}
115122
}
116123
}
@@ -126,7 +133,7 @@ You can find this through the Claude Desktop menu:
126133
### Installation
127134

128135
```bash
129-
git clone https://github.com/kazuph/mcp-taskmanager.git
136+
git clone https://github.com/chriscarrollsmith/mcp-taskmanager.git
130137
cd mcp-taskmanager
131138
npm install
132139
npm run build
@@ -160,44 +167,137 @@ Add the following to your MCP client's configuration:
160167

161168
## Available Operations
162169

163-
The TaskManager supports two main phases of operation:
170+
The TaskManager now uses a consolidated API with two main tools:
171+
172+
### `project` Tool
173+
Manages high-level projects with multiple tasks.
174+
175+
**Actions:**
176+
- `list`: List all projects in the system
177+
- `create`: Create a new project with initial tasks
178+
- `delete`: Remove a project
179+
- `add_tasks`: Add new tasks to an existing project
180+
- `finalize`: Finalize a project after all tasks are done and approved
181+
182+
### `task` Tool
183+
Manages individual tasks within projects.
184+
185+
**Actions:**
186+
- `read`: Get details of a specific task
187+
- `update`: Modify a task's properties (title, description, status)
188+
- `delete`: Remove a task from a project
189+
190+
### Task Status
191+
Tasks have a status field that can be one of:
192+
- `not started`: Task has not been started yet
193+
- `in progress`: Task is currently being worked on
194+
- `done`: Task has been completed
195+
196+
#### Status Transition Rules
197+
The system enforces the following rules for task status transitions:
198+
- Tasks follow a specific workflow with defined valid transitions:
199+
- From `not started`: Can only move to `in progress`
200+
- From `in progress`: Can move to either `done` or back to `not started`
201+
- From `done`: Can move back to `in progress` if additional work is needed
202+
- A task cannot skip states (e.g., cannot go directly from "not started" to "done")
203+
- When a task is marked as "done", the `completedDetails` field is required
204+
- Approved tasks cannot be modified
205+
206+
These rules help maintain the integrity of task progress and ensure proper documentation of completed work.
207+
208+
### CLI Commands
209+
210+
#### Task Approval
211+
212+
Task approval is controlled exclusively by the human user through a CLI command:
213+
214+
```bash
215+
npm run approve-task -- <projectId> <taskId>
216+
```
217+
218+
Options:
219+
- `-f, --force`: Force approval even if the task is not marked as done
220+
221+
This command sets the `approved` field of a task to `true` after verifying that the task is marked as `done`. Only the human user can approve tasks, ensuring quality control.
222+
223+
#### Listing Tasks and Projects
164224

165-
### Planning Phase
166-
- Accepts a task list (array of strings) from the user
167-
- Stores tasks internally as a queue
168-
- Returns an execution plan (task overview, task ID, current queue status)
225+
The CLI provides a command to list all projects and tasks:
169226

170-
### Execution Phase
171-
- Returns the next task from the queue when requested
172-
- Provides feedback mechanism for task completion
173-
- Removes completed tasks from the queue
174-
- Prepares the next task for execution
227+
```bash
228+
npm run list-tasks
229+
```
230+
231+
To view details of a specific project:
175232

176-
### Parameters
233+
```bash
234+
npm run list-tasks -- -p <projectId>
235+
```
177236

178-
- `action`: "plan" | "execute" | "complete"
179-
- `tasks`: Array of task strings (required for "plan" action)
180-
- `taskId`: Task identifier (required for "complete" action)
181-
- `getNext`: Boolean flag to request next task (for "execute" action)
237+
This command displays information about all projects in the system or a specific project, including:
238+
- Project ID and initial prompt
239+
- Completion status
240+
- Task details (title, description, status, approval)
241+
- Progress metrics (approved/completed/total tasks)
182242

183243
## Example Usage
184244

185-
```typescript
186-
// Planning phase
245+
### Creating a Project with Tasks
246+
```json
187247
{
188-
action: "plan",
189-
tasks: ["Task 1", "Task 2", "Task 3"]
248+
"tool": "project",
249+
"action": "create",
250+
"arguments": {
251+
"initialPrompt": "Write a blog post about cats",
252+
"tasks": [
253+
{ "title": "Research cat breeds", "description": "Find information about 5 popular cat breeds" },
254+
{ "title": "Create outline", "description": "Organize main points and structure of the blog" },
255+
{ "title": "Write draft", "description": "Write the first draft of the blog post" },
256+
{ "title": "Edit and finalize", "description": "Proofread and make final edits to the blog post" }
257+
]
258+
}
190259
}
260+
```
191261

192-
// Execution phase
262+
### Updating a Task Status
263+
```json
193264
{
194-
action: "execute",
195-
getNext: true
265+
"tool": "task",
266+
"action": "update",
267+
"arguments": {
268+
"projectId": "proj-1",
269+
"taskId": "task-1",
270+
"status": "in progress"
271+
}
196272
}
273+
```
197274

198-
// Complete task
275+
### Finalizing a Project
276+
```json
199277
{
200-
action: "complete",
201-
taskId: "task-123"
278+
"tool": "project",
279+
"action": "finalize",
280+
"arguments": {
281+
"projectId": "proj-1"
282+
}
202283
}
203284
```
285+
286+
## Status Codes and Responses
287+
288+
All operations return a status code and message in their response:
289+
290+
### Project Tool Statuses
291+
- `projects_listed`: Successfully listed all projects
292+
- `planned`: Successfully created a new project
293+
- `project_deleted`: Successfully deleted a project
294+
- `tasks_added`: Successfully added tasks to a project
295+
- `project_finalized`: Successfully finalized a project
296+
- `error`: An error occurred (with error message)
297+
298+
### Task Tool Statuses
299+
- `task_details`: Successfully retrieved task details
300+
- `task_updated`: Successfully updated a task
301+
- `task_deleted`: Successfully deleted a task
302+
- `task_not_found`: Task not found
303+
- `error`: An error occurred (with error message)

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"main": "dist/index.js",
77
"type": "module",
88
"bin": {
9-
"mcp-taskmanager": "dist/index.js"
9+
"mcp-taskmanager": "dist/index.js",
10+
"task-manager-cli": "dist/cli.js"
1011
},
1112
"files": [
1213
"dist"
@@ -15,7 +16,9 @@
1516
"build": "tsc",
1617
"start": "node dist/index.js",
1718
"dev": "tsc && node dist/index.js",
18-
"test": "NODE_OPTIONS=--experimental-vm-modules jest"
19+
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
20+
"approve-task": "node dist/cli.js approve-task",
21+
"list-tasks": "node dist/cli.js list"
1922
},
2023
"repository": {
2124
"type": "git",
@@ -33,6 +36,7 @@
3336
"dependencies": {
3437
"@modelcontextprotocol/sdk": "^0.5.0",
3538
"chalk": "^5.3.0",
39+
"commander": "^11.0.0",
3640
"glob": "^10.3.10",
3741
"zod": "^3.22.4",
3842
"zod-to-json-schema": "^3.23.5"

0 commit comments

Comments
 (0)