-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or requestmcp-server
Description
Problem
The v0 MCP server has several issues that need to be addressed:
- Code Extraction Issues: The server saves entire AI responses including markdown artifacts instead of just the code
- File Path Handling: Multi-file responses don't create proper directory structures
- Missing Features: No ability to update files in-place or create complete features
- Poor Error Handling: No rate limiting, validation, or retry logic
Solution
Implement comprehensive fixes and enhancements:
Code Extraction Fixes
- Improve regex patterns to properly extract code from markdown blocks
- Handle file markers like
```tsx file="path/to/file.ext"
` - Remove language identifiers and closing backticks
Enhanced Features
- Add
write_to_file
parameter for direct file creation - Implement
v0_update_file
function for in-place updates - Add
v0_create_feature
for complete feature generation - Enhance
improve_component
with file writing capability
Error Handling & Validation
- Add RateLimiter class (10 calls/minute default)
- Input validation (empty prompts, max 10000 chars)
- Tech stack validation with warnings
- Retry logic (3 attempts, 5-second delays)
- Security validation for file paths
- 60-second timeout for API calls
Testing
- Multi-file generation with proper paths
- Code extraction without artifacts
- Rate limiting under load
- File update functionality
- Feature generation with multiple components
Branch
feat/v0-server-major-improvements
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or requestmcp-server