Skip to main content

5 Powerful Enhancements to TaskWarrior MCP Server in Just 5 Minutes

· 3 min read
Max Kaido
Architect

In the world of productivity tools, TaskWarrior stands out as a powerful command-line task manager. When combined with the Model Context Protocol (MCP), it becomes even more powerful, allowing AI assistants to interact with your task list seamlessly. Today, we implemented five significant enhancements to our TaskWarrior MCP server in just five minutes, demonstrating the flexibility and extensibility of both TaskWarrior and MCP.

Background

Our TaskWarrior MCP server started as a simple implementation with four basic tools:

  • add_task: Add a new task
  • get_next_tasks: Get the next tasks to work on
  • list_tasks: List tasks with optional filters
  • mark_task_done: Mark a task as completed

While these tools provided basic functionality, we identified several limitations and opportunities for improvement.

Enhancement 1: Task Modification Tool

The first enhancement we implemented was a modify_task tool. This tool allows updating existing tasks without having to delete and recreate them. You can modify:

  • Task description
  • Priority (H/M/L)
  • Project assignment
  • Tags (add or remove)
  • Due dates

This fills a critical gap in the CRUD (Create, Read, Update, Delete) operations for task management.

// Updated schema for modifying tasks
const modifyTaskSchema = {
identifier: z.string().optional(),
uuid: z.string().optional(),
// Optional fields that can be modified
description: z.string().optional(),
due: z.string().optional(), // ISO timestamp
priority: z.enum(['H', 'M', 'L']).optional(),
project: z.string().optional(),
tags: z.array(z.string()).optional(),
remove_tags: z.array(z.string()).optional(),
};

Enhancement 2: Task Deletion Tool

Next, we added a delete_task tool to complete the CRUD operations. This tool allows removing tasks that are no longer relevant, with automatic confirmation to avoid accidental deletions.

// Updated schema for deleting tasks
const deleteTaskSchema = {
identifier: z.string().optional(),
uuid: z.string().optional(),
};

// Tool implementation with automatic confirmation
server.tool('delete_task', deleteTaskSchema, async (params) => {
// ...
const content = execSync(`yes | task ${taskRef} delete`, {
maxBuffer: 1024 * 1024 * 10,
})
.toString()
.trim();
// ...
});

Enhancement 3: Task Details Tool

To provide more detailed information about specific tasks, we implemented a get_task_details tool. This tool returns comprehensive information about a task, including its UUID, which is crucial for our next enhancement.

// New schema for getting task details
const getTaskDetailsSchema = {
identifier: z.string().optional(),
uuid: z.string().optional(),
};

// Tool implementation
server.tool('get_task_details', getTaskDetailsSchema, async (params) => {
// ...
const content = execSync(`task ${taskRef} export`, {
maxBuffer: 1024 * 1024 * 10,
})
.toString()
.trim();
// ...
});

Enhancement 4: UUID-Based Task References

One of the challenges with TaskWarrior is that task IDs can change when tasks are completed or deleted. To address this, we implemented UUID-based task references across all tools. This ensures that operations remain stable even when task IDs change.

// In-memory cache for task ID to UUID mapping
let taskCache: { [id: string]: string } = {};

// Helper function to get UUID from ID
async function getUuidFromId(id: string): Promise<string> {
// ...
}

// Helper function to update the task cache
function updateTaskCache() {
// ...
}

All tools were updated to work with either IDs or UUIDs, with a preference for UUIDs when available. This makes the server much more robust when dealing with task renumbering.

Enhancement 5: Comprehensive Dashboard

Finally, we implemented a powerful dashboard tool that provides a complete overview of tasks in a single call. This tool gathers all the important information at once and presents it in a well-organized format.

// New comprehensive dashboard tool
server.tool('dashboard', dashboardSchema, async () => {
// ...
const dashboard = `
=== TASKWARRIOR DASHBOARD ===

OVERVIEW:
---------
Total Pending Tasks: ${pendingTasks}
High Priority Tasks: ${highPriorityTasks}

NEXT ACTIONS (Top 5):
--------------------
${nextTasks}

PROJECT SUMMARY:
---------------
${projectSummary}

TAG STATISTICS:
-------------
${tagStats}

STATUS SUMMARY:
-------------
${formattedStatusSummary}

RECENTLY COMPLETED (Last 7 days):
-------------------------------
${recentlyCompleted}

UPCOMING DUE (Next 7 days):
-------------------------
${upcomingDue}
`;
// ...
});

The dashboard provides:

  • High-level overview of pending and high-priority tasks
  • Next actions (top 5 tasks by urgency)
  • Project summary with completion percentages
  • Tag statistics
  • Status summary
  • Recently completed tasks
  • Upcoming due tasks

Conclusion

These five enhancements transformed our basic TaskWarrior MCP server into a powerful task management system that can be seamlessly integrated with AI assistants. The implementation took just five minutes, demonstrating the flexibility and extensibility of both TaskWarrior and the Model Context Protocol.

By combining the command-line efficiency of TaskWarrior with the AI-friendly interface of MCP, we've created a productivity tool that offers the best of both worlds. The UUID-based task references ensure stability, while the comprehensive dashboard provides a clear overview of your task situation at a glance.

These enhancements showcase how quickly powerful features can be added to existing tools when using the right technologies and approaches. The TaskWarrior MCP server is now a complete task management solution that can be easily integrated into any AI-powered workflow.