Windsurf IDE
Connect Lemonado to Windsurf IDE using Model Context Protocol
Cascade AI Integration: Windsurf's Cascade AI system works seamlessly with MCP to provide deep codebase understanding combined with your business data.
Overview
Windsurf is an AI-powered IDE by Codeium that features Cascade, an innovative agentic AI system. With Lemonado's MCP integration, Windsurf can access your business data while maintaining deep understanding of your codebase.
Prerequisites
- Windsurf IDE installed (latest version recommended)
- Active Lemonado AI Connector with MCP endpoint
- macOS, Windows, or Linux system
Setup Instructions
Step 1: Open Windsurf MCP Settings
- Launch Windsurf IDE
- Open the Command Palette:
- macOS:
Cmd+Shift+P - Windows/Linux:
Ctrl+Shift+P
- macOS:
- Type "MCP" and select "Windsurf: Configure MCP Servers"
Step 2: Add Lemonado MCP Server
In the MCP configuration file that opens, add your Lemonado server:
{
"mcpServers": {
"lemonado": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-fetch",
"https://mcp.lemonado.io/mcp"
],
"env": {
"MCP_AUTH_TYPE": "oauth",
"MCP_OAUTH_PROVIDER": "lemonado"
},
"description": "Lemonado data connector for business intelligence"
}
}
}
Step 3: Authenticate with OAuth
When you first use the Lemonado connector, you'll be prompted to authenticate via OAuth. This will open a browser window where you can log in to your Lemonado account and select which AI Connector to use.
Step 4: Activate the Connection
- Save the configuration file
- Reload Windsurf window:
- Command Palette → "Developer: Reload Window"
- The MCP connection will be established automatically
Step 5: Verify Connection
Open Cascade Chat (Cmd+L or Ctrl+L) and test:
@lemonado List available data sources
You should see your connected Lemonado data sources.
Using Lemonado with Cascade
Cascade Flows
Windsurf's Cascade can create complex workflows combining your code and data:
Create a dashboard component that displays our top 10 customers by revenue using @lemonado data
Cascade will:
- Query your customer data via Lemonado
- Analyze your existing component structure
- Generate a type-safe dashboard component
- Include proper error handling and loading states
Multi-Step Data Operations
@lemonado Analyze our user engagement metrics and suggest code improvements to increase retention
Real-time Data Validation
Validate this API endpoint against @lemonado production data schema
Advanced Features
Cascade + MCP Workflows
Windsurf's Cascade AI excels at multi-step operations:
1. @lemonado Fetch product catalog structure
2. Generate TypeScript types from the schema
3. Create CRUD operations with validation
4. Write unit tests using sample data
5. Generate API documentation
Intelligent Code Generation
Based on @lemonado customer data, create a recommendation engine service
Cascade will:
- Analyze your data patterns
- Suggest appropriate algorithms
- Implement the service with your tech stack
- Add monitoring and logging
Data-Driven Refactoring
@lemonado Show usage patterns, then refactor this service for better performance
Configuration Options
Multiple Environments
Configure separate connectors for different environments, each with its own OAuth authentication:
{
"mcpServers": {
"lemonado-dev": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-fetch",
"https://mcp.lemonado.io/mcp"
],
"env": {
"MCP_AUTH_TYPE": "oauth",
"MCP_OAUTH_PROVIDER": "lemonado"
},
"description": "Development data"
},
"lemonado-prod": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-fetch",
"https://mcp.lemonado.io/mcp"
],
"env": {
"MCP_AUTH_TYPE": "oauth",
"MCP_OAUTH_PROVIDER": "lemonado"
},
"description": "Production data"
}
}
}
Custom Commands
Create shortcuts for common queries:
{
"mcpServers": {
"lemonado": {
"command": "npx",
"args": ["@modelcontextprotocol/server-fetch", "--url", "https://mcp.lemonado.io/mcp"],
"aliases": {
"customers": "SELECT * FROM customers LIMIT 10",
"revenue": "SELECT SUM(amount) FROM transactions WHERE date >= NOW() - INTERVAL '30 days'"
}
}
}
}
Performance Optimization
For large datasets, configure caching:
{
"mcpServers": {
"lemonado": {
"command": "npx",
"args": [
"@modelcontextprotocol/server-fetch",
"--url",
"https://mcp.lemonado.io/mcp",
"--cache",
"--cache-ttl",
"300"
]
}
}
}
Cascade Superpowers
1. Contextual Understanding
Cascade understands both your code and data:
Why is this function slow? Check against @lemonado production query patterns
2. Automated Testing
Generate tests with real data patterns:
Create integration tests using @lemonado sample data for edge cases
3. Migration Planning
Plan database migration from @lemonado current schema to new microservices architecture
4. Performance Analysis
Analyze @lemonado query logs and optimize our most expensive operations
Best Practices
Use Cascade Flows
Leverage Cascade's ability to break down complex tasks:
Flow: Implement customer segmentation
1. Analyze @lemonado customer data distribution
2. Design segmentation algorithm
3. Implement service with caching
4. Add analytics tracking
5. Create admin interface
Combine Code and Data Context
Reference both your codebase and data:
Update the UserService to handle @lemonado new customer fields
Iterative Development
Start simple and enhance:
// First iteration
Create basic CRUD for @lemonado products
// Second iteration
Add validation based on @lemonado business rules
// Third iteration
Optimize queries using @lemonado performance metrics
Windsurf-Specific Features
Inline Data Preview
Hover over queries to see live data previews:
// Hover to see actual data
const customers = await lemonado.query('SELECT * FROM customers LIMIT 5');
Smart Completions
Windsurf autocompletes based on your actual schema:
// Autocompletes with real column names
const query = 'SELECT cust|
customer_id, customer_name, created_at
Cascade Commands
Built-in commands for common operations:
/lemonado-schema- View complete data schema/lemonado-sample- Get sample data for testing/lemonado-analyze- Analyze query performance/lemonado-diff- Compare data structures
Troubleshooting
Cascade Not Recognizing MCP
- Ensure MCP server is properly configured
- Check Windsurf console for errors (View → Output → MCP)
- Verify API key has correct permissions
Slow Queries
- Enable query caching in configuration
- Use specific field selections instead of
SELECT * - Check Lemonado dashboard for rate limiting
Connection Timeouts
Increase timeout in configuration:
{
"mcpServers": {
"lemonado": {
"command": "npx",
"args": ["..."],
"timeout": 60000
}
}
}
Authentication Issues
If you see "Unauthorized" errors:
- Re-authenticate via OAuth when prompted
- Check if your AI Connector is still active
- Ensure you selected the correct AI Connector during OAuth
Tips for Power Users
Quick Data Exploration
Use Cascade's split view to explore data while coding:
Split: Show @lemonado customers table | Edit CustomerService.ts
Generate Migrations
Compare @lemonado production schema with our models and generate migrations
Automated Documentation
Document all API endpoints with @lemonado example responses
Performance Profiling
Profile this function against @lemonado real workload patterns
Windsurf vs Other IDEs
| Feature | Windsurf | Cursor | VS Code |
|---|---|---|---|
| Cascade AI | ✅ Native | ❌ | ❌ |
| MCP Support | ✅ Built-in | ✅ Built-in | ⚠️ Extension |
| Flow automation | ✅ Advanced | ⚠️ Basic | ❌ |
| Multi-step operations | ✅ Native | ⚠️ Manual | ❌ |
| Codebase understanding | ✅ Deep | ✅ Good | ⚠️ Limited |
| Data preview | ✅ Inline | ❌ | ❌ |
Security Considerations
OAuth Security:
- Authentication happens in your browser
- Credentials are never stored in config files
- OAuth tokens are managed securely by Windsurf
- Monitor access in your Lemonado dashboard
Next Steps
- Learn about Cascade workflows
- Explore MCP protocol details
Pro Tip: Use Cascade's "Explain" feature on your Lemonado queries to understand optimization opportunities and potential improvements.