Skip to content

Commit a75f60e

Browse files
Merge pull request #32 from chriscarrollsmith/29-standardize-the-clis-interactivity-with-the-mcp-tools
Optimize CLI code and document how to synchronize custom file path across CLI & MCP server
2 parents 96f9af1 + 89d3ae7 commit a75f60e

File tree

10 files changed

+376
-588
lines changed

10 files changed

+376
-588
lines changed

.github/workflows/npm-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
node-version: 'latest'
1414
- run: npm ci
1515
- run: npm install -g tsx
16+
- run: npm run build
1617
- run: npm test
1718

1819
publish:

README.md

Lines changed: 23 additions & 191 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MCP Task Manager
22

3-
MCP Task Manager ([npm package: taskqueue-mcp](https://www.npmjs.com/package/taskqueue-mcp)) is a Model Context Protocol (MCP) server for AI task management. This tool helps AI assistants handle multi-step tasks in a structured way, with optional user approval checkpoints.
3+
MCP Task Manager ([npm package: taskqueue-mcp](https://www.npmjs.com/package/taskqueue-mcp)) is a Model Context Protocol (MCP) server for AI task management. This tool helps AI assistants handle multi-step tasks in a structured way, with optional user approval checkpoints.
44

55
## Features
66

@@ -27,22 +27,6 @@ Usually you will set the tool configuration in Claude Desktop, Cursor, or anothe
2727
}
2828
```
2929

30-
Or, with a custom tasks.json path:
31-
32-
```json
33-
{
34-
"tools": {
35-
"taskqueue": {
36-
"command": "npx",
37-
"args": ["-y", "taskqueue-mcp"],
38-
"env": {
39-
"TASK_MANAGER_FILE_PATH": "/path/to/tasks.json"
40-
}
41-
}
42-
}
43-
}
44-
```
45-
4630
To use the CLI utility, you can use the following command:
4731

4832
```bash
@@ -51,7 +35,7 @@ npx task-manager-cli --help
5135

5236
This will show the available commands and options.
5337

54-
## Available Operations
38+
## Available MCP Tools
5539

5640
The TaskManager now uses a direct tools interface with specific, purpose-built tools for each operation:
5741

@@ -143,181 +127,42 @@ This command displays information about all projects in the system or a specific
143127
- Task details (title, description, status, approval)
144128
- Progress metrics (approved/completed/total tasks)
145129

146-
## Example Usage
147-
148-
### Creating a Project with Tasks
149-
150-
```javascript
151-
// Example of how an LLM would use the create_project tool
152-
{
153-
'create_project': {
154-
'initialPrompt': "Create a website for a small business",
155-
'projectPlan': "We'll create a responsive website with Home, About, Services, and Contact pages",
156-
'tasks': [
157-
{
158-
'title': "Set up project structure",
159-
'description': "Create repository and initialize with basic HTML/CSS/JS files",
160-
'toolRecommendations': "create_directory, create_file, git_init",
161-
'ruleRecommendations': "Use consistent file naming, Initialize git repository"
162-
},
163-
{
164-
'title': "Design homepage",
165-
'description': "Create responsive homepage with navigation and hero section",
166-
'toolRecommendations': "html_editor, css_editor, image_optimizer",
167-
'ruleRecommendations': "Follow accessibility guidelines (WCAG), Optimize for mobile-first"
168-
},
169-
{
170-
'title': "Implement about page",
171-
'description': "Create about page with company history and team section",
172-
'toolRecommendations': "html_editor, css_editor",
173-
'ruleRecommendations': "Use clear and concise language, Include team member photos"
174-
}
175-
]
176-
}
177-
}
178-
179-
// Response will include:
180-
// {
181-
// status: "planned",
182-
// projectId: "proj-1234",
183-
// totalTasks: 3,
184-
// tasks: [
185-
// { id: "task-1", title: "Set up structure", ..., toolRecommendations: "...", ruleRecommendations: "..." },
186-
// { id: "task-2", title: "Design homepage", ..., toolRecommendations: "...", ruleRecommendations: "..." },
187-
// { id: "task-3", title: "Implement about page", ..., toolRecommendations: "...", ruleRecommendations: "..." }
188-
// ],
189-
// message: "Project created with 3 tasks"
190-
// }
191-
```
130+
## Data Schema and Storage
192131

193-
### Getting the Next Task
132+
### File Location
194133

195-
```javascript
196-
// Example of how an LLM would use the get_next_task tool
197-
{
198-
'get_next_task': {
199-
'projectId': "proj-1234"
200-
}
201-
}
134+
The task manager stores data in a JSON file that must be accessible to both the server and CLI.
202135

203-
// Response will include:
204-
// {
205-
// status: "next_task",
206-
// task: {
207-
// id: "task-1",
208-
// title: "Set up project structure",
209-
// description: "Create repository and initialize with basic HTML/CSS/JS files",
210-
// status: "not started",
211-
// approved: false
212-
// },
213-
// message: "Retrieved next task"
214-
// }
215-
```
136+
The default platform-specific location is:
137+
- **Linux**: `~/.local/share/taskqueue-mcp/tasks.json`
138+
- **macOS**: `~/Library/Application Support/taskqueue-mcp/tasks.json`
139+
- **Windows**: `%APPDATA%\taskqueue-mcp\tasks.json`
216140

217-
### Marking a Task as Done
141+
Using a custom file path for storing task data is not recommended, because you have to remember to set the same path for both the MCP server and the CLI, or they won't be able to coordinate with each other. But if you do want to use a custom path, you can set the `TASK_MANAGER_FILE_PATH` environment variable in your MCP client configuration:
218142

219-
```javascript
220-
// Example of how an LLM would use the mark_task_done tool
143+
```json
221144
{
222-
'mark_task_done': {
223-
'projectId': "proj-1234",
224-
'taskId': "task-1",
225-
'completedDetails': "Created repository at github.com/example/business-site and initialized with HTML5 boilerplate, CSS reset, and basic JS structure." // Required when marking as done
145+
"tools": {
146+
"taskqueue": {
147+
"command": "npx",
148+
"args": ["-y", "taskqueue-mcp"],
149+
"env": {
150+
"TASK_MANAGER_FILE_PATH": "/path/to/tasks.json"
151+
}
152+
}
226153
}
227154
}
228-
229-
// Response will include:
230-
// {
231-
// status: "task_marked_done",
232-
// task: {
233-
// id: "task-1",
234-
// title: "Set up project structure",
235-
// status: "done",
236-
// approved: false,
237-
// completedDetails: "Created repository at github.com/example/business-site and initialized with HTML5 boilerplate, CSS reset, and basic JS structure."
238-
// },
239-
// message: "Task marked as done"
240-
// }
241155
```
242156

243-
### Approving a Task (CLI-only operation)
244-
245-
This operation can only be performed by the user through the CLI:
157+
Then, before running the CLI, you should export the same path in your shell:
246158

247159
```bash
248-
npm run approve-task -- proj-1234 task-1
249-
```
250-
251-
After approval, the LLM can check the task status using `read_task` or get the next task using `get_next_task`.
252-
253-
### Finalizing a Project
254-
255-
```javascript
256-
// Example of how an LLM would use the finalize_project tool
257-
// (Called after all tasks are done and approved)
258-
{
259-
'finalize_project': {
260-
'projectId': "proj-1234"
261-
}
262-
}
263-
264-
// Response will include:
265-
// {
266-
// status: "project_finalized",
267-
// projectId: "proj-1234",
268-
// message: "Project has been finalized"
269-
// }
270-
```
271-
272-
## Status Codes and Responses
273-
274-
All operations return a status code and message in their response:
275-
276-
### Project Tool Statuses
277-
- `projects_listed`: Successfully listed all projects
278-
- `planned`: Successfully created a new project
279-
- `project_deleted`: Successfully deleted a project
280-
- `tasks_added`: Successfully added tasks to a project
281-
- `project_finalized`: Successfully finalized a project
282-
- `error`: An error occurred (with error message)
283-
284-
### Task Tool Statuses
285-
- `task_details`: Successfully retrieved task details
286-
- `task_updated`: Successfully updated a task
287-
- `task_deleted`: Successfully deleted a task
288-
- `task_not_found`: Task not found
289-
- `error`: An error occurred (with error message)
290-
291-
## Structure of the Codebase
292-
160+
export TASK_MANAGER_FILE_PATH="/path/to/tasks.json"
293161
```
294-
src/
295-
├── index.ts # Main entry point
296-
├── client/
297-
│ └── cli.ts # CLI for user task review and approval
298-
├── server/
299-
│ ├── TaskManager.ts # Core service functionality
300-
│ └── tools.ts # MCP tool definitions
301-
└── types/
302-
└── index.ts # Type definitions and schemas
303-
```
304-
305-
## Data Schema and Storage
306-
307-
The task manager stores data in a JSON file with platform-specific default locations:
308162

309-
- **Default locations**:
310-
- **Linux**: `~/.local/share/taskqueue-mcp/tasks.json` (following XDG Base Directory specification)
311-
- **macOS**: `~/Library/Application Support/taskqueue-mcp/tasks.json`
312-
- **Windows**: `%APPDATA%\taskqueue-mcp\tasks.json` (typically `C:\Users\<username>\AppData\Roaming\taskqueue-mcp\tasks.json`)
313-
- **Custom location**: Set via `TASK_MANAGER_FILE_PATH` environment variable
314-
315-
```bash
316-
# Example of setting custom storage location
317-
TASK_MANAGER_FILE_PATH=/path/to/custom/tasks.json npm start
318-
```
163+
### Data Schema
319164

320-
The data schema is organized as follows:
165+
The JSON file uses the following structure:
321166

322167
```
323168
TaskManagerFile
@@ -337,19 +182,6 @@ TaskManagerFile
337182
└── ruleRecommendations: string # Suggested rules/guidelines to follow for this task
338183
```
339184

340-
The system persists this structure to the JSON file after each operation.
341-
342-
**Explanation of Task Properties:**
343-
344-
- `id`: A unique identifier for the task
345-
- `title`: A short, descriptive title for the task
346-
- `description`: A more detailed explanation of the task
347-
- `status`: The current status of the task (`not started`, `in progress`, or `done`)
348-
- `approved`: Indicates whether the task has been approved by the user
349-
- `completedDetails`: Provides details about the task completion (required when `status` is `done`)
350-
- `toolRecommendations`: A string containing suggested tools (by name or identifier) that might be helpful for completing this task. The LLM can use this to prioritize which tools to consider.
351-
- `ruleRecommendations`: A string containing suggested rules or guidelines that should be followed while working on this task. This can include things like "ensure all code is commented," "follow accessibility guidelines," or "use the company style guide". The LLM uses these to improve the quality of its work.
352-
353185
## License
354186

355187
MIT

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ListToolsRequestSchema, CallToolRequestSchema } from "@modelcontextprot
1010
const server = new Server(
1111
{
1212
name: "task-manager-server",
13-
version: "1.1.1"
13+
version: "1.1.2"
1414
},
1515
{
1616
capabilities: {

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "taskqueue-mcp",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "Task Queue MCP Server",
55
"author": "Christopher C. Smith ([email protected])",
66
"main": "dist/index.js",
@@ -19,7 +19,7 @@
1919
"build": "tsc",
2020
"start": "node dist/index.js",
2121
"dev": "tsc && node dist/index.js",
22-
"test": "tsc && NODE_OPTIONS=--experimental-vm-modules jest",
22+
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
2323
"approve-task": "node dist/src/cli.js approve-task",
2424
"list-tasks": "node dist/src/cli.js list"
2525
},

0 commit comments

Comments
 (0)