Skip to main content

Cline Integration

Cline is an autonomous coding agent. You can configure it to use the LeanMCP AI Gateway as a custom provider or via its OpenRouter/Anthropic integration points.

Configuration

To use LeanMCP with Cline, you need to update your global state configuration file. This allows you to point Cline’s API requests to the LeanMCP AI Gateway.
1

Locate Configuration File

Open your Cline global state file. On Windows, this is typically located at:C:\Users\<your-username>\.cline\data\globalState.json
Ensure Cline is closed before editing this file to prevent your changes from being overwritten.
2

Update Configuration

Add or modify the following fields in your globalState.json. This configures the API provider to use LeanMCP and sets the necessary authentication details.
{
  "actModeApiProvider": "leanmcp",
  "planModeApiProvider": "leanmcp",
  "leanmcp": {
    "apiKey": "leanmcp_your_api_key_here",
    "baseURL": "https://aigateway.leanmcp.com/v1/anthropic",
    "modelId": "anthropic/claude-opus-4.5"
  },
  "apiProvider": "leanmcp"
}
Replace leanmcp_your_api_key_here with your actual API key from the LeanMCP Dashboard.

Example Configuration

Here is a more complete example of what your globalState.json might look like:
{
  "welcomeViewCompleted": true,
  "actModeApiProvider": "leanmcp",
  "planModeApiProvider": "leanmcp",
  "openAiHeaders": {},
  "sapAiCoreUseOrchestrationMode": true,
  "ocaMode": "internal",
  "autoApprovalSettings": {
    "version": 7,
    "enabled": true,
    "maxRequests": 20,
    "actions": {
      "readFiles": true,
      "executeSafeCommands": true,
      "useMcp": true
    }
  },
  "leanmcp": {
    "apiKey": "leanmcp_your_api_key_here",
    "baseURL": "https://aigateway.leanmcp.com/v1/anthropic",
    "modelId": "anthropic/claude-opus-4.5"
  },
  "apiProvider": "leanmcp"
}