Design · MODEL CONTEXT PROTOCOL
starwind-ui-mcp
Local MCP server implementation for Starwind UI that you can use with Cursor, Windsurf, and other AI tools
连接能力
starwind-ui-mcp 为 AI Agent 提供什么
来源目录未提供结构化功能列表,请在使用前阅读源仓库文档。
安全
MCP 收录不等于安全审核
MCP 服务器可能获得模型上下文、凭据、本地文件或调用外部系统的权限。连接 Agent 前,请检查代码、环境变量、网络行为、软件包来源与维护状态。
README
仓库文档
Official MCP Registry
·
io.github.starwind-ui/mcp
A TypeScript Model Context Protocol server for Starwind UI v3 and Starwind Pro. It gives AI clients current guidance for Astro, React, Vue, and Svelte projects.
For the maintained client setup guide, see the Starwind UI MCP documentation.
Codex (~/.codex/config.toml):
[mcp_servers.starwind_ui]
command = "npx"
args = ["-y", "@starwind-ui/mcp"]
enabled = trueClaude Code (.mcp.json) or Cursor (.cursor/mcp.json):
{
"mcpServers": {
"starwind-ui": {
"command": "npx",
"args": ["-y", "@starwind-ui/mcp"]
}
}
}Restart the client or reload its MCP servers after changing the configuration.
Starwind UI v3 has three related surfaces. The MCP keeps them distinct:
| Surface | What it represents | MCP behavior |
|---|---|---|
| Styled components | Copy-owned UI components with Astro, React, Vue, and Svelte implementations | Search and install with starwind_search and starwind_add |
| Primitives | Lower-level Astro, React, Vue, and Svelte adapters, backed by Starwind Runtime where applicable | Search with surface: "primitive"; install with the v3 primitives add command |
| Runtime | Framework-neutral behavior APIs | Fetch with starwind_docs using the Runtime topic or surface |
The server validates these layers against the versioned ai-manifest.json, caches validated data, and falls back to a bundled v3 snapshot if the site is unavailable. Validation drops framework targets that this version does not know, so a newer manifest still works.
| Tool | Purpose |
|---|---|
starwind_init |
Generate v3 initialization commands for an existing Astro, React, Vue, or Svelte project. Pro is opt-in. |
starwind_add |
Validate requests and generate installation or deferred-install commands for styled components, primitives, or Pro blocks. |
starwind_search |
Search styled components, primitives, and Pro blocks with framework metadata and filters. |
starwind_docs |
Resolve exact component, primitive, Runtime, migration, and framework documentation. With cwd, it also points to the installed package docs page. |
starwind_migrate |
Inspect a project and generate safe, interactive-first v2-to-v3 migration guidance. |
Tool calls return both readable JSON text and MCP structuredContent.
- Generated v3 CLI commands require Node.js 22.12.0 or newer.
starwind_inittargets existing Astro 5+, React 18+, Vue 3.5.21+, or Svelte 5.29+ (below 6) projects. The CLI auto-detects the framework unless you supplyframework.- The
frameworkinput acceptsastro,react,vue, orsvelte.starwind_searchalso acceptsall. - Project context detects Astro (with React, Vue, or Svelte islands), Vite React, Next.js, React Router, TanStack Start, Vite Vue, Nuxt, Quasar, Laravel with Inertia Vue, Vite Svelte, and SvelteKit. It also reads
frameworkandcomponentDirsfromstarwind.config.json. - When you pass
cwd, project context lists the docs that ship in installed@starwind-ui/*packages (1.6.0 and newer) underpackageDocs. The lookup finds packages the way Node does, so packages hoisted to a workspace root are found too. - With
cwd,starwind_docsreturnsinstalledDocs, the page that matches the installed version. This works for a Primitive topic, a Runtime topic (init-starwind,raw-html,theme, or a controller), and a styled component that has a Primitive with the same name. If the website is unavailable, the tool returns the installed page. - With
cwd, styled search results addprojectImportPathwhen the project shows its host or component folder. Examples:~/components/starwind/buttonin Nuxt and$lib/starwind/buttonin SvelteKit 2.publicImportPathkeeps the default path. - A detected Vue host gets
init --framework vue. Only an explicit Vue target reaches the CLI's Vue upgrade offer when the project uses Vue below 3.5.21. - Free
@starwind-pro/*catalog blocks work after ordinary initialization. Paid blocks require explicit authorization. Passpro: trueonly when it is required. - Pro search, setup, and installs work in every framework. Starwind Pro blocks are Astro components. For a React, Vue, or Svelte target, results that include Pro guidance or Pro blocks add
proFrameworkWarning: use an Astro host for the block, or port the block.starwind_searchadds it only when it returns Pro blocks.proUpgrade.newProjectCommanduses the selected or detected framework. - Migration is interactive by default. Set
yes: trueonly when backup-and-overwrite behavior is intended. - Package-manager and project context are detected locally when possible, and add commands pass the resolved package manager to the CLI. No tool executes the generated command.
- The
packageManagerinput acceptsnpm,pnpm,yarn, orbun. Detection checks lockfiles in the CLI order:pnpm-lock.yaml,yarn.lock,bun.lock,bun.lockb,package-lock.json. It walks up fromcwdto the nearest folder with a lockfile or apackageManagerfield, so workspace members use the workspace root lockfile. Bun projects getbunx starwind@latestcommands. Withcwd,starwind_searchcommands use the project's runner too.
The MCP keeps Pro discoverable without forcing paid setup. Search results link to the Pro catalog, free Pro blocks remain directly installable, and paid results include a structured proUpgrade path with purchase and installation links.
For an existing project, the MCP recommends:
pnpm dlx starwind@latest setup --yesThe setup command auto-detects the project's package manager, so it does not need a --package-manager flag. It prepares the Pro registry and .env.local; replace the STARWIND_LICENSE_KEY placeholder with the purchased key, then run the returned deferredCommand. Treat the key as sensitive: keep .env.local out of source control and never expose the key in logs or client-side code. A project initialized with pro: true receives the equivalent init --pro command instead.
pnpm build
pnpm lint
pnpm test:runRun the opt-in production manifest contract test with:
RUN_LIVE_CONTRACT_TESTS=1 pnpm test:run src/utils/starwind_live_contract.test.tsMIT. See LICENSE.
社区