Cursor Integration
Cursor is an AI-powered code editor. You can route Cursor’s AI requests through the LeanMCP AI Gateway to gain visibility into what code is being sent to AI providers.Prerequisites
Get Credits
Purchase credits at ship.leanmcp.com
Create API Key
Create an API key at ship.leanmcp.com/api-keys with SDK permissions
Configuration
Open Cursor Settings
Press
Cmd + , (Mac) or Ctrl + , (Windows/Linux) to open SettingsOr go to Cursor > Settings > Cursor SettingsConfigure OpenAI-Compatible Endpoint
Find the OpenAI API Key section and configure:API Key:Override OpenAI Base URL:

Verifying the Setup
- Open any file in Cursor
- Use Cmd+K (or Ctrl+K) to open the AI prompt
- Ask a simple question like “What does this file do?”
- Check your LeanMCP Dashboard to see the request logged

What You Can See
Once configured, you’ll be able to see in your LeanMCP dashboard:- Full context sent - exactly what code Cursor includes in each request
- Token usage - how many tokens each request uses
- Model used - which AI model processed your request
- Sensitive data - any API keys, passwords, or PII detected in your code
Supported Models
Through the LeanMCP AI Gateway, Cursor can access:| Provider | Models |
|---|---|
| OpenAI | GPT-5.2, GPT-5.2, GPT-5.2 |
| Anthropic | Claude 3.5 Sonnet, Claude 3 Opus |
Cursor primarily uses the OpenAI endpoint. For Anthropic models, you may need to configure a separate API endpoint.
Troubleshooting
Requests not appearing in dashboard
Requests not appearing in dashboard
- Verify your API key is correct
- Check the base URL is exactly
https://aigateway.leanmcp.com/v1/openai - Restart Cursor after changing settings
Authentication errors
Authentication errors
- Ensure your API key has SDK permissions
- Check that you have credits in your account
- Verify the API key hasn’t been deleted
Slow responses
Slow responses
- The gateway adds minimal latency (~50ms)
- If significantly slower, check your internet connection
- Try a different model (GPT-5.2 is faster than GPT-5.2)