> ## Documentation Index
> Fetch the complete documentation index at: https://docs.leanmcp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cline

> Use the LeanMCP AI Gateway with Cline

# Cline Integration

[Cline](https://github.com/cline/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.

<Steps>
  <Step title="Locate Configuration File">
    Open your Cline global state file. On Windows, this is typically located at:

    `C:\Users\<your-username>\.cline\data\globalState.json`

    <Info>
      Ensure Cline is closed before editing this file to prevent your changes from being overwritten.
    </Info>
  </Step>

  <Step title="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.

    ```json theme={null}
    {
      "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"
    }
    ```

    <Note>
      Replace `leanmcp_your_api_key_here` with your actual API key from the [LeanMCP Dashboard](https://leanmcp.com/api-keys).
    </Note>
  </Step>
</Steps>

## Example Configuration

Here is a more complete example of what your `globalState.json` might look like:

```json theme={null}
{
  "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"
}
```
