这是一个用于 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 文件。