Task Guardian MCP
A Model Context Protocol server for intelligent task management in AI-powered development environments, providing file-based storage, dependency management with cycle detection, and an interactive CLI.
README
Task Guardian MCP
A Model Context Protocol (MCP) server for intelligent task management in AI-powered development environments like Cursor.
Features
- 📁 File-based storage - Tasks stored as JSON files in
.task/directory - 🔢 Sequential IDs - Simple, incremental task numbering
- 🔗 Typed dependencies - Model relationships between tasks (blocks, requires, related-to)
- 🔄 Cycle detection - Prevents circular dependencies at creation time
- 📝 Rich descriptions - Full markdown support with code blocks and checklists
- 🎯 Task types - Support for user stories, tasks, and bugs
- 🔍 Advanced querying - Filter, sort, and search tasks
- ⚡ Batch operations - Create or update multiple tasks at once
- 📦 Custom metadata - Store project-specific attributes on tasks
- 🖥️ Interactive CLI - Beautiful terminal UI for viewing tasks with Ink and React
Installation
From npm (recommended)
npx task-guardian-mcp
From source
pnpm install
Usage
Running the Server
Start the MCP server:
pnpm start
For development with auto-reload:
pnpm dev
CLI Tool
View tasks in your project using an interactive terminal UI:
pnpm cli
The CLI reads from the .task directory in your current working directory and displays tasks in a beautiful, color-coded table with interactive navigation.
Features:
- 🎯 Navigate through tasks with arrow keys
- 👁️ View detailed information for any task
- 🎨 Color-coded status, priority, and type indicators
- 🔍 Filter tasks by status, priority, or type
- ⌨️ Full keyboard navigation
Options:
--status <status>- Filter by status (pending|in_progress|completed|blocked|cancelled)--priority <priority>- Filter by priority (low|medium|high|critical)--type <type>- Filter by type (user_story|task|bug)--help- Show help message
Examples:
# List all tasks
pnpm cli
# List in-progress tasks only
pnpm cli --status in_progress
# List high priority tasks
pnpm cli --priority high
# Combine filters
pnpm cli --status pending --priority critical
Keyboard shortcuts:
In List View:
↑/↓orj/k- Navigate through tasks (vim-style supported)Enter- View selected task detailsq- Quit the applicationCtrl+C- Exit
In Detail View:
- Use your terminal's native scrolling (mouse wheel, trackpad, or terminal scroll commands)
Escorb- Back to listq- Quit the application
Cursor Integration
Add Task Guardian to your Cursor MCP configuration:
Location: ~/.cursor/config/mcp_settings.json
Using npx (recommended)
{
"mcpServers": {
"task-guardian": {
"command": "npx",
"args": ["-y", "task-guardian-mcp"]
}
}
}
From source
{
"mcpServers": {
"task-guardian": {
"command": "node",
"args": ["/absolute/path/to/task-guardian-mcp/dist/index.mjs"]
}
}
}
Replace /absolute/path/to/task-guardian-mcp with the actual path to this repository on your machine.
Task Schema
Tasks are stored in .task/task-{id}.json with the following structure:
{
id: number; // Sequential ID (1, 2, 3, ...)
title: string; // Task title (1-200 chars)
description: string; // Markdown-formatted description
status: 'pending' | 'in_progress' | 'completed' | 'blocked' | 'cancelled';
priority: 'low' | 'medium' | 'high' | 'critical';
type: 'user_story' | 'task' | 'bug';
dependencies: Array<{
taskId: number;
type: 'blocks' | 'requires' | 'related-to';
description?: string;
}>;
createdAt: string; // ISO8601 timestamp
updatedAt: string; // ISO8601 timestamp
[key: string]: any; // Custom metadata fields
}
Available Tools
Core Operations
create_task- Create a new taskget_task- Retrieve a task by IDupdate_task- Update task fieldsdelete_task- Delete a task (with dependency check)list_tasks- List tasks with optional filteringquery_tasks- Advanced search with sorting and pagination
Dependency Management
add_dependency- Add a typed dependency (with cycle detection)remove_dependency- Remove a dependency link
Batch Operations
create_tasks- Create multiple tasks at onceupdate_tasks- Update multiple tasks at once
Examples
Creating a Task
{
"title": "Implement OAuth2 authentication",
"description": "## Overview\n\nAdd OAuth2 support using Google identity provider.\n\n## Acceptance Criteria\n\n- [ ] User can login with Google\n- [ ] JWT tokens generated\n- [ ] Token refresh works",
"priority": "high",
"type": "task"
}
Adding Dependencies
{
"fromTaskId": 5,
"toTaskId": 3,
"type": "blocks",
"description": "OAuth requires database setup first"
}
Querying Tasks
{
"filters": {
"status": ["in_progress", "blocked"],
"priority": ["high", "critical"],
"titleContains": "auth"
},
"sort": {
"field": "priority",
"order": "desc"
},
"limit": 10
}
Architecture
- Types (
src/types/) - Type definitions and constants usingas constpattern - Schemas (
src/schemas/) - Zod validation schemas with type inference - Services (
src/services/) - Business logic for tasks and dependencies - Tools (
src/tools/) - MCP tool implementations - Index (
src/index.ts) - MCP server entry point
Development
Type checking:
pnpm typecheck
Build:
pnpm build
File Structure
.task/
├── .meta.json # Stores last task ID
├── task-1.json # Individual task files
├── task-2.json
└── archive/ # Archived completed tasks
└── task-old.json
TypeScript Best Practices
This project follows modern TypeScript patterns:
- ✅
as constobjects instead of enums - ✅ Zod schema inference for single source of truth
- ✅ Result types for error handling
- ✅
readonlymodifiers for immutability - ✅
typeoverinterfacefor data shapes - ✅ Permissive validation with
.passthrough()
License
MIT
Related
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。