v0-mcp-ts
Version:
A powerful Model Context Protocol (MCP) server that integrates v0.dev AI capabilities for modern web development. Powered by Bun for 25x faster performance.
322 lines (222 loc) โข 9.31 kB
Markdown
# v0-mcp-ts
[](https://opensource.org/licenses/MIT)
[](https://www.typescriptlang.org/)
[](https://bun.sh/)
[](https://github.com/nicotordev/v0-mcp-ts/actions)
[](https://github.com/nicotordev/v0-mcp-ts/actions)
> ๐ **A powerful Model Context Protocol (MCP) server that integrates v0.dev AI capabilities for modern web development**
Transform your development workflow with AI-powered web application generation, code enhancement, debugging, and component creation through the standardized MCP protocol. **Now powered by Bun for 25x faster performance!** โก
## โจ Features
- ๐ฏ **Complete Web App Generation** - Create full-stack applications with Next.js, React, Vue, Svelte
- ๐ง **Intelligent Code Enhancement** - AI-powered code improvements and optimizations
- ๐ **Smart Debugging** - Automated error detection and fixes
- ๐งฉ **Component Generation** - Create reusable, type-safe components
- โก **Lightning Fast** - Powered by Bun runtime (25x faster than npm)
- ๐ **MCP Compatible** - Works with any MCP client (Claude Desktop, Cursor, etc.)
- ๐ก๏ธ **Type-Safe** - Full TypeScript support with Zod validation
- ๐งช **Well Tested** - Comprehensive test suite with Vitest and coverage
## ๐ฌ Quick Demo
```bash
# Generate a complete Next.js e-commerce app
mcp-tool generate_webapp --prompt "E-commerce store with shopping cart" --framework nextjs
# Enhance existing code with AI
mcp-tool enhance_code --code "function add(a,b){return a+b}" --enhancement "Add TypeScript types"
# Debug problematic code
mcp-tool debug_code --code "broken code here" --error_message "TypeError: Cannot read property"
# Create reusable components
mcp-tool generate_component --name "UserCard" --description "Profile card component"
```
## ๐ Prerequisites
- **Bun** 1.2.0 or higher (for best performance)
- **v0.dev API Key** (Premium or Team plan required)
- **TypeScript** 5.0+
- **MCP Client** (Claude Desktop, Cursor, etc.)
### โก Install Bun (if not already installed)
```bash
# macOS and Linux
curl -fsSL https://bun.sh/install | bash
# Windows (PowerShell)
powershell -c "irm bun.sh/install.ps1 | iex"
# Or with npm (if you have Node.js)
npm install -g bun
```
## ๐ Quick Start
### 1. Installation
```bash
git clone https://github.com/nicotordev/v0-mcp-ts.git
cd v0-mcp-ts
bun install # โก 25x faster than npm install
```
### 2. Setup
```bash
bun run setup
```
This interactive setup will:
- Configure your v0.dev API key
- Build the project with Bun
- Run tests with coverage
- Generate MCP client configuration
### 3. Configuration
#### For Claude Desktop
Copy the generated configuration to your Claude Desktop config:
```json
{
"mcpServers": {
"v0-mcp-ts": {
"command": "node",
"args": ["/absolute/path/to/v0-mcp-ts/dist/index.js"],
"env": {
"V0_API_KEY": "your_v0_api_key_here"
}
}
}
}
```
#### For Other MCP Clients
The server uses standard stdio transport, making it compatible with any MCP client.
## ๐ค AI Editor Integration
Get started quickly with these optimized configurations for AI-powered code editors:
- **[Cursor AI Configuration](examples/editor-configs/cursor-config.json)** - Complete setup with YOLO mode and test-driven development
- **[Windsurf IDE Configuration](examples/editor-configs/windsurf-config.json)** - Advanced workflows with Cascade and Flow features
๐ **[Full Editor Setup Guide](examples/editor-configs/README.md)**
## ๐ ๏ธ Available Tools
### `generate_webapp`
Create complete web applications with AI assistance.
**Parameters:**
- `prompt` (string) - Description of the application to generate
- `framework` (optional) - Target framework: `nextjs`, `react`, `vue`, `svelte`
- `features` (optional) - Array of required features
- `stream` (optional) - Enable streaming responses
**Example:**
```json
{
"name": "generate_webapp",
"arguments": {
"prompt": "Real-time chat application with authentication",
"framework": "nextjs",
"features": ["authentication", "database", "websockets"],
"stream": false
}
}
```
### `enhance_code`
Improve existing code with AI-powered suggestions.
**Parameters:**
- `code` (string) - Code to enhance
- `enhancement` (string) - Description of desired improvements
- `language` (optional) - Programming language (default: typescript)
### `debug_code`
Debug and fix code issues automatically.
**Parameters:**
- `code` (string) - Code with issues
- `error_message` (optional) - Error message if available
- `language` (optional) - Programming language (default: typescript)
### `generate_component`
Create reusable components with proper TypeScript types.
**Parameters:**
- `component_name` (string) - Name of the component
- `description` (string) - Component functionality description
- `framework` (optional) - Component framework: `react`, `vue`, `svelte`
- `props` (optional) - Component props specification
## ๐ Resources
### `v0-api-docs`
Access comprehensive v0.dev API documentation and best practices.
**URI:** `v0://api-docs`
## ๐ก Prompts
### `create-webapp`
Predefined template for generating web applications with specific requirements.
## ๐งช Development
### Running Tests
```bash
# Run all tests (with Bun's fast test runner)
bun test
# Run tests in watch mode
bun run test:watch
# Run tests with UI
bun run test:ui
# Generate coverage report
bun run test:coverage
```
### Development Mode
```bash
# Start development server with auto-reload
bun run dev
```
### Building
```bash
# Build for production
bun run build
# Clean build artifacts
bun run clean
```
## โก Bun Performance Benefits
By migrating to Bun, this project now enjoys significant performance improvements:
- **25x faster** package installation compared to npm
- **Native TypeScript support** without transpilation overhead
- **Built-in test runner** with Jest compatibility
- **Hot reload** with native watch mode
- **Optimized bundling** and dependency resolution
### Bun Commands
```bash
# Package management
bun install # Install dependencies
bun add <package> # Add dependency
bun remove <package> # Remove dependency
bun update # Update dependencies
bun audit # Security audit (v1.2.15+)
# Development
bun run dev # Development server
bun run build # Build project
bun test # Run tests
bun --watch src/index.ts # Watch mode
# Utilities
bun upgrade # Update Bun itself
bun --version # Check version
```
## ๐๏ธ API Limits
- **Daily Requests:** 200 messages per day
- **Context Window:** 128,000 tokens
- **Output Limit:** 32,000 tokens
- **Plan Required:** v0.dev Premium or Team
## ๐ค Contributing
We welcome contributions! Please see our [Development Guide](DEVELOPMENT.md) for details.
1. Fork the repository
2. Create a feature branch: `git checkout -b feature/amazing-feature`
3. Make your changes and add tests
4. Ensure all tests pass: `bun test`
5. Commit your changes: `git commit -m 'Add amazing feature'`
6. Push to the branch: `git push origin feature/amazing-feature`
7. Open a Pull Request
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐จโ๐ป Author
**Nicolas Torres**
- ๐ Location: Chile
- ๐ GitHub: [@nicotordev](https://github.com/nicotordev)
- ๐ผ LinkedIn: [nicotordev](https://www.linkedin.com/in/nicotordev/)
- ๐ฅ YouTube: [NicoTorDev Channel](https://www.youtube.com/channel/UCcOj4lCqvmND56JDz1ZMWuA)
Full Stack Web Developer specializing in Node.js, React.js, Next.js, Vue.js, and modern web technologies with expertise in Bun runtime optimization.
## ๐ Links
- ๐ [MCP Documentation](https://modelcontextprotocol.io/)
- ๐จ [v0.dev API](https://vercel.com/docs/v0/api)
- โก [Bun Documentation](https://bun.sh/docs)
- ๐ง [AI SDK](https://sdk.vercel.ai/)
- ๐๏ธ [TypeScript MCP SDK](https://github.com/modelcontextprotocol/typescript-sdk)
## ๐ Show Your Support
If this project helped you, please give it a โญ on GitHub!
### ๐ Sponsor This Project
Support continued development and maintenance:
<p align="center">
<a href="https://github.com/sponsors/nicotordev">
<iframe src="https://github.com/sponsors/nicotordev/button" title="Sponsor nicotordev" height="32" width="114" style="border: 0; border-radius: 6px;"></iframe>
</a>
</p>
**[Become a sponsor on GitHub](https://github.com/sponsors/nicotordev)** and help keep this project growing! Your support enables:
- ๐ **Continuous Development** - New features and improvements
- ๐ **Bug Fixes & Maintenance** - Quick responses to issues
- ๐ **Documentation & Tutorials** - Better learning resources
- ๐ค **Community Support** - Help other developers succeed
---
<p align="center">
<sub>Built with โค๏ธ by <a href="https://github.com/nicotordev">Nicolas Torres</a> in Chile ๐จ๐ฑ</sub>
</p>