Starwind UI管理平台
一个TypeScript服务器,能够增强人工智能助手在处理Starwind UI组件时的能力,提供项目初始化、组件安装、文档访问等工具。
服务介绍
Starwind UI MCP 服务器
一个用于 Starwind UI 的 Model Context Protocol (MCP) 服务器的 TypeScript 实现,提供了帮助开发者使用 Starwind UI 组件的工具。
快速开始
# Install dependencies
pnpm install
# Build the TypeScript code
pnpm build
# Start the server
pnpm start
设置您的 IDE
不同 IDE 设置为使用本地 MCP 服务器的方法各不相同。这里以 Windsurf 为例:
{
"mcpServers": {
"starwind ui": {
"command": "node",
"args": ["c:\\path\\to\\folder\\starwind-ui-mcp\\dist\\server.js"],
"env": {}
}
}
}
详细说明:
什么是 MCP?
Model Context Protocol (MCP) 是一种通过本地服务器扩展 AI 能力的协议。此实现提供了特定于 Starwind UI 的工具,以增强在使用 Starwind UI 时 AI 助手的能力。关于 MCP 本身的更多信息,请访问官方文档。
特性
- 基于工具的架构 - 模块化设计便于添加新工具
- Starwind UI 文档工具 - 访问 Starwind UI 组件的文档链接
- 包管理器检测 - 检测并使用适当的包管理器(npm, yarn, pnpm)
- LLM 数据获取器 - 为 LLMs 提取 Starwind UI 信息,并支持缓存和速率限制
- TypeScript 实现 - 使用 TypeScript 构建,提供更好的类型安全性和开发体验
- 标准 I/O 传输 - 通过 stdio 与 AI 助手通信
可用工具
| 工具名称 | 描述 |
|---|---|
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 |
检测并返回当前包管理器信息 |
开发
该项目设置为使用 PNPM 作为开发用途的包管理器。如果您不使用 pnpm,则需要根据需要更新 package.json 文件中的相应包管理器命令。
项目结构
src/
├── config/ # Server configuration
│ └── settings.ts # Configuration settings
├── tools/ # MCP tools implementations
│ ├── index.ts # Tool registration
│ └── *.ts # Individual tool implementations
├── utils/ # Utility functions
└── server.ts # Main MCP server implementation
添加新工具
要向服务器添加您自己的工具:
- 在
src/tools/目录下创建一个新的工具文件 - 在
src/tools/index.ts中注册该工具 - 在
src/config/settings.ts中启用该工具 - 使用
pnpm build重建服务器 - 使用
pnpm start重启服务器
许可证
MIT 许可证 - 详情请参阅 LICENSE 文件。