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
1
Get Credits
Purchase credits at leanmcp.com
2
Create API Key
Create an API key at leanmcp.com/api-keys with SDK permissions
Configuration
1
Open Cursor Settings
Press
Cmd + , (Mac) or Ctrl + , (Windows/Linux) to open SettingsOr go to Cursor > Settings > Cursor Settings2
Navigate to Models
Click on Models in the left sidebar
3
Configure OpenAI-Compatible Endpoint
Find the OpenAI API Key section and configure:API Key:Override OpenAI Base URL:

4
Save and Restart
Save your settings and restart Cursor for changes to take effect.
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: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)
Next Steps
View Your Logs
See all your AI requests
Security Settings
Block sensitive data

