{"_id":"@buouui/supaui-mcp","_rev":"3-6676450853f23c72b44f48e0ae883af5","name":"@buouui/supaui-mcp","dist-tags":{"latest":"0.0.2"},"versions":{"1.0.0":{"name":"@buouui/supaui-mcp","version":"1.0.0","author":{"name":"support@buouui.com"},"license":"ISC","_id":"@buouui/supaui-mcp@1.0.0","maintainers":[{"name":"kroulzhang","email":"769329489@qq.com"}],"dist":{"shasum":"05e9125fae3b687a2640bd6ea8c656c2b8bf896a","tarball":"https://registry.npmjs.org/@buouui/supaui-mcp/-/supaui-mcp-1.0.0.tgz","fileCount":17,"integrity":"sha512-HuzSWczw6R79Lvj4D7vweTHSCJ36XVBZKt8zxnFYfd2dyGJlxWZL9lq1c0Tc8uZAWaCXYC/FJFJ11UsrpBUy2A==","signatures":[{"sig":"MEUCIGXcS/1UspYT91BoqSvq9iDYbERowShYC2A1xajTbSoLAiEAkansyOiFWtF+UCet2Q+As0MF/k8ApHc7xBEVJ0+UORc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22120},"main":"dist/index.js","gitHead":"67ef4fc3ec048204941721933fbbfc2dae3920d4","scripts":{"build":"tsc","start":"node dist/index.js"},"_npmUser":{"name":"kroulzhang","email":"769329489@qq.com"},"_npmVersion":"10.7.0","description":"A Model Context Protocol server for SupaUI MCP ","directories":{},"_nodeVersion":"20.14.0","dependencies":{"zod":"^3.24.2","axios":"^1.7.9","typescript":"^5.7.3","@types/axios":"^0.9.36","@modelcontextprotocol/sdk":"^1.5.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.13.4"},"_npmOperationalInternal":{"tmp":"tmp/supaui-mcp_1.0.0_1741599707749_0.9805321768217277","host":"s3://npm-registry-packages-npm-production"}},"0.0.1":{"name":"@buouui/supaui-mcp","version":"0.0.1","author":{"name":"support@buouui.com"},"license":"ISC","_id":"@buouui/supaui-mcp@0.0.1","maintainers":[{"name":"kroulzhang","email":"769329489@qq.com"}],"dist":{"shasum":"ed43abdbefd3defe2f7cb9f7c5cadd307362af8e","tarball":"https://registry.npmjs.org/@buouui/supaui-mcp/-/supaui-mcp-0.0.1.tgz","fileCount":17,"integrity":"sha512-Ltj5ecT4GmX9Q7ImJjIEBU6ExPdCf6GQIajQSQi2Up0lLmWw7mMU665r+9blz5h86avBOkzfLEToj7IlRWsZdg==","signatures":[{"sig":"MEUCIH4ibXO0uNlNkppVBTX4/YkLTjwEPEtSoJ8aF8JUOP5iAiEA7yA89AvFd1ntNpMWKkvSZCVGcKr1Cy90WmKTmOzukb0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22240},"main":"dist/index.js","gitHead":"67ef4fc3ec048204941721933fbbfc2dae3920d4","scripts":{"build":"tsc","start":"node dist/index.js"},"_npmUser":{"name":"kroulzhang","email":"769329489@qq.com"},"_npmVersion":"10.7.0","description":"A Model Context Protocol server for SupaUI MCP ","directories":{},"_nodeVersion":"20.14.0","dependencies":{"zod":"^3.24.2","axios":"^1.7.9","typescript":"^5.7.3","@types/axios":"^0.9.36","@modelcontextprotocol/sdk":"^1.5.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.13.4"},"_npmOperationalInternal":{"tmp":"tmp/supaui-mcp_0.0.1_1741604019336_0.3558364858424783","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@buouui/supaui-mcp","version":"0.0.2","description":"A Model Context Protocol server for SupaUI MCP ","main":"dist/index.js","bin":{"supaui-mcp":"dist/index.js"},"scripts":{"start":"node dist/index.js","build":"tsc"},"author":{"name":"support@buouui.com"},"license":"ISC","dependencies":{"@modelcontextprotocol/sdk":"^1.5.0","@types/axios":"^0.9.36","axios":"^1.7.9","typescript":"^5.7.3","zod":"^3.24.2"},"devDependencies":{"@types/node":"^22.13.4"},"_id":"@buouui/supaui-mcp@0.0.2","gitHead":"67ef4fc3ec048204941721933fbbfc2dae3920d4","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-YiwBnoCBro1SWBfzv2pnmJvTV38k4XyU7J78wPpl39EozMwrg7ZD2haEsRXyniXNs5wa66KP4/ksyrvN6A1oaw==","shasum":"7510a6a24a0232bdd817e5ca0bf249d00bfb794a","tarball":"https://registry.npmjs.org/@buouui/supaui-mcp/-/supaui-mcp-0.0.2.tgz","fileCount":17,"unpackedSize":22266,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICMOgMHt6pWMLsMJivgbJNmo3zPPLJQhbFR/SkTi99zAAiAWfhcweHnf+EwpdKYJJ4TafLeqPaXeB13eZptne3KteQ=="}]},"_npmUser":{"name":"kroulzhang","email":"769329489@qq.com"},"directories":{},"maintainers":[{"name":"kroulzhang","email":"769329489@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/supaui-mcp_0.0.2_1741605199670_0.7205168154328971"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-10T09:41:47.650Z","modified":"2025-03-10T11:13:20.112Z","1.0.0":"2025-03-10T09:41:47.972Z","0.0.1":"2025-03-10T10:53:39.499Z","0.0.2":"2025-03-10T11:13:19.900Z"},"author":{"name":"support@buouui.com"},"license":"ISC","description":"A Model Context Protocol server for SupaUI MCP ","maintainers":[{"name":"kroulzhang","email":"769329489@qq.com"}],"readme":"# UI 组件生成 MCP 服务\n\n这是一个基于 MCP (Model Context Protocol) 的服务，用于自动生成 UI 组件。该服务可以与 Claude 和 Windsurf 等 AI 助手集成，提供便捷的 UI 组件生成功能。\n\n## 功能特点\n\n- 支持多种 UI 组件的生成（按钮、输入框、对话框、表格、表单等）\n- 与 Claude 和 Windsurf AI 助手无缝集成\n- 基于 buouui.com API 进行组件生成\n- 支持自定义组件查询和生成\n\n## 安装\n\n1. 克隆仓库：\n```bash\ngit clone [your-repository-url]\ncd mcp-ui-gen\n```\n\n2. 安装依赖：\n```bash\npnpm install\n```\n\n3. 构建项目：\n```bash\npnpm build\n```\n\n## 使用方法\n\n1. 启动服务：\n```bash\npnpm start\n```\n\n2. 在 Claude 或 Windsurf 中使用以下命令触发 UI 组件生成：\n- `/ui [组件描述]`\n- `/21 [组件描述]`\n- `/21st [组件描述]`\n\n例如：\n```\n/ui 创建一个带有确认和取消按钮的对话框\n```\n\n## 项目结构\n\n```\nsrc/\n├── tools/\n│   ├── create-ui.ts    # UI 组件生成工具\n│   ├── logo-search.ts  # Logo 搜索工具\n│   └── fetch-ui.ts     # UI 组件获取工具\n├── utils/\n│   ├── base-tool.ts    # 基础工具类\n│   └── http-client.ts  # HTTP 客户端配置\n└── index.ts           # 主入口文件\n```\n\n## API 说明\n\n### 组件生成 API\n\n- 端点：`https://buouui.com/api/mcp`\n- 方法：`POST`\n- 请求体：\n  ```typescript\n  {\n    message: string;    // 用户完整消息\n    searchQuery: string // 组件搜索查询（2-4个关键词）\n  }\n  ```\n- 响应：\n  ```typescript\n  {\n    text: string  // 生成的组件代码\n  }\n  ```\n\n## 开发指南\n\n### 添加新工具\n\n1. 在 `src/tools` 目录下创建新的工具类\n2. 继承 `BaseTool` 类\n3. 实现必要的抽象方法和属性\n4. 在 `src/index.ts` 中注册新工具\n\n示例：\n```typescript\nexport class NewTool extends BaseTool {\n  name = \"tool-name\";\n  description = \"Tool description\";\n  \n  schema = z.object({\n    // 定义参数架构\n  });\n\n  async execute(args: z.infer<typeof this.schema>) {\n    // 实现工具逻辑\n  }\n}\n```\n\n### 错误处理\n\n服务使用标准的错误处理机制：\n\n```typescript\ntry {\n  // 业务逻辑\n} catch (error) {\n  return {\n    content: [{\n      type: \"text\" as const,\n      text: \"Error: [错误描述]\"\n    }]\n  };\n}\n```\n\n## 故障排除\n\n1. 组件生成失败\n   - 检查网络连接\n   - 确认 API 端点可访问\n   - 查看服务器日志\n\n2. 集成问题\n   - 确保 Claude/Windsurf 正确配置了 MCP 工具\n   - 验证工具响应格式是否符合要求\n\n## 贡献指南\n\n1. Fork 项目\n2. 创建特性分支\n3. 提交更改\n4. 推送到分支\n5. 创建 Pull Request\n\n## 许可证\n\nISC License\n\n## 联系方式\n\n- 邮箱：support@buouui.com\n- 网站：https://buouui.com\n","readmeFilename":"README.md"}