MCPlanManager
一个简洁高效的任务管理器,专为AI Agent的长程任务执行而设计,支持MCP(模型上下文协议)标准。通过`uvx`可以一行命令轻松启动,自动处理依赖管理和环境设置。
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"mcplanmanager": {
"args": [
"mcplanmanager@latest"
],
"command": "uvx"
}
}
}
可用工具 (13 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
initializePlan 2 个参数 需填 2 项
初始化或完全替换一个新的任务计划。 Args: goal (str): 描述计划总体目标的字符串。 tasks (List[TaskInput]): 任务对象的列表。每个任务都应符合TaskInput模型定义的结构。
必填参数:goal、tasks
visualizeDependencies 1 个参数
生成当前任务依赖关系的可视化图。 Args: format (str, optional): 输出的格式。可接受的值为 'mermaid' (生成流程图代码), 'tree' (生成树状图), 或 'ascii' (生成纯文本格式的列表)。 默认为 'ascii'。 Returns: str: 包含所选格式可视化内容的字符串。
该工具无需必填参数,直接调用即可
getCurrentTask
获取当前标记为 'in_progress' (正在进行中) 的任务详情。 Returns: ToolResponse[TaskOutput]: 包含当前任务详情的响应对象。
该工具无需必填参数,直接调用即可
startNextTask
自动查找下一个可执行的任务(所有依赖均已完成)并开始执行。 这会将任务状态更新为 'in_progress'。这是推进计划的核心方法。 Returns: ToolResponse[TaskOutput]: 包含已启动任务的响应对象。
该工具无需必填参数,直接调用即可
completeTask 2 个参数 需填 2 项
将指定ID的任务标记为 'completed' (已完成)。 这是解锁后续依赖任务的关键步骤。 Args: task_id (int): 需要标记为完成的任务的ID (从0开始)。 result (str): 描述任务完成结果或产出的字符串。
必填参数:task_id、result
failTask 3 个参数 需填 2 项
将指定ID的任务标记为 'failed' (失败)。 Args: task_id (int): 需要标记为失败的任务的ID (从0开始)。 error_message (str): 描述任务失败原因的字符串。 should_retry (bool, optional): 是否应该重试该任务的标志。默认为 True。
必填参数:task_id、error_message
addTask 4 个参数 需填 3 项
向当前计划中动态添加一个新任务。 Args: name (str): 新任务的名称,应确保唯一性。 dependencies (List[int]): 新任务所依赖的任务ID的整数列表 (从0开始)。 reasoning (str): 解释为何要添加此任务的字符串。 after_task_id (int, optional): 一个任务ID,新任务将被插入到该任务之后。如果省略,则添加到列表末尾。 Returns: ToolResponse[TaskOutput]: 包含新创建任务的响应对象。
必填参数:name、dependencies、reasoning
skipTask 2 个参数 需填 2 项
将指定ID的任务标记为 'skipped' (已跳过)。 被跳过的任务在依赖解析中被视为“已完成”,允许后续任务继续。 Args: task_id (int): 需要跳过的任务的ID (从0开始)。 reason (str): 解释为何跳过此任务的字符串。
必填参数:task_id、reason
editDependencies 1 个参数 需填 1 项
以批量、事务性的方式编辑一个或多个任务的依赖关系。 此工具允许 'set' 或 'update' 操作,所有编辑将在应用前进行全面验证。 如果任何指令失败,整个操作将回滚。 Args: edits (List[DependencyEdit]): 一个包含编辑指令对象的列表,每个对象都应符合 DependencyEdit 模型。
必填参数:edits
getPlanStatus
获取整个计划的全面概览,包括元数据、进度、任务状态统计等。
该工具无需必填参数,直接调用即可
getTaskList 1 个参数
获取计划中所有任务的列表,可按状态进行过滤。 Args: status_filter (str, optional): 用于过滤任务的状态字符串。 可接受的值: 'pending', 'in_progress', 'completed', 'failed', 'skipped'。 Returns: ToolResponse[List[TaskOutput]]: 包含任务列表的响应对象。
该工具无需必填参数,直接调用即可
getExecutableTaskList
获取当前所有依赖已满足且状态为 'pending' 的可执行任务列表。 Returns: ToolResponse[List[TaskOutput]]: 包含可执行任务列表的响应对象。
该工具无需必填参数,直接调用即可
generateContextPrompt
生成一个详细的文本提示,总结计划的当前状态。 这个提示可以作为上下文提供给AI模型,以帮助其决定下一步行动。 内容包括:总体目标、当前任务、可执行任务列表等。
该工具无需必填参数,直接调用即可
服务介绍
MCPlanManager - AI Agent Task Management System
A simple and efficient task manager designed for long-term task execution by AI Agents, supporting the MCP (Model Context Protocol) standard.
🚀 Quick Start (Recommended Method)
We strongly recommend using uvx to run MCPlanManager. uvx allows you to start the MCP service with one command, automatically handling dependency management and environment setup, ensuring you are always using the latest version and avoiding complex dependency conflicts. This approach also lays the foundation for seamless deployment across various hosting platforms.
1. Prerequisites: Install uv
If uv is not yet installed on your system, please execute the following command (this only needs to be done once):
macOS / Linux:
bash
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows:
powershell
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
After installation, please restart your terminal or open a new terminal window.
2. Configure Your AI Client
In the settings of MCP-supported clients like Cursor, Continue.dev, etc., add a new MCP server with the following configuration:
json
{
"mcpServers": {
"mcplanmanager": {
"command": "uvx",
"args": ["mcplanmanager"]
}
}
}
After restarting the client, the MCPlanManager tools will be available. No need to manually install dependencies or configure the Python environment! uvx intelligently downloads and runs the service from PyPI. For hosting platforms that support uvx, simply set the startup command to uvx mcplanmanager to achieve automated deployment and elastic scaling.
📚 Alternative: Using Virtual Environments and pip
If you prefer not to install uv, you can use a traditional Python virtual environment.
-
Create and activate the virtual environment
bash
python3 -m venv ~/.mcplanmanager-env
source ~/.mcplanmanager-env/bin/activate # macOS / Linux.\mcplanmanager-env\Scripts\activate # Windows
-
Install the package
bash
pip install mcplanmanager -
Configure the AI client
You need to tell the client the specific path to themcplanmanagercommand.
json
{
"mcpServers": {
"mcplanmanager": {
// Note: The path here should be the absolute path in your virtual environment
// Example: "/Users/yourname/.mcplanmanager-env/bin/mcplanmanager"
"command": "<path_to_your_env>/bin/mcplanmanager"
}
}
}
🛠️ Available MCP Tools
After successful installation and configuration, you can use the following 12 tools:
Basic Task Management
initializePlan- Initialize a new task plangetCurrentTask- Get the currently executing taskstartNextTask- Start the next executable taskcompleteTask- Mark a task as completedfailTask- Mark a task as failedskipTask- Skip a specified task
Task Operations
addTask- Add a new task to the plangetTaskList- Get the list of tasks (supports status filtering)getExecutableTaskList- Get the list of currently executable tasksgetPlanStatus- Get the status of the entire plan
Visualization and Assistance
visualizeDependencies- Generate dependency visualization (ASCII, tree, Mermaid formats)generateContextPrompt- Generate context prompt
📝 Development and Contribution
Local Development
bash
Clone the repository
git clone https://github.com/donway19/MCPlanManager.git
cd MCPlanManager
Create a virtual environment and install development dependencies
uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"
Run tests
pytest tests/
📄 License
MIT License - See LICENSE file for details.