这是一个用于 Starwind UI 的 Model Context Protocol (MCP) 服务器的 TypeScript 实现,提供工具帮助开发者在使用像 Claude、Windsurf、Cursor 等 AI 工具时与 Starwind UI 组件进行交互。
设置 IDE 使用本地 MCP 服务器的方法因 IDE 而异。以下是不同平台的例子:
Windsurf:
{
"mcpServers": {
"starwind-ui": {
"command": "npx",
"args": ["-y", "@starwind-ui/mcp"],
"env": {}
}
}
}
Cursor:
{
"mcpServers": {
"starwind-ui": {
"command": "npx",
"args": ["-y", "@starwind-ui/mcp"],
"env": {}
}
}
}
Claude Code:
{
"mcpServers": {
"starwind-ui": {
"command": "npx",
"args": ["-y", "@starwind-ui/mcp"],
"env": {}
}
}
}
详细步骤:
要通过 Smithery 自动安装 Starwind UI MCP 服务器到 Claude Desktop:
npx -y @smithery/cli install @starwind-ui/starwind-ui-mcp --client claude
| 工具名称 | 描述 |
|---|---|
init_project | 初始化一个新的 Starwind UI 项目 |
install_component | 生成 Starwind UI 组件的安装命令 |
update_component | 生成 Starwind UI 组件的更新命令 |
get_documentation | 返回 Starwind UI 组件和指南的文档链接 |
fetch_llm_data | 从 starwind.dev 获取 LLM 数据(有限制,带缓存) |
get_package_manager | 检测并返回当前的包管理器信息 |
Model Context Protocol (MCP) 是一种通过本地服务器扩展 AI 功能的协议。此实现提供了特定于 Starwind UI 的工具,以增强在使用 Starwind UI 时的 AI 助手能力。有关 MCP 本身的更多信息,请访问 官方文档。
该项目设置为使用 PNPM 作为开发用途的包管理器。如果你不使用 pnpm,则需要更新 package.json 文件,以包含你需要的适当包管理器命令。
src/
├── config/ # 服务器配置
│ └── settings.ts # 配置设置
├── tools/ # MCP 工具实现
│ ├── index.ts # 工具注册
│ └── *.ts # 单个工具实现
├── utils/ # 工具函数
└── server.ts # 主 MCP 服务器实现
要向服务器添加自己的工具:
src/tools/ 目录中创建一个新工具文件src/tools/index.ts 中注册该工具src/config/settings.ts 中启用该工具pnpm build 重新构建服务器pnpm start 重启服务器MIT 许可证 - 详情见 LICENSE 文件。