# MCP troubleshooting

Fix the common problems with the FineProxy MCP server, from 401 and 429 responses and missing tools to clients without header support and tool errors.

- Canonical: https://fineproxy.org/developers/docs/mcp/troubleshooting/

Find your symptom in the table, then read the matching section for details. To check the server and your key without any AI client in between, run the [Inspector or curl tests](/developers/docs/mcp/quickstart/#test-without-a-client) first: if they work, the problem is in the client configuration.

## Quick reference

| Symptom | Likely cause | Fix |
| --- | --- | --- |
| HTTP `401`, "Missing or malformed Authorization header" | Header not sent, or sent without `Bearer ` | [Fix the header](#401-unauthorized) |
| HTTP `401`, "Invalid or revoked API key." | Wrong, mistyped or revoked key; literal `${env:...}` sent | [Fix the key](#401-unauthorized) |
| HTTP `429`, "Too Many Requests" | Too many calls per second, often several clients on one account | [Slow down](#429-too-many-requests) |
| HTTP `405` | Client uses the legacy SSE transport or sends `GET` | Select Streamable HTTP; in Cline set `"type": "streamableHttp"` |
| Server connected, but no tools | Wrong config file or field name, client not restarted | [Tools missing](#tools-dont-appear-in-the-client) |
| Client config has no `headers` field | Client supports only local stdio servers | [Use `mcp-remote`](#your-client-cant-send-headers) |
| ChatGPT asks for OAuth or can't connect | ChatGPT connectors need OAuth | [Not supported](#chatgpt-is-not-supported) |
| `'C:\Program' is not recognized…` on Windows | Spaces in `mcp-remote` arguments | [Windows fix](#windows-and-npx) |
| Tool result `isError: true` | Business rule or invalid arguments | [Common tool errors](#common-tool-errors) |
| A tool call hangs for several seconds | Some tools are slow by design | [Long-running tools](#long-running-tools-and-timeouts) |

## 401 Unauthorized

The server answers `401` with `WWW-Authenticate: Bearer` and a `detail` message:

```json
{ "detail": "Missing or malformed Authorization header. Expected: Bearer <api_key>." }
```

The header must be exactly `Authorization: Bearer fb_...`. Check:

- **The prefix.** Most config files need the full value `Bearer fb_...`. Clients with a dedicated token field add `Bearer ` themselves: in n8n's Bearer Auth credential and in VS Code's `${input:...}` prompt, paste only `fb_...`, otherwise the server receives `Bearer Bearer fb_...`.
- **Environment variables.** If the config uses `${env:FINEPROXY_API_KEY}` (Cursor, Cline, Windsurf) or `${FINEPROXY_API_KEY}` (Claude Code, Copilot `.mcp.json`) and the variable isn't visible to the client, the literal placeholder is sent. GUI apps started from the Dock or Start menu often don't read your shell profile: start the client from a terminal where the variable is set, or set it system-wide. For Codex CLI, `bearer_token_env_var` holds the variable *name*; the variable must be set in the shell that starts Codex.
- **The key itself.** Keys are shown once at creation. If you're not sure you copied it correctly, or it was revoked, create a new one in [Settings → API keys](https://fineproxy.org/account_new/settings#api-keys).
- **Notifications too.** Custom clients must send the header on every `POST`, including `notifications/initialized`.

## 429 Too Many Requests

```json
{ "detail": "Too Many Requests" }
```

The limit is per account and shared with the REST API. Bursts above about 2 requests per second get `429`, and so do many `initialize` calls in a row, for example when several clients or Inspector sessions start at once.

- Wait and retry with exponential backoff. The `x-ratelimit-reset` response header tells you when the window resets.
- Don't run several agents on one account in parallel; if you must, space their calls out.
- When testing with Inspector or curl, leave a couple of seconds between commands.

## Tools don't appear in the client

1. **Restart the client** after editing its config. Claude Desktop must be quit completely (Cmd+Q on macOS), not just closed.
2. **Check that you edited the file the client reads.** Common mix-ups: project vs global `mcp.json` in Cursor; `.vscode/mcp.json` (editor, `"servers"`) vs `.mcp.json` (Copilot harness, `"mcpServers"`) in VS Code; `~/.config/devin/mcp_config.json` vs `~/.codeium/windsurf/mcp_config.json` in Windsurf (use **Open MCP config file** in Cascade). Claude Code adds servers to the `local` scope by default, so they're missing in other directories; re-add with `--scope user`.
3. **Check the field names.** Remote servers need a type or URL field the client recognizes:

| Client | Required fields |
| --- | --- |
| Cursor | `url`, `headers` |
| Claude Code (`.mcp.json`) | `"type": "http"`, `url`, `headers`; without `type` the entry is skipped |
| VS Code | `"type": "http"`, `url`, `headers` |
| Cline | `"type": "streamableHttp"` (camelCase), `url`, `headers` |
| Windsurf | `serverUrl`, `headers` |
| Gemini CLI | `httpUrl` (not `url`, which means SSE), `headers` |
| Codex CLI | `url`, `bearer_token_env_var` |

4. **Look at the logs.** Cursor: **Output → MCP Logs**. VS Code: **MCP: List Servers**. JetBrains: the MCP status column and logs. A `401` in the logs means the key; see above.
5. **Cursor cloud agents** don't read `~/.cursor/mcp.json`; configure MCP for them separately.

Step-by-step setups are in the [client guides](/developers/docs/mcp/#supported-clients).

## Your client can't send headers

Some clients start only local (stdio) servers or have no field for HTTP headers: Claude Desktop's `claude_desktop_config.json`, JetBrains AI Assistant's HTTP configuration, and others. Use the [`mcp-remote`](https://github.com/punkpeye/mcp-remote) bridge: the client starts it as a local process, and it forwards every message to FineProxy over HTTP with your header. It needs Node.js (`npx`).

```json
{
  "mcpServers": {
    "fineproxy": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://fineproxy.org/account_new/api/v1/mcp",
        "--transport",
        "http-only",
        "--header",
        "Authorization:${FP_AUTH}"
      ],
      "env": {
        "FP_AUTH": "Bearer fb_your_api_key"
      }
    }
  }
}
```

What to watch:

- `--transport http-only` makes the bridge use Streamable HTTP directly.
- The whole value `Bearer fb_...` goes into the `FP_AUTH` environment variable, and the header argument has **no spaces** around the colon: `Authorization:${FP_AUTH}`.
- Instead of `--header`, you can pass `--header-file` with a path to a file (permissions `600`) that contains the line `Authorization: Bearer fb_...`, so the key isn't in the client config at all.

To test the bridge from a terminal:

```bash
export FP_AUTH="Bearer $FINEPROXY_API_KEY"

npx -y @modelcontextprotocol/inspector --cli --method tools/list --transport stdio \
  -e FP_AUTH="$FP_AUTH" -- \
  npx -y mcp-remote https://fineproxy.org/account_new/api/v1/mcp \
    --transport http-only \
    --header "Authorization:\${FP_AUTH}"
```

Claude Desktop also has custom connectors (**Settings → Connectors → Add → Custom → Web**), where you can set request headers without the bridge. That connection is made from Anthropic's servers rather than your computer.

## ChatGPT is not supported

ChatGPT custom MCP connectors authenticate with OAuth (or with no authentication) and have no field for a static bearer token. The FineProxy MCP server uses API keys only, so ChatGPT can't connect to it today. Use a client from the [supported list](/developers/docs/mcp/#supported-clients). Don't work around this by pasting your API key into a ChatGPT conversation.

## Windows and npx

- **`'C:\Program' is not recognized as an internal or external command`** when Claude Desktop starts `mcp-remote`: a space in an argument breaks the command line. Keep the header argument without spaces (`Authorization:${FP_AUTH}`) and put `Bearer fb_...` into `env`, exactly as in the bridge config above.
- **Config locations on Windows**: Cursor `%USERPROFILE%\.cursor\mcp.json`, Claude Desktop `%APPDATA%\Claude\claude_desktop_config.json`, Windsurf `%AppData%/devin/mcp_config.json`.

## Common tool errors

When a tool fails, the HTTP status is still `200`; the result has `isError: true` and a text the agent should show you. These are the ones you're most likely to see:

| Error text (start) | Meaning | What to do |
| --- | --- | --- |
| `Invalid arguments: Total order IP count (5) is below the tenant minimum of 100 IPs per order` | Composite orders and quotes need at least 100 IPs in total | Ask for 100 or more, across one or several countries |
| `Invalid arguments: Price mismatch: expected_total_cents=1199, actual quote is 1200 cents. Nothing was charged.` | The price changed or the agent passed a wrong number | Quote again and order with the new total |
| `Invalid arguments: geo_counts must contain at least one country.` | `quote_refresh` without `partial` needs the target countries | Pass `geo_counts`, for example `{"DE": 100}`, or use `partial: true` |
| `ServiceNotFoundError: Rotating config not available for service ...` | `get_proxy_config` works only for rotating proxies | For datacenter services use `get_proxy_credentials` and `list_proxy_ips` |
| `SERVICE_CANCEL_COOLDOWN: self-service cancellation is limited to once every 3 days. ...` | Another service was cancelled in the last 3 days | Wait until `retry_at`, or open a support ticket |
| `Request rejected (404): Deposit not found` | Unknown ID passed to a lookup tool | Get the ID from the list tool (`list_payments`, `list_services`, …) |
| `Invalid arguments: attachment_id must be a valid UUID` | Missing or malformed ID | Take IDs from earlier results; don't let the agent guess them |
| `ServiceManagerError: Shortfall restore is not enabled for this environment.` | The imported-contract restore isn't available for your account | Contact support if you believe IPs are missing |

**Missing scope.** Each tool needs the scopes listed at the end of its description (`[requires scopes: ...]`). If a tool that worked for one key fails for another, compare the keys' scopes. Purchases need `wallet:spend`, changes need `services:write`, top-up links need `wallet:deposit`. See the [scope table](/developers/docs/mcp/safety/#scopes-are-the-guardrail).

A result with `degraded: true` from an analytics tool isn't an error: a data source was temporarily unavailable. Ask again shortly instead of reading the numbers as zero traffic.

## Long-running tools and timeouts

Most tools answer in under a second. Some take longer:

| Tool | Typical duration |
| --- | --- |
| `list_countries` | About 10 seconds |
| `quote_composite` | Usually under a second, once about 11 seconds |
| `order_composite` | About 40 seconds for a first call in testing; a retry with the same key about 2 seconds |

If your client or workflow has a short tool timeout, raise it to at least 120 seconds (for example `"timeout": 120000` in JetBrains Junie's `mcp.json`). If a paid call timed out, don't start a new order: retry with the same `idempotency_key`, or check `list_services` and `list_ledger` first. A retry with the same key returns the original order without charging twice.

## Collecting information for support

If you contact support, include:

- The `x-request-id` header of the failing response. It's on every response; with curl, add `-i` to see it. Some clients also show response headers in their MCP logs.
- The time of the request (with time zone), the tool name and the arguments, with the API key removed.
- The full `isError` text or HTTP status and `detail` body.
- Your client and its version, and whether you connect directly or through `mcp-remote`.

```bash
curl -sS -i -X POST "https://fineproxy.org/account_new/api/v1/mcp" \
  -H "Authorization: Bearer $FINEPROXY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","method":"tools/call","id":1,"params":{"name":"wallet_balance","arguments":{}}}'
```

Never send your API key to support. You can open a ticket in the dashboard, or ask the agent to do it with `create_ticket` (needs `tickets:write`).
