NEW! |One API call, clean data back. No scrapers needed.Get 10,000 Free Tokens →

Connect Gemini CLI to FineProxy MCP

Add the FineProxy MCP server to Gemini CLI with httpUrl and an Authorization header that reads the API key from an environment variable.

This page shows how to connect Gemini CLI to the FineProxy MCP server. Gemini CLI connects directly over Streamable HTTP and sends your API key in the Authorization header.

Requirements

  • Gemini CLI, gemini on your PATH.
  • A FineProxy API key (starts with fb_). Create one in Settings → API keys. Start with read-only scopes.

Set up

Where the config lives

ScopePath
User~/.gemini/settings.json
Project.gemini/settings.json in the project folder

~ is your home folder.

Option 1: add the server with the CLI

  1. Put your key in an environment variable:

    export FINEPROXY_API_KEY="fb_your_api_key"
  2. Add the server to your user settings:

    gemini mcp add --transport http --scope user \
      -H 'Authorization: Bearer $FINEPROXY_API_KEY' \
      fineproxy https://fineproxy.org/account_new/api/v1/mcp

    The single quotes keep $FINEPROXY_API_KEY as a reference in settings.json; Gemini CLI resolves it when it loads the settings. With double quotes, your shell would write the key value itself into the file.

Important: The default scope of gemini mcp add is project, which writes .gemini/settings.json inside the current folder. Pass --scope user unless you really want a project entry.

Option 2: edit settings.json

Add the fineproxy entry under mcpServers:

{
  "mcpServers": {
    "fineproxy": {
      "httpUrl": "https://fineproxy.org/account_new/api/v1/mcp",
      "headers": {
        "Authorization": "Bearer $FINEPROXY_API_KEY"
      }
    }
  }
}

Use httpUrl for Streamable HTTP. The url field is for SSE servers.

Keep your key out of the config

  • Gemini CLI resolves $VAR_NAME, ${VAR_NAME} and ${VAR_NAME:-default} in string values of settings.json when it loads the settings, so headers can reference FINEPROXY_API_KEY instead of holding the key.
  • A variable that isn’t set resolves to an empty string, and the server then answers 401.

Warning: .gemini/settings.json in a project folder is easy to commit. Keep only variable references in it, never a literal fb_... key.

Verify the connection

Check the connection from your shell:

gemini mcp list

A working entry shows fineproxy: https://fineproxy.org/account_new/api/v1/mcp (http) - Connected. In an interactive session, run /mcp to see the server status and its tools, then ask:

What is my FineProxy balance?

Gemini CLI asks you to confirm the wallet_balance tool call, runs it and answers with your balance, for example "balance_cents": 5000 — money values are integer cents, so that is $50.00.

Tips

  • Approve tool calls. Gemini CLI asks for confirmation before each tool call. Don’t set "trust": true for the FineProxy server and don’t add it with --trust: both skip all confirmations, including for purchases.
  • Expose only what you need. includeTools and excludeTools in the server entry limit which FineProxy tools the model can see.
  • 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 Gemini CLI 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 and the scopes reference before you give an agent spending rights.

Troubleshooting

SymptomCause and fix
Connection errors with a correct URLThe entry uses url (SSE) instead of httpUrl. Rename the field.
401FINEPROXY_API_KEY isn’t set in the shell that starts gemini, so the header becomes Bearer with no key.
The server is only available in one folderIt was added with the default project scope. Remove it with gemini mcp remove --scope project fineproxy and add it again with --scope user.
“MCP issues detected” at startupRun /mcp list or gemini mcp list to see the connection error.
429 Too Many RequestsToo many sessions connecting at once. Wait a moment and start again.

For server-side errors and tool failures, see MCP troubleshooting.