无头项目管理系统
一个用Go构建的轻量级无头项目管理系统,具有REST API和MCP(模型上下文协议)支持,通过统一的HTTP服务器实现AI集成。
特性
- 项目管理:创建、读取、更新和删除项目
- 任务管理:具有子任务的分层任务结构
- 评论:为任务添加注释以进行协作
- 文件附件:上传和管理任务的文件附件
- 标签:使用可自定义标签组织任务
- MCP集成:通过模型上下文协议实现人工智能驱动的项目管理
- SQLite数据库:轻量级、基于文件的数据库,易于部署
- 文件系统存储:有组织的附件文件存储
建筑
- 后端:使用Gin web框架
- 数据库:SQLite用于持久存储
- 存储:基于文件系统的附件存储
- API:所有操作的RESTful端点
- MCP服务器:基于JSON-RPC的模型上下文协议服务器
安装
使用任务(推荐)
# Clone the repository
git clone https://github.com/headless-pm/headless-project-management.git
cd headless-project-management
# Install Task runner (if not already installed)
# macOS: brew install go-task
# Linux: sh -c "$(curl -sL https://taskfile.dev/install.sh)"
# Build the server
task build手动构建
# Install dependencies
go mod download
# Build the server
go build -o bin/server cmd/server/main.go配置
应用程序是使用环境变量配置的。复制 .env.example 到 .env:
cp .env.example .env关键环境变量:
SERVER_HOST:服务器主机(默认:localhost)SERVER_PORT:服务器端口(默认值:8080)DATABASE_DIR:数据库目录(默认:./data)UPLOAD_DIR:上传目录(默认:./data/uploads)MCP_ENABLED:启用MCP服务器(默认值:true)ADMIN_API_TOKEN:用于创建API令牌的管理员令牌
运行服务器
使用任务
# Run in production mode
task run
# Run in development mode
task dev
# List all available tasks
task --list手动运行
./bin/server使用Docker
# Build Docker image
task docker:build
# Run Docker container
task docker:run统一服务器将启动 http://localhost:8080 并提供:
- 位于的REST API终结点
/api - MCP端点位于
/api/mcp - 健康检查在
/health
API终点
MCP(模型上下文协议)
GET /api/mcp/tools-列出可用的MCP工具POST /api/mcp/tools/call-执行MCP工具
项目
POST /api/projects-创建新项目GET /api/projects-列出所有项目GET /api/projects/:id-获取项目详细信息PUT /api/projects/:id-更新项目DELETE /api/projects/:id-删除项目
任务
POST /api/tasks-创建新任务GET /api/tasks-列出所有任务GET /api/tasks/:id-获取任务详细信息PUT /api/tasks/:id-更新任务DELETE /api/tasks/:id-删除任务POST /api/tasks/:id/comments-向任务添加评论POST /api/tasks/:id/attachments-将附件上传到任务
健康检查
GET /health-检查服务器运行状况
MCP工具
MCP HTTP端点为AI助手提供了以下工具:
create_project-创建新项目list_projects-列出所有具有可选状态筛选器的项目get_project-按ID获取项目详细信息create_task-在项目中创建新任务list_tasks-列出带有可选筛选器的任务update_task_status-更新任务的状态add_comment-向任务添加注释
发展
项目结构
├── cmd/
│ └── server/ # Unified server entry point
├── internal/
│ ├── api/ # HTTP handlers and routes
│ ├── models/ # Data models
│ ├── database/ # Database layer
│ ├── storage/ # File storage
│ └── mcp/ # MCP server implementation
├── pkg/
│ └── config/ # Configuration management
├── data/
│ ├── db/ # SQLite database files
│ └── uploads/ # File attachments
├── migrations/ # Database migrations
├── Taskfile.yml # Task automation
├── Dockerfile # Container configuration
└── .env.example # Example environment variables运行测试
# Run all tests
task test
# Run tests with coverage
task test:coverage
# Test API endpoints
task api:test生产大楼
# Using Task
task build
# Manual build with optimizations
go build -ldflags="-s -w" -o bin/server cmd/server/main.go
# Docker build
task docker:build许可证
麻省理工学院
