用户故事目标管理服务器

Story-Goal MCP服务器是一个轻量级工具,用于跟踪用户故事和目标进度,强调结果导向而非任务完成,适用于敏捷开发和团队协作。

  • by Unity-Environmental-University
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 Unity-Environmental-University/story-goal-mcp

使用说明

故事目标MCP服务器

LXD MCP套件的一部分——一组用于学习体验设计(指导、看板、故事和可选的LLM适配器)的MCP服务器。

它是什么

故事/目标MCP服务器,跟踪结果(目标)和用户故事,包括阶段和进度说明。

为什么它有帮助

持续关注可交付成果和随时间推移的进展;补充了看板的计划和执行。

一个轻量级的MCP服务器,用以结果为中心的用户故事和目标取代以任务为中心的待办事项列表。跟踪用户价值的有意义进展,而不仅仅是检查任务。

🎯 哲学

而不是: “编写身份验证测试”
思考: “作为用户,我可以安全登录,从而保护我的数据”

故事具有完整的背景,并与更大的目标联系在一起,使发展更加有目的和以结果为导向。

🚀 快速开始

安装

git clone <this-repo>
cd story-goal-mcp

没有依赖关系!使用Python内置的SQLite。

基本用法

# 1. Register as a user (creates isolated workspace)
python3 story_goal_mcp.py handshake your-username "Your Name"

# 2. Create a goal (high-level outcome)
python3 story_goal_mcp.py create-goal your-username \
  "Build User Authentication" \
  "Secure user login/logout with session management" \
  "Users can safely access protected features"

# 3. Create stories toward that goal
python3 story_goal_mcp.py create-story your-username \
  "Secure Login Form" \
  "As a user" \
  "I want to log in with email/password" \
  "So that I can access my personal data"

# 4. View your progress
python3 story_goal_mcp.py list-goals your-username
python3 story_goal_mcp.py list-stories your-username

安装(本地PATH)

bash scripts/install_local.sh
export PATH="$HOME/.local/bin:$PATH"   # add to shell profile for persistence

# Start MCP server from anywhere
story-goal-mcp

登录时运行

macOS(launchd):

bash scripts/install_service_macos.sh
# Logs:
tail -f "$HOME/Library/Logs/story-goal-mcp.out" "$HOME/Library/Logs/story-goal-mcp.err"

Linux(systemd用户):

bash scripts/install_service_systemd.sh
systemctl --user status story-goal-mcp.service
journalctl --user -u story-goal-mcp.service -f

📋 命令

用户管理

# Register/check user state
python3 story_goal_mcp.py handshake <user_key> [name]

目标管理

# Create a goal
python3 story_goal_mcp.py create-goal <user_key> <title> <vision> [success_metrics]

# List all goals with story counts
python3 story_goal_mcp.py list-goals <user_key>

故事管理

# Create a story
python3 story_goal_mcp.py create-story <user_key> <title> <as_a> <i_want> <so_that> [goal_id]

# List stories (all, by goal, or by phase)
python3 story_goal_mcp.py list-stories <user_key> [goal_id] [phase]

# Update story progress (TODO: implement)
python3 story_goal_mcp.py update-story <user_key> <story_id> <phase> <notes>

🏗️ 数据结构

目标

{
  "id": "c420c3ad",
  "title": "Build User Authentication",
  "vision": "Secure login system with session management",
  "success_metrics": "Users can safely access protected features",
  "total_stories": 3,
  "completed_stories": 1,
  "created_at": "2025-09-08T19:18:20.682533"
}

用户故事

{
  "id": "33bbaf8b",
  "title": "Secure Login Form",
  "as_a": "As a user",
  "i_want": "I want to log in with email/password",
  "so_that": "So that I can access my personal data",
  "current_phase": "defining",
  "acceptance_criteria": ["Form validates email format", "Password is hashed"],
  "progress_notes": [
    {
      "timestamp": "2025-09-08T19:20:15.123456",
      "phase": "developing",
      "notes": "Started implementing form validation"
    }
  ],
  "goal_id": "c420c3ad"
}

📈 故事阶段

  1. 定义 -编写验收标准,了解要求
  2. 开发中 -构建、编码、实施
  3. 验证 -测试、审查、获取反馈
  4. 完成 -故事为用户带来价值

🔒 用户分离

每个用户都会获得完全隔离的数据:

# User A's workspace
python3 story_goal_mcp.py handshake alice "Alice Smith"
python3 story_goal_mcp.py create-goal alice "Build Chat App" "..."

# User B's workspace (completely separate)  
python3 story_goal_mcp.py handshake bob "Bob Jones"
python3 story_goal_mcp.py create-goal bob "E-commerce Site" "..."

数据存储在SQLite中,用户密钥分离,确保隐私。

💡 使用模式

1.冲刺计划

# Create goal for the sprint
python3 story_goal_mcp.py create-goal alice \
  "Sprint 1: Core Features" \
  "MVP with essential user flows working" \
  "Users can complete primary workflows"

# Break into stories
python3 story_goal_mcp.py create-story alice \
  "User Registration" "As a new user" "I want to create account" "So that I can use the app"

python3 story_goal_mcp.py create-story alice \
  "Dashboard View" "As a user" "I want to see my data" "So that I can track progress"

2.功能开发

# Create focused goal
python3 story_goal_mcp.py create-goal dev123 \
  "Search Functionality" \
  "Fast, accurate search across all content" \
  "Users find what they need in <2 seconds"

# Multiple stories toward same goal
python3 story_goal_mcp.py create-story dev123 \
  "Search API" "As a developer" "I want search endpoint" "So that frontend can query data"

python3 story_goal_mcp.py create-story dev123 \
  "Search UI" "As a user" "I want search box" "So that I can find content quickly"

3.Bug修复作为故事

python3 story_goal_mcp.py create-story dev123 \
  "Fix Login Redirect" \
  "As a user" \
  "I want to go to intended page after login" \
  "So that my workflow isn't interrupted"

🆚 vs TodoWrite

TodoWrite 故事目标MCP
“修复登录错误” “作为用户,我希望登录能够正确重定向,这样我的工作流程就不会中断”
以任务为中心 以结果为中心
无上下文 完整的用户故事上下文
单用户 多用户隔离
没有目标 故事总是有目标的
二进制完成/未完成 阶段:定义→ 发展→ 验证→ 完成

🔌 MCP协议集成

故事目标MCP现在支持 本地MCP协议 克劳德代码集成!

用作MCP服务器

# Start MCP server (communicates via JSON-RPC)
python3 mcp_server.py

# Or use CLI version directly
python3 story_goal_mcp.py handshake your-user "Your Name"

可用的MCP工具

  • story_goal_handshake -注册/验证用户工作区
  • create_goal -制定以结果为中心的目标
  • create_story -创建具有完整上下文的用户故事
  • update_story_progress -用笔记更新故事阶段
  • list_goals -查看带有进度指标的目标
  • list_stories -查看故事(全部/按目标/阶段筛选)
  • get_story_details -具有目标背景的详细故事视图

测试MCP集成

# Run comprehensive protocol test
python3 test_mcp_protocol.py

# Expected: All tests pass, ready for Claude integration

🔮 未来功能

  • [x] 自动将故事链接到目标✅ 完成
  • [x] 进度更新及备注✅ 完成
  • []故事依赖关系
  • []每个阶段的时间跟踪
  • [x] MCP协议集成✅ 完成
  • []Web界面
  • []故事模板
  • []验收标准管理
  • []故事估计/速度

🛠️ 发展

服务器是一个没有外部依赖关系的Python文件。使用SQLite进行持久化。

数据库模式

  • users -用户注册和元数据
  • goals -用户希望实现的高层次成果
  • stories -具有完整上下文和进度跟踪的用户故事

添加功能

该代码设计得简单且可扩展。关键方法:

  • handshake() -用户注册/状态
  • create_goal() -目标管理
  • create_story() -故事创作
  • update_story_progress() -进度跟踪
  • get_user_*() -查询用户数据

📄 许可证

MIT许可证-可自由用于任何目的。


构建重要的软件。跟踪结果,而不仅仅是任务。

仅供内部使用-未获得外部分发或托管许可。