一个实现基于LLM编码的结构化开发流程的Model Context Protocol服务器。
此MCP服务器通过提供以下功能帮助LLMs以组织化、清晰且安全的方式构建功能:
start_feature_clarification - 开始特性澄清过程provide_clarification - 回答关于特性的澄清问题generate_prd - 生成产品需求文档和实施计划create_phase - 为特性创建开发阶段add_task - 向开发阶段添加任务update_phase_status - 更新阶段的状态update_task_status - 更新任务的完成状态get_next_phase_action - 获取下一步操作指导get_document_path - 获取生成文档的路径save_document - 将文档保存到特定位置feature-planning - 规划特性开发的提示模板该服务器包括一个混合文档存储系统,它:
文档默认存储在 documents/{featureId}/ 目录下,文件名基于文档类型:
documents/{featureId}/prd.md - 产品需求文档documents/{featureId}/implementation-plan.md - 实施计划您可以使用 save_document 工具将文档保存到自定义位置:
{
"featureId": "feature-123",
"documentType": "prd",
"filePath": "/custom/path/feature-123-prd.md"
}
要获取文档的路径,请使用 get_document_path 工具:
{
"featureId": "feature-123",
"documentType": "prd"
}
这将返回路径以及文档是否已保存到磁盘的信息。
安装依赖项:
npm install
构建服务器:
npm run build
开发时自动重建:
npm run watch
与兼容的MCP客户端一起使用:
在MacOS上:~/Library/Application Support/Claude/claude_desktop_config.json
在Windows上:%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"vibe-coder-mcp": {
"command": "/path/to/vibe-coder-mcp/build/mcp-server.js"
}
}
}
由于MCP服务器通过标准I/O进行通信,调试可能具有挑战性。我们建议使用MCP Inspector,这是一个可用的包脚本:
npm run inspector
Inspector将提供一个URL,您可以在浏览器中访问调试工具。
此服务器使用来自Model Context Protocol TypeScript SDK的高级 McpServer 类实现,简化了创建MCP服务器的过程,提供了定义资源、工具和提示的干净API。
import { McpServer, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
// 创建一个MCP服务器
const server = new McpServer({
name: "Vibe-Coder",
version: "0.3.0"
});
// 添加一个资源
server.resource(
"features-list",
"features://list",
async (uri) => ({ /* ... */ })
);
// 添加一个工具
server.tool(
"start_feature_clarification",
{ /* 参数模式 */ },
async (params) => ({ /* ... */ })
);
// 添加一个提示
server.prompt(
"feature-planning",
{ /* 参数模式 */ },
(params) => ({ /* ... */ })
);
// 启动服务器
const transport = new StdioServerTransport();
await server.connect(transport);
Vibe-Coder MCP服务器旨在通过以下步骤引导开发过程: