Skip to main content

Windsurf Integration

Windsurf is an AI-powered IDE by Codeium. You can route Windsurf’s AI requests through the LeanMCP AI Gateway to monitor what code is being sent to AI providers.

Prerequisites

1

Get Credits

Purchase credits at ship.leanmcp.com
2

Create API Key

Create an API key at ship.leanmcp.com/api-keys with SDK permissions

Configuration

1

Open Windsurf Settings

Press Cmd + , (Mac) or Ctrl + , (Windows/Linux) to open SettingsOr click the gear icon in the bottom left corner
2

Search for AI Settings

In the search bar, type “AI” or “API” to find the AI configuration section
3

Configure Custom API Endpoint

Look for settings related to custom AI providers or API endpoints:Base URL / API Endpoint:
https://aigateway.leanmcp.com/v1/openai
API Key:
leanmcp_your_api_key_here
Windsurf settings
4

Apply and Restart

Apply your settings and restart Windsurf.

Alternative: Settings JSON

You can also configure Windsurf via its settings JSON file:
{
  "ai.provider": "openai-compatible",
  "ai.baseUrl": "https://aigateway.leanmcp.com/v1/openai",
  "ai.apiKey": "leanmcp_your_api_key_here"
}

Verifying the Setup

  1. Open a project in Windsurf
  2. Use the AI assistant (Cascade) to ask a question about your code
  3. Check your LeanMCP Dashboard to see the request logged

What You Can Monitor

With the AI Gateway, you can see:
DataDescription
Code ContextExact code snippets sent to the AI
File PathsWhich files are included in requests
Token UsageInput and output tokens per request
CostsReal-time cost tracking
Sensitive DataDetected secrets, keys, or PII

Why Use AI Gateway with Windsurf?

See What's Sent

Windsurf sends surrounding code as context. Know exactly what’s included.

Detect Secrets

Get alerts if API keys or passwords are accidentally sent to AI.

Track Costs

Monitor your AI spending across all coding sessions.

Compliance

Maintain audit logs for security and compliance requirements.

Troubleshooting

  • Check your API key is valid and has credits
  • Verify the base URL is correct
  • Ensure Windsurf is using the custom endpoint (check settings)
  • Make sure to save settings before closing
  • Try editing the settings JSON file directly
  • Restart Windsurf after making changes
  • Confirm you’re using the LeanMCP API key (starts with leanmcp_)
  • Wait a few seconds - there may be a brief delay
  • Check the correct workspace/account in the dashboard

Next Steps