mcp-project 1.0.0

Project MCP Server — projects, tasks/work items, sprints, milestones, dependencies, time tracking, and reporting (progress, burndown, critical path, workload) for project-management agents
Documentation
use chrono::{DateTime, NaiveDate, Utc};
use rmcp::schemars;
use serde::{Deserialize, Serialize};

/// Project lifecycle state.
#[derive(Debug, Clone, Copy, Serialize, Deserialize, schemars::JsonSchema, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum ProjectStatus {
    Planning,
    Active,
    OnHold,
    Completed,
    Archived,
}

/// Work-item type.
#[derive(Debug, Clone, Copy, Serialize, Deserialize, schemars::JsonSchema, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum TaskType {
    Epic,
    Story,
    Task,
    Bug,
    Subtask,
}

/// Task workflow state.
#[derive(Debug, Clone, Copy, Serialize, Deserialize, schemars::JsonSchema, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum TaskStatus {
    Backlog,
    Todo,
    InProgress,
    InReview,
    Blocked,
    Done,
    Cancelled,
}

/// Priority.
#[derive(Debug, Clone, Copy, Serialize, Deserialize, schemars::JsonSchema, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum Priority {
    Critical,
    High,
    Medium,
    Low,
}

/// Dependency relationship between two tasks.
#[derive(Debug, Clone, Copy, Serialize, Deserialize, schemars::JsonSchema, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum DependencyType {
    /// This task is blocked by the other (other must finish first).
    BlockedBy,
    /// This task blocks the other.
    Blocks,
    /// Soft "relates to" link.
    RelatesTo,
}

/// Sprint/iteration state.
#[derive(Debug, Clone, Copy, Serialize, Deserialize, schemars::JsonSchema, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum SprintStatus {
    Planned,
    Active,
    Closed,
}

/// Milestone state.
#[derive(Debug, Clone, Copy, Serialize, Deserialize, schemars::JsonSchema, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum MilestoneStatus {
    Open,
    Reached,
    Missed,
}

/// A project — the top-level container.
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct Project {
    pub id: String,
    pub key: String,
    pub name: String,
    pub description: String,
    pub status: ProjectStatus,
    pub lead: Option<String>,
    pub members: Vec<String>,
    pub start_date: Option<NaiveDate>,
    pub target_date: Option<NaiveDate>,
    pub created_at: DateTime<Utc>,
    pub updated_at: DateTime<Utc>,
}

/// A dependency edge from a task to another task.
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct Dependency {
    pub dep_type: DependencyType,
    pub task_id: String,
}

/// A comment on a task.
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct Comment {
    pub id: String,
    pub author: String,
    pub body: String,
    pub created_at: DateTime<Utc>,
}

/// A logged time entry against a task.
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct TimeLog {
    pub id: String,
    pub user: String,
    pub hours: f64,
    pub note: Option<String>,
    pub logged_at: DateTime<Utc>,
}

/// A work item / task.
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct Task {
    pub id: String,
    pub project_id: String,
    pub task_type: TaskType,
    pub title: String,
    pub description: String,
    pub status: TaskStatus,
    pub priority: Priority,
    pub assignee: Option<String>,
    pub reporter: String,
    /// Parent task id (for subtasks / epic children).
    pub parent_id: Option<String>,
    pub sprint_id: Option<String>,
    pub milestone_id: Option<String>,
    pub labels: Vec<String>,
    /// Story points or effort estimate.
    pub estimate: Option<f64>,
    pub dependencies: Vec<Dependency>,
    pub comments: Vec<Comment>,
    pub time_logs: Vec<TimeLog>,
    pub due_date: Option<NaiveDate>,
    pub created_at: DateTime<Utc>,
    pub updated_at: DateTime<Utc>,
    pub completed_at: Option<DateTime<Utc>>,
}

/// A sprint / iteration.
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct Sprint {
    pub id: String,
    pub project_id: String,
    pub name: String,
    pub goal: Option<String>,
    pub status: SprintStatus,
    pub start_date: Option<NaiveDate>,
    pub end_date: Option<NaiveDate>,
    pub created_at: DateTime<Utc>,
}

/// A milestone.
#[derive(Debug, Clone, Serialize, Deserialize, schemars::JsonSchema)]
pub struct Milestone {
    pub id: String,
    pub project_id: String,
    pub name: String,
    pub description: String,
    pub status: MilestoneStatus,
    pub due_date: Option<NaiveDate>,
    pub created_at: DateTime<Utc>,
}