Connect Claude Code to FineProxy MCP
Add the FineProxy MCP server to Claude Code with one CLI command or a shared .mcp.json file, and keep your API key in an environment variable.
This page shows how to connect Claude Code to the FineProxy MCP server. Claude Code talks to the server directly over HTTP and sends your API key in the Authorization header — no bridge or Node.js package is needed.
Requirements
- Claude Code installed, with
claudeon yourPATH. - A FineProxy API key (starts with
fb_). Create one in Settings → API keys. Start with read-only scopes.
Set up
Choose a scope
Claude Code stores MCP servers in one of three scopes:
| Scope | Where it is stored | Available in |
|---|---|---|
local (default) | ~/.claude.json, under the current project path | The current project only, for you |
user | ~/.claude.json | All your projects |
project | .mcp.json in the repository root | Everyone who clones the repository |
~ is your home folder. For personal use, user is the most convenient scope.
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:
claude mcp add --transport http --scope user fineproxy \ https://fineproxy.org/account_new/api/v1/mcp \ --header "Authorization: Bearer $FINEPROXY_API_KEY"The command prints an
Added ...line on success. Your shell expands$FINEPROXY_API_KEYwhen you run the command: the key value is saved in~/.claude.json, while this command in your shell history contains only the variable name.
Option 2: share the server with your team in .mcp.json
Create .mcp.json in the repository root. Remote servers must include "type": "http":
{
"mcpServers": {
"fineproxy": {
"type": "http",
"url": "https://fineproxy.org/account_new/api/v1/mcp",
"headers": {
"Authorization": "Bearer ${FINEPROXY_API_KEY}"
}
}
}
}
Each teammate sets FINEPROXY_API_KEY with their own key before starting claude. The first time you run claude in the repository, it asks you to approve the project server.
Keep your key out of the config
- Claude Code expands
${VAR}and${VAR:-default}inurlandheadersof.mcp.json. Use${FINEPROXY_API_KEY}and set the variable in the shell that startsclaude. - Use a dedicated variable such as
FINEPROXY_API_KEY. Claude Code deliberately reads its own and cloud-provider credential variables (for exampleANTHROPIC_API_KEY) as empty in remoteheaders, so the server would receiveBearerwith no key. - If a
${VAR}reference points to a variable that is not set,claude mcp listand/mcpwarn about it and the server receives the text unexpanded.
Warning:
.mcp.jsonis meant to be committed. Never put a literalfb_...key in it — keep only the${FINEPROXY_API_KEY}reference.
Verify the connection
Check the server status from your terminal:
claude mcp list
claude mcp get fineproxy
claude mcp list shows a status next to each server, for example ✔ Connected or ✘ Failed to connect with the HTTP status. A .mcp.json server shows ⏸ Pending approval until you approve it in an interactive claude session.
Inside a session, run /mcp to see fineproxy with its tool count, then ask:
What is my FineProxy balance?
Claude calls the wallet_balance tool and answers with your balance. The tool result looks like this:
{
"balance_cents": 5000,
"currency": "USD",
"wallet_id": "00000000-0000-0000-0000-000000000000",
"has_wallet": true
}
Money values are integer cents: 5000 means $50.00.
Tips
- Approve tool calls. Claude Code asks for permission before it uses a tool. Read the arguments of order, renewal and cancellation tools before you allow them, and don’t allow money-moving tools permanently.
- 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 the agent 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 |
|---|---|
| The server is missing when you work in another folder | It was added with the default local scope. Remove it and add it again with --scope user, or use .mcp.json. |
The .mcp.json server is ignored | The entry has url but no "type": "http", so it is treated as an invalid local server. Add the type field. |
✘ Failed to connect with 401 | The key is missing, wrong or read as empty. Check that FINEPROXY_API_KEY is set in the shell that starts claude and that you don’t reference an ANTHROPIC_* variable. |
⏸ Pending approval | Run claude in the repository and approve the project server. |
Warning about whitespace in headers.Authorization | The pasted key has a trailing space or newline. Remove it. |
! Needs authentication / OAuth prompt | The Authorization header is missing. FineProxy MCP accepts API keys only; there is no OAuth sign-in. |
429 Too Many Requests | Too many sessions connecting at once. Wait a moment and reconnect from /mcp. |
For server-side errors and tool failures, see MCP troubleshooting.