TODO管理服务器

GeeksHacking MCP是一个用于管理和跟踪源代码文件中TODO注释的MCP服务器,提供TODO注释的添加、查询和持久化存储功能,适用于开发环境中的任务管理。

  • by JiaweiLin
  • Python
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 JiaweiLin/geekshacking-mcp

使用说明

GeeksHacking MCP-TODO管理服务器

用于管理和跟踪源代码文件中#TODO注释的模型上下文协议(MCP)服务器。

概述

GeeksHacking MCP是一个MCP服务器,它提供工具和资源来跟踪分散在代码库中的TODO注释。它存储TODO项及其源文件位置和行号,使您可以直接从开发环境中轻松管理和查询挂起的任务。

特性

  • 添加所有:使用行号跟踪从任何源文件注册TODO注释
  • 全部查询:检索特定文件的所有TODO项
  • 持久化存储:将TODO项存储在JSON数据库中
  • MCP集成:与MCP兼容的客户端(如Claude Desktop、Cline等)无缝协作

安装

先决条件

  • Python 3.13或更高版本
  • uv 包管理器(推荐)或 pip

通过 uv 安装

uvx --from git+https://github.com/JiaweiLin/geekshacking-mcp.git todo_mcp

从源代码安装

# Clone the repository
git clone https://github.com/JiaweiLin/geekshacking-mcp.git
cd geekshacking-mcp

# Install dependencies
uv sync

# Run the server
uv run todo_mcp

用法

作为MCP服务器

将以下配置添加到MCP客户端配置文件中(例如,Claude Desktop的配置):

{
  "mcpServers": {
    "todo_mcp": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/JiaweiLin/geekshacking-mcp.git",
        "todo_mcp"
      ]
    }
  }
}

或者,如果在本地安装:

{
  "mcpServers": {
    "todo_mcp": {
      "command": "uv",
      "args": ["run", "todo_mcp"],
      "cwd": "/path/to/geekshacking-mcp"
    }
  }
}

可用工具

tool_add_todo

从源文件中添加单个#TODO文本。

参数:

  • filename (string):包含#TODO的源文件
  • line_num (整数):#TODO的行号
  • text (string):#要添加的TODO文本

例子:

{
  "filename": "src/main.py",
  "line_num": 42,
  "text": "Refactor this function for better performance"
}

可用资源

resource_get_todos_for_file

获取源文件的所有#TODO文本。

URI模式: todo://{filename}/todos

参数:

  • filename (string):包含#TODO的源文件

退货: TODO文本字符串数组(如果文件不存在TODO,则为空数组)

示例URI: todo://src/main.py/todos

数据库

TODO项目存储在JSON文件中:

src/todo_mcp/todo_db.json

数据库结构:

{
  "filename.ext": {
    "_10": "TODO text at line 10",
    "_20": "TODO text at line 20"
  }
}

发展

项目结构

geekshacking-mcp/
├── src/
│   └── todo_mcp/
│       ├── __init__.py
│       ├── todo_mcp.py      # MCP server implementation
│       └── todo_db.py        # Database management
├── pyproject.toml            # Project configuration
├── uv.lock                   # Dependency lock file
└── README.md

为发展而设立

# Install development dependencies
uv sync

# Run the server locally
uv run todo_mcp

# Run tests (if available)
uv run pytest

依赖项

  • fastmcp>=2.13.0.2 -用于构建MCP服务器的FastMCP框架

贡献

欢迎投稿!请随时提交拉取请求。

许可证

MIT许可证

链接

支持

有关问题、疑问或贡献,请访问 GitHub存储库.