Upgrade to 0.1.4 MCP

This commit is contained in:
yinwm
2025-07-18 14:17:38 +08:00
parent 74d9492305
commit 1747757ede
12 changed files with 114 additions and 1010 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "vibedev-specs-mcp",
"version": "0.1.1",
"version": "0.1.4",
"description": "MCP server for vibedev specs workflow - AI-powered development workflow from requirements to code",
"main": "dist/index.js",
"type": "module",
@@ -36,7 +36,7 @@
"url": "https://github.com/yinwm/vibedev-specs-mcp/issues"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.0.0",
"@modelcontextprotocol/sdk": "1.0.0",
"nanoid": "^5.0.7"
},
"devDependencies": {

View File

@@ -28,7 +28,7 @@ export function createServer() {
const tools = [
{
name: 'vibedev_specs_workflow_start',
description: '启动 specs 工作流,开始目标收集阶段',
description: 'Start the specs workflow and begin the goal collection phase',
inputSchema: {
type: 'object',
properties: {},
@@ -37,21 +37,21 @@ export function createServer() {
},
{
name: 'vibedev_specs_goal_confirmed',
description: '确认功能目标完成,设置 feature_name推进到需求收集阶段',
description: 'Confirm the completion of the feature goal, set the feature_name, and proceed to the requirements collection phase',
inputSchema: {
type: 'object',
properties: {
session_id: {
type: 'string',
description: '会话标识符'
description: 'Session identifier'
},
feature_name: {
type: 'string',
description: '基于目标生成的功能名称(如 user-auth'
description: 'Feature name generated based on the goal (e.g., user-auth)'
},
goal_summary: {
type: 'string',
description: '功能目标的简要描述'
description: 'Brief description of the feature goal'
}
},
required: ['session_id', 'feature_name', 'goal_summary']
@@ -59,17 +59,17 @@ export function createServer() {
},
{
name: 'vibedev_specs_requirements_start',
description: '开始需求收集阶段,提供需求收集的指导',
description: 'Start the requirements collection phase and provide guidance for requirements gathering',
inputSchema: {
type: 'object',
properties: {
session_id: {
type: 'string',
description: '会话标识符'
description: 'Session identifier'
},
feature_name: {
type: 'string',
description: '功能名称'
description: 'Feature name'
}
},
required: ['session_id', 'feature_name']
@@ -77,17 +77,17 @@ export function createServer() {
},
{
name: 'vibedev_specs_requirements_confirmed',
description: '确认需求收集完成,推进到设计阶段',
description: 'Confirm the completion of requirements collection and proceed to the design phase',
inputSchema: {
type: 'object',
properties: {
session_id: {
type: 'string',
description: '会话标识符'
description: 'Session identifier'
},
feature_name: {
type: 'string',
description: '功能名称'
description: 'Feature name'
}
},
required: ['session_id', 'feature_name']
@@ -95,17 +95,17 @@ export function createServer() {
},
{
name: 'vibedev_specs_design_start',
description: '开始设计文档阶段,提供设计文档创建的指导',
description: 'Start the design documentation phase and provide guidance for creating design documents',
inputSchema: {
type: 'object',
properties: {
session_id: {
type: 'string',
description: '会话标识符'
description: 'Session identifier'
},
feature_name: {
type: 'string',
description: '功能名称'
description: 'Feature name'
}
},
required: ['session_id', 'feature_name']
@@ -113,17 +113,17 @@ export function createServer() {
},
{
name: 'vibedev_specs_design_confirmed',
description: '确认设计文档完成,推进到任务规划阶段',
description: 'Confirm the completion of the design document and proceed to the task planning phase',
inputSchema: {
type: 'object',
properties: {
session_id: {
type: 'string',
description: '会话标识符'
description: 'Session identifier'
},
feature_name: {
type: 'string',
description: '功能名称'
description: 'Feature name'
}
},
required: ['session_id', 'feature_name']
@@ -131,17 +131,17 @@ export function createServer() {
},
{
name: 'vibedev_specs_tasks_start',
description: '开始任务规划阶段,提供任务列表创建的指导',
description: 'Start the task planning phase and provide guidance for creating the task list',
inputSchema: {
type: 'object',
properties: {
session_id: {
type: 'string',
description: '会话标识符'
description: 'Session identifier'
},
feature_name: {
type: 'string',
description: '功能名称'
description: 'Feature name'
}
},
required: ['session_id', 'feature_name']
@@ -149,17 +149,17 @@ export function createServer() {
},
{
name: 'vibedev_specs_tasks_confirmed',
description: '确认任务规划完成,推进到执行阶段',
description: 'Confirm the completion of task planning and proceed to the execution phase',
inputSchema: {
type: 'object',
properties: {
session_id: {
type: 'string',
description: '会话标识符'
description: 'Session identifier'
},
feature_name: {
type: 'string',
description: '功能名称'
description: 'Feature name'
}
},
required: ['session_id', 'feature_name']
@@ -167,21 +167,21 @@ export function createServer() {
},
{
name: 'vibedev_specs_execute_start',
description: '开始任务执行阶段,提供任务执行的指导',
description: 'Start the task execution phase and provide guidance for task execution',
inputSchema: {
type: 'object',
properties: {
session_id: {
type: 'string',
description: '会话标识符'
description: 'Session identifier'
},
feature_name: {
type: 'string',
description: '功能名称'
description: 'Feature name'
},
task_id: {
type: 'string',
description: '可选指定要执行的任务ID不指定则执行下一个未完成任务'
description: 'Optional: Specify the task ID to execute; if not specified, the next unfinished task will be executed'
}
},
required: ['session_id', 'feature_name']
@@ -189,13 +189,13 @@ export function createServer() {
}
];
// Register tools list handler
// Register the handler for listing tools
server.setRequestHandler(ListToolsRequestSchema, async () => {
console.error('[MCP] Handling list tools request');
return { tools };
});
// Register tool call handler
// Register the handler for tool calls
server.setRequestHandler(CallToolRequestSchema, async (request) => {
const { name, arguments: args } = request.params;
console.error(`[MCP] Handling tool call: ${name}`, args);

View File

@@ -11,7 +11,7 @@ export async function designStart(
const { session_id, feature_name } = params;
console.error(`[MCP] Starting design phase for feature: ${feature_name}`);
// 使用 gen-design.md 模板
// Use gen-design.md template
const template = await readTemplate('gen-design.md', {
feature_name,
session_id

View File

@@ -9,29 +9,29 @@ export async function designConfirmed(
const { session_id, feature_name } = params;
console.error(`[MCP] Design confirmed for feature: ${feature_name}`);
return `# ✅ 设计文档完成
return `# ✅ Design Document Completed
## 已生成设计文档:
📄 \`.vibedev/specs/${feature_name}/design.md\`
## Generated Design Document:
📄 ".vibedev/specs/${feature_name}/design.md"
设计文档包含了完整的技术架构、组件设计和实现方案。
The design document contains the complete technical architecture, component design, and implementation plan.
---
## 下一阶段:任务规划 (4/5)
## Next Stage: Task Planning (4/5)
### 工作流进度:
- [x] 1. 目标收集
- [x] 2. 需求收集
- [x] 3. **设计文档** ✅
- [ ] 4. **任务规划** ← 下一阶段
- [ ] 5. 任务执行
### Workflow Progress:
- [x] 1. Goal Collection
- [x] 2. Requirements Gathering
- [x] 3. **Design Document** ✅
- [ ] 4. **Task Planning** ← Next Stage
- [ ] 5. Task Execution
现在请调用 \`vibedev_specs_tasks_start\` 开始任务规划阶段。
Now please call \`vibedev_specs_tasks_start\` to begin the task planning stage.
**会话信息**
**Session Information**:
- Session ID: \`${session_id}\`
- Feature Name: \`${feature_name}\`
- Requirements: ✅ 已完成
- Design: ✅ 已完成`;
- Requirements: ✅ Completed
- Design: ✅ Completed`;
}

View File

@@ -11,7 +11,7 @@ export async function requirementsStart(
const { session_id, feature_name } = params;
console.error(`[MCP] Starting requirements collection for feature: ${feature_name}`);
// 使用 gen-req.md 模板
// Use gen-req.md template
const template = await readTemplate('gen-req.md', {
feature_name,
session_id

View File

@@ -9,28 +9,28 @@ export async function requirementsConfirmed(
const { session_id, feature_name } = params;
console.error(`[MCP] Requirements confirmed for feature: ${feature_name}`);
return `# ✅ 需求收集完成
return `# ✅ Requirements Gathering Completed
## 已生成需求文档:
📄 \`.vibedev/specs/${feature_name}/requirements.md\`
## Generated Requirements Document:
📄 ".vibedev/specs/${feature_name}/requirements.md"
需求文档包含了完整的用户故事和EARS格式的验收标准。
The requirements document contains complete user stories and EARS-format acceptance criteria.
---
## 下一阶段:设计文档 (3/5)
## Next Stage: Design Document (3/5)
### 工作流进度:
- [x] 1. 目标收集
- [x] 2. **需求收集** ✅
- [ ] 3. **设计文档** ← 下一阶段
- [ ] 4. 任务规划
- [ ] 5. 任务执行
### Workflow Progress:
- [x] 1. Goal Collection
- [x] 2. **Requirements Gathering** ✅
- [ ] 3. **Design Document** ← Next Stage
- [ ] 4. Task Planning
- [ ] 5. Task Execution
现在请调用 \`vibedev_specs_design_start\` 开始技术设计阶段。
Now please call \`vibedev_specs_design_start\` to begin the technical design stage.
**会话信息**
**Session Information**:
- Session ID: \`${session_id}\`
- Feature Name: \`${feature_name}\`
- Requirements: ✅ 已完成`;
- Requirements: ✅ Completed`;
}

View File

@@ -11,7 +11,7 @@ export async function tasksStart(
const { session_id, feature_name } = params;
console.error(`[MCP] Starting tasks planning for feature: ${feature_name}`);
// 使用 gen-tasks.md 模板
// Use gen-tasks.md template
const template = await readTemplate('gen-tasks.md', {
feature_name,
session_id

View File

@@ -9,30 +9,30 @@ export async function tasksConfirmed(
const { session_id, feature_name } = params;
console.error(`[MCP] Tasks confirmed for feature: ${feature_name}`);
return `# ✅ 任务规划完成
return `# ✅ Task Planning Completed
## 已生成任务文档:
📄 \`.vibedev/specs/${feature_name}/tasks.md\`
## Generated Tasks Document:
📄 ".vibedev/specs/${feature_name}/tasks.md"
任务文档包含了详细的开发任务列表,每个任务都有明确的描述、验收标准和执行顺序。
The tasks document contains a detailed list of development tasks, each with clear descriptions, acceptance criteria, and execution order.
---
## 下一阶段:任务执行 (5/5)
## Next Stage: Task Execution (5/5)
### 工作流进度:
- [x] 1. 目标收集
- [x] 2. 需求收集
- [x] 3. 设计文档
- [x] 4. **任务规划** ✅
- [ ] 5. **任务执行** ← 最终阶段
### Workflow Progress:
- [x] 1. Goal Collection
- [x] 2. Requirements Gathering
- [x] 3. Design Document
- [x] 4. **Task Planning** ✅
- [ ] 5. **Task Execution** ← Final Stage
现在请调用 \`vibedev_specs_execute_start\` 开始任务执行阶段。
Now please call \`vibedev_specs_execute_start\` to begin the task execution stage.
**会话信息**
**Session Information**:
- Session ID: \`${session_id}\`
- Feature Name: \`${feature_name}\`
- Requirements: ✅ 已完成
- Design: ✅ 已完成
- Tasks: ✅ 已完成`;
- Requirements: ✅ Completed
- Design: ✅ Completed
- Tasks: ✅ Completed`;
}

View File

@@ -7,7 +7,7 @@ export async function workflowStart(): Promise<string> {
const session_id = generateSessionId();
console.error(`[MCP] Starting workflow with session_id: ${session_id}`);
// 使用 ask-goal.md 模板
// Use ask-goal.md template
const template = await readTemplate('ask-goal.md', {
session_id
});

View File

@@ -8,15 +8,15 @@ export async function readTemplate(
templateName: string,
variables: Record<string, string> = {}
): Promise<string> {
// src/utils 向上两级到项目根目录,然后进入 templates
// From src/utils go up two levels to the project root, then enter templates
const templatePath = join(__dirname, '../../templates', templateName);
console.error(`[MCP] Reading template: ${templatePath}`);
let content = await readFile(templatePath, 'utf-8');
// 替换变量
// Replace variables
Object.entries(variables).forEach(([key, value]) => {
const regex = new RegExp(`\\{${key}\\}`, 'g');
const regex = new RegExp(`\{${key}\}`, 'g');
content = content.replace(regex, value);
});

View File

@@ -1,4 +1,4 @@
// 工作流步骤定义
// Workflow step definitions
export interface WorkflowStep {
step_number: number;
name: string;
@@ -9,60 +9,60 @@ export interface WorkflowStep {
export interface WorkflowOverview {
total_steps: number;
current_step: string; // 改为步骤名称
current_step_number: number; // 保留数字用于进度显示
current_step: string; // Change to step name
current_step_number: number; // Keep number for progress display
steps: WorkflowStep[];
}
// 步骤名称常量
// Step name constants
export const STEP_NAMES = {
GOAL_CONFIRMATION: '目标确认',
REQUIREMENTS: '需求收集',
DESIGN: '设计文档',
TASKS: '任务规划',
EXECUTION: '任务执行'
GOAL_CONFIRMATION: 'Goal Confirmation',
REQUIREMENTS: 'Requirements Gathering',
DESIGN: 'Design Documentation',
TASKS: 'Task Planning',
EXECUTION: 'Task Execution'
} as const;
// 工作流步骤常量
// Workflow step constants
export const WORKFLOW_STEPS: WorkflowStep[] = [
{
step_number: 1,
name: STEP_NAMES.GOAL_CONFIRMATION,
description: '通过对话明确功能开发目标',
description: 'Clarify the feature development goal through conversation',
tool: 'vibedev_specs_workflow_start → vibedev_specs_goal_confirmed',
deliverable: '明确的功能目标和 feature_name'
deliverable: 'Clear feature goal and feature_name'
},
{
step_number: 2,
name: STEP_NAMES.REQUIREMENTS,
description: '生成 EARS 格式的需求文档',
description: 'Generate requirements document in EARS format',
tool: 'vibedev_specs_requirements_start → vibedev_specs_requirements_confirmed',
deliverable: '.vibedev/specs/{feature_name}/requirements.md'
},
{
step_number: 3,
name: STEP_NAMES.DESIGN,
description: '基于需求创建技术设计文档',
description: 'Create technical design document based on requirements',
tool: 'vibedev_specs_design_start → vibedev_specs_design_confirmed',
deliverable: '.vibedev/specs/{feature_name}/design.md'
},
{
step_number: 4,
name: STEP_NAMES.TASKS,
description: '生成可执行的开发任务列表',
description: 'Generate executable development task list',
tool: 'vibedev_specs_tasks_start → vibedev_specs_tasks_confirmed',
deliverable: '.vibedev/specs/{feature_name}/tasks.md'
},
{
step_number: 5,
name: STEP_NAMES.EXECUTION,
description: '逐个执行开发任务',
description: 'Execute development tasks one by one',
tool: 'vibedev_specs_execute_start',
deliverable: '实际的代码实现'
deliverable: 'Actual code implementation'
}
];
// 获取工作流概览的辅助函数
// Get workflow overview helper function
export function getWorkflowOverview(currentStepName: string): WorkflowOverview {
const currentStep = WORKFLOW_STEPS.find(step => step.name === currentStepName);
const stepNumber = currentStep?.step_number || 1;