Task Manager MCP Server

Integrations

  • Provides environment variable configuration support for storing LLM API keys and server settings via .env files

  • Supports containerized deployment of the Task Manager MCP server, with configuration for building and running the server as a Docker container

  • Offers alternative LLM provider integration for task management functions, allowing use of locally deployed Ollama models for PRD parsing and task suggestions

任务管理器 MCP 服务器

用于管理任务和项目的模型上下文协议 (MCP)服务器的模板实现。该服务器提供全面的任务管理系统,支持项目组织、任务跟踪和 PRD 解析。

概述

该项目演示了如何构建一个 MCP 服务器,使 AI 代理能够管理任务、跟踪项目进度并将产品需求文档 (PRD) 分解为可执行的任务。它可以作为创建具有任务管理功能的 MCP 服务器的实用模板。

该实施遵循 Anthropic 为构建 MCP 服务器制定的最佳实践,允许与任何兼容 MCP 的客户端无缝集成。

特征

该服务器提供了几个必不可少的任务管理工具:

  1. 任务管理
    • create_task_file :创建新的项目任务文件
    • add_task :向项目添加任务,并附带描述和子任务
    • update_task_status :更新任务和子任务的状态
    • get_next_task :从项目中获取下一个未完成的任务
  2. 项目规划
    • parse_prd :自动将 PRD 转换为结构化任务
    • expand_task :将任务分解为更小、更易于管理的子任务
    • estimate_task_complexity任务复杂性和时间要求
    • get_task_dependencies :跟踪任务依赖关系
  3. 开发支持
    • generate_task_file :根据任务描述生成文件模板
    • suggest_next_actions :获取 AI 支持的后续步骤建议

先决条件

  • Python 3.12+
  • 您选择的 LLM 提供商(OpenAI、OpenRouter 或 Ollama)的 API 密钥
  • 如果将 MCP 服务器作为容器运行,则使用 Docker(推荐)

安装

使用 uv

  1. 如果你没有 uv,请安装它:
    pip install uv
  2. 克隆此存储库:
    git clone https://github.com/coleam00/mcp-mem0.git cd mcp-mem0
  3. 安装依赖项:
    uv pip install -e .
  4. 根据.env.example创建.env文件:
    cp .env.example .env
  5. .env文件中配置环境变量(参见配置部分)

使用 Docker(推荐)

  1. 构建 Docker 镜像:
    docker build -t mcp/mem0 --build-arg PORT=8050 .
  2. 根据.env.example创建.env文件并配置环境变量

配置

您可以在.env文件中配置以下环境变量:

多变的描述例子
TRANSPORT传输协议(sse 或 stdio)sse
HOST使用 SSE 传输时绑定到的主机0.0.0.0
PORT使用 SSE 传输时监听的端口8050
LLM_PROVIDERLLM 提供商(openai、openrouter 或 ollama)openai
LLM_BASE_URLLLM API 的基本 URLhttps://api.openai.com/v1
LLM_API_KEYLLM 提供商的 API 密钥sk-...
LLM_CHOICE用于任务分析的 LLM 模型gpt-4

运行服务器

使用 Python 3

# Set TRANSPORT=sse in .env then: python3 src/main.py

服务器将在配置的主机和端口上启动(默认值: http ://0.0.0.0:8050)。

使用 Docker

docker build -t task-manager-mcp . docker run --env-file .env -p 8050:8050 task-manager-mcp

使用任务管理器

创建新项目

  1. 为您的项目创建任务文件:
await mcp.create_task_file(project_name="my-project")
  1. 将任务添加到您的项目:
await mcp.add_task( project_name="my-project", title="Setup Development Environment", description="Configure the development environment with required tools", subtasks=[ "Install dependencies", "Configure linters", "Set up testing framework" ] )
  1. 解析 PRD 以自动创建任务:
await mcp.parse_prd( project_name="my-project", prd_content="# Your PRD content..." )

管理任务

  1. 更新任务状态:
await mcp.update_task_status( project_name="my-project", task_title="Setup Development Environment", subtask_title="Install dependencies", status="done" )
  1. 获取下一个要处理的任务:
next_task = await mcp.get_next_task(project_name="my-project")
  1. 将任务扩展为子任务:
await mcp.expand_task( project_name="my-project", task_title="Implement Authentication" )

开发工作流程

  1. 为任务生成文件模板:
await mcp.generate_task_file( project_name="my-project", task_title="User Authentication" )
  1. 获取任务复杂度估计:
complexity = await mcp.estimate_task_complexity( project_name="my-project", task_title="User Authentication" )
  1. 获取下一步行动的建议:
suggestions = await mcp.suggest_next_actions( project_name="my-project", task_title="User Authentication" )

与 MCP 客户端集成

SSE配置

要使用 SSE 传输连接到服务器,请使用以下配置:

{ "mcpServers": { "task-manager": { "transport": "sse", "url": "http://localhost:8050/sse" } } }

Stdio 配置

对于 stdio 传输,请使用以下配置:

{ "mcpServers": { "task-manager": { "command": "python3", "args": ["src/main.py"], "env": { "TRANSPORT": "stdio", "LLM_PROVIDER": "openai", "LLM_API_KEY": "YOUR-API-KEY", "LLM_CHOICE": "gpt-4" } } } }

构建您自己的服务器

此模板为构建更复杂的任务管理 MCP 服务器奠定了基础。扩展方法如下:

  1. 使用@mcp.tool()装饰器添加新的任务管理工具
  2. 实现自定义任务分析和自动化功能
  3. 添加特定于项目的任务模板和工作流程
  4. 与您现有的开发工具和流程集成
-
security - not tested
A
license - permissive license
-
quality - not tested

模型上下文协议服务器提供全面的任务管理功能,支持项目组织、任务跟踪和自动将 PRD 解析为可操作的项目。

  1. Overview
    1. Features
      1. Prerequisites
        1. Installation
          1. Using uv
          2. Using Docker (Recommended)
        2. Configuration
          1. Running the Server
            1. Using Python 3
            2. Using Docker
          2. Using the Task Manager
            1. Creating a New Project
            2. Managing Tasks
            3. Development Workflow
          3. Integration with MCP Clients
            1. SSE Configuration
            2. Stdio Configuration
          4. Building Your Own Server
            ID: ofgb72kid6