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,
geminion yourPATH. - A FineProxy API key (starts with
fb_). Create one in Settings → API keys. Start with read-only scopes.
Set up
Where the config lives
| Scope | Path |
|---|---|
| User | ~/.gemini/settings.json |
| Project | .gemini/settings.json in the project folder |
~ is your home folder.
Option 1: add the server with the CLI
-
Put your key in an environment variable:
export FINEPROXY_API_KEY="fb_your_api_key" -
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/mcpThe single quotes keep
$FINEPROXY_API_KEYas a reference insettings.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 addisproject, which writes.gemini/settings.jsoninside the current folder. Pass--scope userunless 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 ofsettings.jsonwhen it loads the settings, soheaderscan referenceFINEPROXY_API_KEYinstead of holding the key. - A variable that isn’t set resolves to an empty string, and the server then answers
401.
Warning:
.gemini/settings.jsonin a project folder is easy to commit. Keep only variable references in it, never a literalfb_...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": truefor the FineProxy server and don’t add it with--trust: both skip all confirmations, including for purchases. - Expose only what you need.
includeToolsandexcludeToolsin 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:readandcatalog:readis enough. Withoutwallet:spend, the agent can’t run tools that debit your wallet. - Add
wallet:spendonly for purchases. Create a separate key withwallet:spendwhen 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
| Symptom | Cause and fix |
|---|---|
| Connection errors with a correct URL | The entry uses url (SSE) instead of httpUrl. Rename the field. |
401 | FINEPROXY_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 folder | It 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 startup | Run /mcp list or gemini mcp list to see the connection error. |
429 Too Many Requests | Too many sessions connecting at once. Wait a moment and start again. |
For server-side errors and tool failures, see MCP troubleshooting.