create-swc-vite-react-app
March 30, 2025 ยท View on GitHub
A CLI tool to create React applications with Vite and Spectrum Web Components for fast development and build times. Now with MCP support for integration with AI assistants!
Features
- โก๏ธ Lightning fast development with Vite
- ๐ฆ TypeScript support built-in
- โ๏ธ React 19+ for the latest features
- ๐จ Spectrum Web Components integration
- ๐ Customizable theming options
- ๐ ESLint configuration included
- ๐งฉ Path aliases (@components) for clean imports
- ๐จ Beautiful default template
- ๐ฑ Responsive design ready
- ๐ Dark mode support
- ๐ค MCP support for integration with AI assistants
Generated App Preview
The generated app comes with a beautiful, responsive layout that includes a header, sidebar navigation, and main content area. Here's how it looks:

The app includes (some of the items listed below are still in development):
- Modern, clean design
- Responsive layout
- Dark/Light theme support
- Customizable color schemes
- Collapsible sidebar
- Ready-to-use Spectrum components
Quick Start
# Using npm
npx create-swc-vite-react-app my-app
# Using yarn
yarn create swc-vite-react-app my-app
# Using pnpm
pnpm create swc-vite-react-app my-app
# Create project in current directory
npx create-swc-vite-react-app .
Options
--eslint- Include ESLint configuration (default: true)--use-npm- Use npm as package manager--use-pnpm- Use pnpm as package manager--use-yarn- Use yarn as package manager--theme-scale- Theme scale: large, medium, or both (default: both)--theme-color- Theme color: dark, light, or both (default: both)--system- Design system: spectrum, spectrum-two, or express (default: spectrum)--mcp- Start in MCP mode for integration with AI assistants
Note: The SpTheme.ts file will be customized with the appropriate imports based on your theme selections.
Project Structure
The generated project will have the following structure:
my-app/
โโโ node_modules/
โโโ public/
โโโ src/
โ โโโ components/
โ โ โโโ icons/
โ โ โ โโโ [icon components]
โ โ โโโ Accordion.ts
โ โ โโโ ActionBar.ts
โ โ โโโ ActionButton.ts
โ โ โโโ ActionGroup.ts
โ โ โโโ ActionMenu.ts
โ โ โโโ AlertBanner.ts
โ โ โโโ AlertDialog.ts
โ โ โโโ Button.ts
โ โ โโโ Card.ts
โ โ โโโ Checkbox.ts
โ โ โโโ Dialog.ts
โ โ โโโ Icon.ts
โ โ โโโ SpTheme.ts (imports customized based on theme options)
โ โ โโโ Toast.ts
โ โ โโโ Tooltip.ts
โ โ โโโ types.ts
โ โ โโโ [60+ components in total]
โ โโโ layout/
โ โ โโโ Header.tsx
โ โ โโโ Header.css
โ โ โโโ Sidebar.tsx
โ โ โโโ Sidebar.css
โ โ โโโ MainContent.tsx
โ โ โโโ MainContent.css
โ โโโ App.tsx
โ โโโ App.css
โ โโโ main.tsx
โโโ .eslintrc.cjs
โโโ index.html
โโโ package.json
โโโ tsconfig.json
โโโ tsconfig.node.json
โโโ vite.config.ts
The project includes:
- components/: A comprehensive set of Spectrum Web Components wrappers
- icons/: SVG icon components
- Various UI components (60+ components available)
SpTheme.ts: Theme configuration (customized based on your options)types.ts: TypeScript type definitions
- layout/: Pre-built layout components
Header: Application header with navigationSidebar: Collapsible side navigationMainContent: Main content area with responsive design
- App.tsx: Main application component
- Configuration files: ESLint, TypeScript, and Vite configs
Available Scripts
In the project directory, you can run:
npm dev- Starts the development servernpm build- Bundles the app for productionnpm preview- Preview the production build locallynpm lint- Run ESLint to check code quality
MCP Support
This tool now includes MCP (Model Context Protocol) mode support.
MCP Features
- Tools: The MCP server exposes a
create-apptool that can create a new project with the same options as the CLI. - Prompts: The MCP server includes a prompt for guiding users through creating a new project.
- Resources: Documentation for CLI options is available as a resource.
Integration with Cursor
To integrate with Cursor, you can configure it to use this tool with the MCP protocol. This allows Cursor's AI assistant to directly create SWC+Vite React applications based on user instructions.
{
"mcpServers": {
"create-swc-vite-react-app": {
"command": "npx",
"args": ["-y", "create-swc-vite-react-app@latest", "--mcp"],
"env": {}
}
}
}
Requirements
- Node.js 18.0.0 or later
- npm 7.0.0 or later, yarn 1.22.0 or later, or pnpm 7.0.0 or later
Dependencies
Key dependencies:
- @modelcontextprotocol/sdk: ^1.8.0
- chalk: ^5.4.1
- commander: ^13.1.0
- fs-extra: ^11.3.0
- prompts: ^2.4.2
- validate-npm-package-name: ^6.0.0
License
MIT