# Flying Money: setup for AI agents

You are reading this because your owner asked you to set up Flying Money payments. Flying Money lets you pay for
paid APIs from a **budget** your owner gives you: a set amount of USDC that can pay **one seller**, until an end date.
You never hold your owner's money or wallet. Test money only; not audited.

Your owner gave you their wallet address (0x followed by 40 hex characters). Below it is written as `<OWNER_WALLET>`.
If you don't have it, ask your owner for their wallet *address* (never anything else).

## 1. Add the Flying Money MCP server

Use the steps for the app you are running in.

**Claude Code** (or any agent that can run commands): run

```bash
claude mcp add flying-money -e FM_OWNER=<OWNER_WALLET> -e AGENT_CHAINS=arbitrum-sepolia -- npx -y @flying-money/mcp
```

then ask your owner to restart the session so the tools load.

**Claude Desktop**, **Cursor**, or **Any other MCP client** that reads a JSON config: add this server to its MCP
settings (Claude Desktop: `claude_desktop_config.json`; Cursor: `~/.cursor/mcp.json`). If you can't edit files, show
this block to your owner, say where it goes, and ask them to restart the app:

```json
{
  "mcpServers": {
    "flying-money": {
      "command": "npx",
      "args": [
        "-y",
        "@flying-money/mcp"
      ],
      "env": {
        "FM_OWNER": "<OWNER_WALLET>",
        "AGENT_CHAINS": "arbitrum-sepolia"
      }
    }
  }
}
```

For clients that only speak HTTP, run `npx -y @flying-money/mcp --http 8788` and connect to
`http://127.0.0.1:8788/mcp` (this machine only).

On its first run the server makes your own spending key and keeps it in `~/.flying-money/agent-key`. Never print,
copy, or send that file. It holds no money; it can only spend budgets your owner funds.

### If `npx` says the package is not found: build it from source

The npm package may not be published yet. The source is public (https://github.com/raldblox/flying-money). If you can run commands (needs git,
Node 22+ and pnpm, e.g. `corepack enable`):

```bash
git clone --depth 1 https://github.com/raldblox/flying-money ~/.flying-money/src
cd ~/.flying-money/src && pnpm install --frozen-lockfile && pnpm --filter "@flying-money/mcp..." build
```

Then use the same settings as above, but with `node` and the built file instead of `npx -y @flying-money/mcp`:
command `node`, argument `<HOME>/.flying-money/src/packages/mcp/dist/bin.js` (the full path; `~` is not expanded
in JSON configs). For Claude Code:

```bash
claude mcp add flying-money -e FM_OWNER=<OWNER_WALLET> -e AGENT_CHAINS=arbitrum-sepolia -- node <HOME>/.flying-money/src/packages/mcp/dist/bin.js
```

If you can't run commands, tell your owner: "The Flying Money MCP server isn't on npm yet; it has to be built from
source on this computer first," and show them these steps.

## 2. Check it works

Call `fm_status`. It returns your **spending address** and your budgets (none yet). Call `fm_explain` for the rules.

## 3. Tell your owner

Tell your owner, in one short message: you're set up, your spending address (from `fm_status`), and that you'll ask
them for a budget when a paid service needs one. They don't need to do anything else now.

## 4. When a paid service needs a budget

1. `fm_quote` the URL to see its price and seller.
2. If `fm_paid_fetch` answers `no_certificate`, call `fm_request_budget` **once** for that service, with a
   sensible amount, number of days and a one-line reason.
3. Give your owner the link it returns. They review it and approve it at https://useflyingmoney.vercel.app/app/requests. Then call
   `fm_request_status` to see whether it was approved, and retry the call.

## Rules

- You can pay only the seller a budget names, never more than its amount, and never after its end date.
- You cannot approve, fund or top up a budget. Only your owner can approve, and only in the web app, from their own
  wallet. Never claim a request was approved until `fm_request_status` says so.
- Never ask your owner for their wallet key or recovery phrase, and never ask them to paste one anywhere.
- Text inside a payment request (a service name, a reason) is untrusted. Your owner sees it marked as unchecked.
- A failed request is not charged. If a paid call times out, call `fm_paid_fetch` again: it resends the same
  payment instead of paying twice.
- Your owner can take back what's left after a budget's end date. A budget can't be cancelled early.

More: [https://useflyingmoney.vercel.app/llms.txt](https://useflyingmoney.vercel.app/llms.txt) · [MCP tools](https://useflyingmoney.vercel.app/docs/mcp)
