Spec Workflow MCP API参考手册开发者必备的完整接口文档【免费下载链接】spec-workflow-mcpA Model Context Protocol (MCP) server that provides structured spec-driven development workflow tools for AI-assisted software development, featuring a real-time web dashboard and VSCode extension for monitoring and managing your projects progress directly in your development environment.项目地址: https://gitcode.com/gh_mirrors/sp/spec-workflow-mcpSpec Workflow MCP是一个强大的模型上下文协议服务器为AI辅助软件开发提供结构化规范驱动的工作流工具。本API参考手册为您详细介绍所有可用的MCP工具接口、参数说明和使用示例帮助您充分利用这个强大的开发框架。 核心功能概述Spec Workflow MCP提供了一套完整的API工具集支持从需求分析到代码实现的完整开发流程。通过MCP协议AI助手可以与开发工作流无缝集成实现规范的创建、审批、跟踪和管理。核心关键词Spec Workflow MCP API、规范驱动开发、AI辅助开发、MCP工具接口、工作流自动化主要特性结构化开发工作流需求→设计→任务→实现的完整流程实时Web仪表板监控规范、任务和进度VSCode扩展集成在IDE中直接管理工作流审批工作流完整的文档审批流程和修订管理任务进度跟踪可视化进度条和详细状态多语言支持支持11种语言界面 API工具分类工作流指导工具这些工具提供工作流程指导文档帮助AI助手理解开发流程spec-workflow-guide- 规范工作流指南用途加载完整的规范驱动开发工作流说明参数无返回示例{ success: true, message: Complete spec workflow guide loaded - follow this workflow exactly, data: { guide: # Spec Development Workflow..., dashboardUrl: http://localhost:5000, dashboardAvailable: true }, nextSteps: [ Follow sequence: Requirements → Design → Tasks → Implementation, Load templates with get-template-context first, Request approval after each document ] }steering-guide- 项目指导文档指南用途加载创建项目指导文档的说明参数无返回示例{ success: true, message: Steering guide loaded successfully, data: { guide: # Steering Documents Guide..., dashboardUrl: http://localhost:5000 } }内容创建工具这些工具用于创建和管理规范文档create-spec-doc- 创建规范文档用途创建或更新规范文档需求、设计、任务参数 | 参数 | 类型 | 必需 | 描述 | |------|------|------|------| | specName | string | 是 | 规范名称kebab-case格式 | | docType | string | 是 | 文档类型requirements、design或tasks | | content | string | 是 | 文档的Markdown内容 | | revision | boolean | 否 | 是否为修订版默认false |使用示例{ specName: user-authentication, docType: requirements, content: # User Authentication Requirements\n\n## Overview\n..., revision: false }create-steering-doc- 创建项目指导文档用途创建项目指导文档产品、技术、结构参数 | 参数 | 类型 | 必需 | 描述 | |------|------|------|------| | docType | string | 是 | 文档类型product、tech或structure | | content | string | 是 | 文档的Markdown内容 |使用示例{ docType: product, content: # Product Steering\n\n## Vision\nBuild the best... }上下文获取工具这些工具用于检索现有项目信息和模板get-template-context- 获取模板内容用途检索所有文档类型的Markdown模板参数无返回结构{ requirements: # Requirements Template\n\n## Overview\n..., design: # Design Template\n\n## Architecture\n..., tasks: # Tasks Template\n\n## Implementation Tasks\n..., product: # Product Steering Template\n..., tech: # Technical Steering Template\n..., structure: # Structure Steering Template\n... }get-steering-context- 获取项目指导上下文用途检索项目指导文档和指南参数 | 参数 | 类型 | 必需 | 描述 | |------|------|------|------| | docType | string | 否 | 特定文档product、tech、structure或all |使用示例{ docType: tech // 仅返回技术指导 }get-spec-context- 获取规范上下文用途检索特定规范的完整上下文参数 | 参数 | 类型 | 必需 | 描述 | |------|------|------|------| | specName | string | 是 | 规范名称 | | includeContent | boolean | 否 | 是否包含文档内容默认true |返回结构{ name: user-authentication, exists: true, documents: { requirements: { exists: true, content: # Requirements\n\n..., approved: true }, design: { exists: true, content: # Design\n\n..., approved: false }, tasks: { exists: true, content: # Tasks\n\n..., stats: { total: 15, completed: 7, progress: 45 } } }, relatedSpecs: [user-profile, session-management], dependencies: [database-setup, auth-library] }状态管理工具这些工具用于跟踪和管理规范状态spec-list- 列出所有规范用途列出所有规范及其当前状态参数无返回示例[ { name: user-authentication, status: in-progress, progress: 45, documents: { requirements: approved, design: pending-approval, tasks: not-created }, taskStats: { total: 15, completed: 7, inProgress: 1, pending: 7 } } ]spec-status- 获取规范状态用途获取特定规范的详细状态信息参数 | 参数 | 类型 | 必需 | 描述 | |------|------|------|------| | specName | string | 是 | 要检查的规范名称 |返回结构{ exists: true, name: user-authentication, documents: { requirements: { exists: true, approved: true, lastModified: 2024-01-15T10:30:00Z, size: 4523 }, design: { exists: true, approved: false, pendingApproval: true, lastModified: 2024-01-15T14:20:00Z, size: 6234 }, tasks: { exists: true, taskCount: 15, completedCount: 7, inProgressCount: 1, progress: 45 } }, overallProgress: 45, currentPhase: implementation }manage-tasks- 管理任务用途全面的任务管理包括更新、状态更改和进度跟踪参数 | 参数 | 类型 | 必需 | 描述 | |------|------|------|------| | specName | string | 是 | 规范名称 | | action | string | 是 | 操作update、complete、list、progress | | taskId | string | 有时 | 任务ID更新/完成时需要 | | status | string | 否 | 新状态pending、in-progress、completed | | notes | string | 否 | 任务的附加说明 |操作示例更新任务状态{ specName: user-auth, action: update, taskId: 1.2.1, status: in-progress, notes: Started implementation }完成任务{ specName: user-auth, action: complete, taskId: 1.2.1 }审批系统工具这些工具管理文档审批工作流request-approval- 请求审批用途为用户请求文档审批参数 | 参数 | 类型 | 必需 | 描述 | |------|------|------|------| | specName | string | 是 | 规范名称 | | docType | string | 是 | 要审批的文档类型 | | documentId | string | 是 | 用于跟踪的唯一ID | | content | string | 是 | 用于审查的文档内容 |使用示例{ specName: user-auth, docType: requirements, documentId: user-auth-req-v1, content: # Requirements\n\n... }get-approval-status- 获取审批状态用途检查文档的审批状态参数 | 参数 | 类型 | 必需 | 描述 | |------|------|------|------| | specName | string | 是 | 规范名称 | | documentId | string | 是 | 要检查的文档ID |返回示例{ exists: true, status: pending, feedback: Please add more detail about error handling, timestamp: 2024-01-15T10:30:00Z, reviewer: user }delete-approval- 删除审批用途删除已完成、被拒绝或需要修订的审批请求以清理审批队列。无法删除待处理的审批。参数 | 参数 | 类型 | 必需 | 描述 | |------|------|------|------| | specName | string | 是 | 规范名称 | | documentId | string | 是 | 要删除的文档ID |使用示例{ specName: user-auth, documentId: user-auth-req-v1 } 工作流执行模式启动新规范1. spec-workflow-guide() // 获取工作流指南 2. get-steering-context(projectPath) // 可选获取项目指导 3. get-template-context(projectPath, spec, requirements) // 获取模板 4. create-spec-doc(projectPath, specName, requirements, content) // 创建需求文档 5. request-approval(projectPath, title, filePath, document, spec, specName) // 请求审批 6. get-approval-status(projectPath, approvalId) // 轮询直到批准 7. delete-approval(projectPath, approvalId) // 清理审批 8. // 为设计、任务重复步骤3-7实施任务1. get-spec-context(projectPath, specName) // 获取规范上下文 2. manage-tasks(projectPath, specName, next-pending) // 获取下一个待处理任务 3. manage-tasks(projectPath, specName, set-status, taskId, in-progress) // 开始任务 4. // 编写和测试代码 5. manage-tasks(projectPath, specName, set-status, taskId, completed) // 完成任务 6. // 重复下一个任务 最佳实践工具选择策略信息收集使用spec-list获取概览使用spec-status获取特定规范状态使用get-spec-context进行实施文档创建始终先创建需求文档设计前等待审批设计批准后创建任务任务管理开始任务时更新状态完成后立即标记完成使用说明记录重要上下文性能考虑批量操作在一次对话中请求多个规范缓存工具缓存文件读取以提高性能选择性加载使用includeContent: false进行更快的状态检查安全性路径验证所有路径都经过验证和清理项目隔离工具仅访问项目目录输入清理Markdown内容经过清理无执行工具从不执行代码 错误处理所有工具返回一致的错误结构{ success: false, error: Spec not found, details: No spec named invalid-spec exists, suggestion: Use spec-list to see available specs } 快速开始示例创建用户认证规范// 1. 获取工作流指南 const guide await specWorkflowGuide(); // 2. 创建需求文档 const requirements await createSpecDoc({ specName: user-authentication, docType: requirements, content: # User Authentication Requirements\n\n## Functional Requirements\n- User registration\n- Login/logout\n- Password reset }); // 3. 请求审批 const approval await requestApproval({ specName: user-authentication, docType: requirements, documentId: user-auth-req-v1, content: requirements.content }); // 4. 检查审批状态 let status await getApprovalStatus({ specName: user-authentication, documentId: user-auth-req-v1 }); // 5. 审批通过后创建设计文档 if (status.status approved) { const design await createSpecDoc({ specName: user-authentication, docType: design, content: # Design Document\n\n## Architecture\n- REST API endpoints\n- Database schema\n- Authentication flow }); } 项目文件结构.spec-workflow/ ├── templates/ # 自动填充的模板 │ ├── requirements-template.md │ ├── design-template.md │ ├── tasks-template.md │ ├── product-template.md │ ├── tech-template.md │ └── structure-template.md ├── specs/ │ └── {spec-name}/ │ ├── requirements.md │ ├── design.md │ ├── tasks.md │ └── Implementation Logs/ # 自动创建 │ ├── task-1_timestamp_id.md │ ├── task-2_timestamp_id.md │ └── ... └── steering/ ├── product.md ├── tech.md └── structure.md 相关资源官方文档docs/technical-documentation/工具实现源码src/tools/工作流指南src/tools/spec-workflow-guide.ts审批系统src/tools/approvals.ts状态管理src/tools/spec-status.ts通过本API参考手册您可以充分利用Spec Workflow MCP的所有功能实现高效的AI辅助软件开发工作流。无论是创建新规范、管理任务进度还是处理文档审批这些工具都提供了完整的接口支持。【免费下载链接】spec-workflow-mcpA Model Context Protocol (MCP) server that provides structured spec-driven development workflow tools for AI-assisted software development, featuring a real-time web dashboard and VSCode extension for monitoring and managing your projects progress directly in your development environment.项目地址: https://gitcode.com/gh_mirrors/sp/spec-workflow-mcp创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考