Starwind UI MCP Server
一个用于 Starwind UI v3 和 Starwind Pro 的 TypeScript Model Context Protocol 服务器。它为 AI 客户端提供基于当前框架的、针对 Astro 和 React 项目的指导。
快速开始
关于维护的客户端设置指南,请参阅 Starwind UI MCP 文档。
Codex(~/.codex/config.toml):
[mcp_servers.starwind_ui]
command = "npx"
args = ["-y", "@starwind-ui/mcp"]
enabled = trueClaude Code(.mcp.json)或 Cursor(.cursor/mcp.json):
{
"mcpServers": {
"starwind-ui": {
"command": "npx",
"args": ["-y", "@starwind-ui/mcp"]
}
}
}更改配置后,请重启客户端或重新加载其 MCP 服务器。
Related MCP server: shadcn-ui MCP Server
v3 模型
Starwind UI v3 有三个相关的表层。MCP 将它们区分开来:
表层 | 表示的内容 | MCP 行为 |
样式组件(Styled components) | 拥有副本的 UI 组件,带有 Astro 和/或 React 实现 | 使用 |
原语(Primitives) | 较低级别的 Astro 和 React 适配器,在适用时由 Starwind Runtime 支持 | 使用 |
运行时(Runtime) | 框架无关的行为 API | 使用 |
服务器会根据版本化的 ai-manifest.json 验证这些层,缓存验证后的数据,并在网站不可用时回退到捆绑的 v3 快照。
工具
工具 | 用途 |
| 为现有 Astro 或 React 项目生成 v3 初始化命令。Pro 为可选项。 |
| 验证请求并为样式组件、原语或仅限 Astro 的 Pro 块生成安装或延迟安装命令。 |
| 搜索样式组件、原语和 Pro 块,附带框架元数据和过滤器。 |
| 解析确切的组件、原语、Runtime、迁移和框架文档。 |
| 检查项目并生成安全的、以交互为先的 v2 到 v3 迁移指导。 |
工具调用返回可读的 JSON 文本和 MCP structuredContent。
要求与行为
生成的 v3 CLI 命令需要 Node.js 22.12.0 或更高版本。
starwind_init针对现有的 Astro 5+ 或 React 18+ 项目,除非提供了framework,否则让 CLI 自动检测框架。免费的
@starwind-pro/*目录块在普通初始化后即可使用。付费块需要明确的授权;仅在必要时传递pro: true。Starwind Pro 块目前仅适用于 Astro。React 搜索会忽略它们,React 添加请求也会明确拒绝它们。
迁移默认为交互式。仅在需要备份并覆盖行为时设置
yes: true。包管理器和项目上下文会在可能的情况下在本地检测,添加命令会将解析后的包管理器传递给 CLI。没有工具会执行生成的命令。
从免费版升级到 Pro
MCP 保持 Pro 的可发现性,而不强制付费设置。搜索结果链接到 Pro 目录,免费的 Pro 块仍可直接安装,付费结果包含带有购买和安装链接的结构化 proUpgrade 路径。
对于现有的 Astro 项目,MCP 推荐:
pnpm dlx starwind@latest setup --yes设置命令会自动检测项目的包管理器,因此不需要 --package-manager 标志。它会准备 Pro 注册表和 .env.local;将 STARWIND_LICENSE_KEY 占位符替换为购买的密钥,然后运行返回的 deferredCommand。将该密钥视为敏感信息:将 .env.local 排除在版本控制之外,切勿在日志或客户端代码中暴露密钥。使用 pro: true 初始化的项目将收到等效的 init --pro 命令。
开发
pnpm build
pnpm lint
pnpm test:run运行可选的生成环境清单合约测试:
RUN_LIVE_CONTRACT_TESTS=1 pnpm test:run src/utils/starwind_live_contract.test.ts许可证
MIT。请参阅 LICENSE。
安全性
Available Tools
5 toolsstarwind_addA
Generates validated Starwind UI v3 install commands for styled components, vendored primitives, or Starwind Pro blocks, with optional Astro or React targeting.
Inputs: components (required), to, cwd, pro, +5 more. Returns: result
starwind_docsB
Fetches current Starwind UI v3 documentation across styled components, primitives, Runtime, migration, and Astro or React framework guides.
Inputs: full, topic, surface. Returns: result
starwind_initA
Generates a Starwind UI v3 initialization command for an existing Astro or React project. The CLI auto-detects the framework unless an override is provided. Paid Pro authorization is opt-in and currently targets Astro.
Inputs: cwd, pro, framework, packageManager. Returns: result
starwind_migrateB
Generates the safe Starwind UI v3 migration command for a legacy Astro project. Interactive migration is the default; non-interactive overwrite behavior must be explicitly requested.
Inputs: cwd, yes, packageManager. Returns: result
starwind_searchC
Searches Starwind UI v3 styled components, Primitive adapters, and Starwind Pro blocks with framework-aware results.
Inputs: cwd, plan, limit, query, +4 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clear, distinct purpose: initialization, adding components, searching, documentation, and migration. The only minor ambiguity is between starwind_init and starwind_add, as both generate CLI commands. However, starwind_init is specifically for project initialization, while starwind_add handles component and block installation, which is a reasonable distinction.
All tools follow a consistent starwind_ prefix followed by an imperative verb (init, add, search, docs, migrate). This is a clean, predictable pattern. The slight deduction is because the imperative verb is not strictly a verb_noun pattern (e.g., starwind_search instead of starwind_search_components), but this is a minor and common stylistic choice.
With 5 tools, the server is very well-scoped. It covers the core actions a developer would need when using the Starwind UI library within an MCP context: initializing, adding components, searching, and migrating. Each tool clearly earns its place, and the count feels appropriate for the scope of managing and interacting with a UI component library.
The tool set covers the primary development workflow: initializing, adding components, searching, accessing documentation, and managing migrations. This provides a comprehensive foundation. The only arguably missing piece might be a tool for direct configuration management or status checks. However, for an MCP interface, this set is remarkably complete and avoids common gaps in lifecycle management.
Maintenance
Related MCP Connectors
Serves your design system and coding standards to coding agents, so they stop guessing.
React + Tailwind UI components and recipes your AI coding tool can search and install.
React + Tailwind UI components and recipes your AI coding tool can search and install.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA server that helps AI models better understand Vite/Nuxt applications, providing enhanced context awareness for development support.916MIT
- AlicenseAqualityDmaintenanceHelps AI assistants access shadcn/ui component documentation and examples through a TypeScript-based MCP server that provides reference information for component details, usage examples, and search capabilities.41,124 npm60MIT
- AlicenseAqualityDmaintenanceProvides reference information for shadcn/ui components through a Model Context Protocol server that helps AI assistants access component documentation and examples.4MIT
- AlicenseAqualityBmaintenanceServer that enables AI assistants to interact with Storybook design systems. Extract component HTML, analyze styles, and help with design system adoption and refactoring.9465 npm73MIT