# Connect Cline to FineProxy MCP

Add the FineProxy MCP server to the Cline VS Code extension or Cline CLI over Streamable HTTP, with the API key read from an environment variable.

- Canonical: https://fineproxy.org/developers/docs/mcp/clients/cline/

This page shows how to connect [Cline](https://docs.cline.bot/mcp/mcp-overview) — the VS Code extension or the Cline CLI — to the FineProxy MCP server. Cline connects directly over Streamable HTTP and sends your API key in the `Authorization` header.

## Requirements

- The Cline VS Code extension or Cline CLI. Environment variable references in headers need Cline **v3.43.0 or later**.
- A FineProxy API key (starts with `fb_`). Create one in [Settings → API keys](https://fineproxy.org/account_new/settings#api-keys). Start with read-only [scopes](/developers/docs/authentication/#scopes).

## Set up

### Where the config lives

| Surface | Location |
| --- | --- |
| VS Code extension | Cline panel → **MCP Servers** icon → **Configure** tab → **Configure MCP Servers** (opens the extension's settings JSON) |
| Cline CLI | `~/.cline/data/settings/cline_mcp_settings.json` (override with `CLINE_MCP_SETTINGS_PATH`) |

`~` is your home folder.

### Option 1: edit the settings JSON

Add the `fineproxy` entry under `mcpServers`:

```json
{
  "mcpServers": {
    "fineproxy": {
      "type": "streamableHttp",
      "url": "https://fineproxy.org/account_new/api/v1/mcp",
      "headers": {
        "Authorization": "Bearer ${env:FINEPROXY_API_KEY}"
      }
    }
  }
}
```

> **Important:** Set `"type": "streamableHttp"` exactly (camelCase). Without `type`, Cline falls back to the legacy SSE transport, and the FineProxy server answers `405`.

### Option 2: add the server with the Cline CLI

```bash
cline mcp add fineproxy https://fineproxy.org/account_new/api/v1/mcp \
  --transport http \
  --header 'Authorization: Bearer ${env:FINEPROXY_API_KEY}' \
  --yes
```

Keep the single quotes around the header: they stop your shell from expanding `${env:...}`, so Cline saves the reference rather than its value. Without `--yes`, the command opens the add wizard with these fields filled in.

## Keep your key out of the config

Cline expands `${env:NAME}` in server URLs and headers. Set the variable before you start VS Code or the Cline CLI:

```bash
export FINEPROXY_API_KEY="fb_your_api_key"
```

If you start VS Code from the Dock, Start menu or a launcher, it may not see variables from your shell profile — start it from a terminal where the variable is set, or set the variable system-wide.

> **Warning:** Never commit a Cline settings file that contains a literal `fb_...` key. Keep only the `${env:FINEPROXY_API_KEY}` reference.

## Verify the connection

1. In the extension, open **MCP Servers**: `fineproxy` should show as connected with its tools. In the CLI, run `cline mcp` and choose **List servers**, or print the configuration with `cline config mcp`.
2. Ask Cline:

   ```text
   What is my FineProxy balance?
   ```

   Cline calls the `wallet_balance` tool and answers with your balance, for example `"balance_cents": 5000` — money values are integer cents, so that is $50.00.

## Tips

- **Approve tool calls.** Cline asks for approval before it runs a tool. The `autoApprove` list in the server entry skips that step — add only read-only tools such as `wallet_balance` to it, never order, renewal or cancellation tools.
- **Use a read-only key first.** For exploring, a key with `customer:read`, `wallet:read`, `services:read` and `catalog:read` is enough. Without `wallet:spend`, the agent can't run tools that debit your wallet.
- **Add `wallet:spend` only for purchases.** Create a separate key with `wallet:spend` when you want Cline to buy or renew. Purchase tools carry a price guard and an idempotency key: a wrong total is rejected without a charge, and a retry with the same key never charges twice.
- Read [MCP safety](/developers/docs/mcp/safety/) and the [scopes reference](/developers/docs/authentication/#scopes) before you give an agent spending rights.

## Troubleshooting

| Symptom | Cause and fix |
| --- | --- |
| `405 Method Not Allowed` | `type` is missing, so Cline uses legacy SSE. Add `"type": "streamableHttp"`. |
| Connection fails although the URL is right | Check the spelling of `type`: it must be `streamableHttp` (camelCase), not `streamable-http`. |
| `401` | `FINEPROXY_API_KEY` isn't visible to VS Code / Cline, or your Cline version doesn't expand `${env:...}` (update to v3.43.0 or later). |
| Cline offers an OAuth authorization | The `Authorization` header is missing. FineProxy MCP accepts API keys only. |
| `429 Too Many Requests` | Too many reconnects in a short time. Wait a moment and restart the server once from the MCP Servers panel. |

For server-side errors and tool failures, see [MCP troubleshooting](/developers/docs/mcp/troubleshooting/).
