FlyExpense

FlyExpense + Claude (MCP): Sign Up, Onboard & Query Your Finance Data by Chat

Connect FlyExpense to Claude, ChatGPT and Cursor with the Model Context Protocol. Query finance data, and even sign up and complete KYB onboarding entirely by chat. Step-by-step guide with diagrams and commands.

FlyExpense now ships a Model Context Protocol (MCP) server, so you can connect your AI assistant — Claude (web, Desktop), Cursor, or ChatGPT — directly to your finance workspace. Ask questions about your cards, expenses, bills and reports in plain language, and even create an account and finish KYB onboarding entirely inside a chat.

What is MCP, in one paragraph

The Model Context Protocol is an open standard that lets AI assistants connect to external tools and data in a safe, structured way. When an assistant connects to an MCP server, it discovers the available "tools" and calls them with your permission. FlyExpense exposes two connectors: a secured one for your live finance data, and a public one for signing up and onboarding.

The big picture

                 ┌─────────────────────────────┐
   You (chat)    │   Claude / ChatGPT / Cursor │
  ────────────►  │        (MCP client)         │
                 └──────────────┬──────────────┘
                                │  MCP = JSON-RPC over HTTP
                 ┌──────────────┴───────────────┐
                 ▼                               ▼
        /mcp  (OAuth 2.1)              /mcp/public  (no login)
   read-only data + onboarding         register + onboarding
                 │                               │
                 └───────────────┬───────────────┘
                                 ▼
                       FlyExpense backend
                   (organization-scoped, multi-tenant)

There are two URLs:

  • https://flyexpense.com/mcp — the secured connector. Uses OAuth 2.1 for claude.ai web, or a Bearer token for Claude Desktop and Cursor. Exposes read-only finance tools (cards, expenses, bills, reports) plus onboarding tools bound to your organization.
  • https://flyexpense.com/mcp/public — the public connector. No login required. Exposes only the sign-up and onboarding tools, so a brand-new user can register and complete KYB by chat.

Part 1 — Connect from claude.ai (web)

claude.ai web cannot reach localhost, so always use the published domain.

  1. Open claude.ai → Settings → Connectors → Add custom connector.
  2. Paste the URL: https://flyexpense.com/mcp
  3. Claude opens a browser login + consent screen (OAuth 2.1). Approve it.
  4. Done — ask things like "Show my largest expenses this month" or "List unpaid bills".

Why OAuth? The claude.ai web UI has no field for a static token; it only performs OAuth discovery. The handshake is automatic — you just log in and approve.

Part 2 — Connect from Claude Desktop or Cursor (token)

Desktop apps support a Bearer token via the mcp-remote bridge. First create an MCP token from the Developer page in FlyExpense, then add this to your Claude Desktop config:

{
  "mcpServers": {
    "flyexpense": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://flyexpense.com/mcp",
        "--header",
        "Authorization: Bearer mcp_YOUR_TOKEN_HERE"
      ]
    }
  }
}

For Cursor, add an MCP server with the same URL and an Authorization: Bearer mcp_... header.

Part 3 — Sign up & onboard by chat (no account yet)

This is the new part. With the public connector, a new user can register and complete KYB without ever leaving the chat.

register_account
      │  ──► returns a short-lived "oba_…" onboarding token
      ▼
update_business_info ──► update_representative
      │
      ▼
upload_kyb_document   (PDF / PNG / JPEG / WebP, up to 8MB)
      │
      ▼
submit_onboarding     (accept_terms: true)  ──►  KYB SUBMITTED

Add https://flyexpense.com/mcp/public as a custom connector (no login), then simply tell the assistant: "Open a FlyExpense account for Acme Ltd" and follow along. The assistant calls the tools for you; you confirm details in chat.

Why an onboarding token?

MCP clients cannot change the Authorization header mid-conversation. So register_account returns a short-lived oba_ token that the other onboarding tools accept as a parameter. The token is scoped to exactly one organization and one KYB application, expires in 24 hours, and is consumed when you submit. It is not a data token — it can never read your finance data.

Part 4 — The tool reference

Public connector (/mcp/public):

  • register_account — creates your organization and admin user; returns the onboarding token.
  • get_onboarding_status — shows what is done and what is still required.
  • update_business_info — legal name, business type, tax IDs, address.
  • update_representative — the authorized representative's details.
  • upload_kyb_document — upload a verification document inside the chat (base64), or…
  • request_document_upload — …get a secure browser link to upload instead.
  • submit_onboarding — submits the application; requires accepting the terms.

Secured connector (/mcp): everything above (bound to your org, no token parameter) plus read-only data tools for cards, expenses, bills, vendors and reports.

Part 5 — Try it from the terminal

You don't need Claude to test the server — any HTTP client works. List the tools on the public connector:

curl -X POST https://flyexpense.com/mcp/public \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

Register a brand-new account:

curl -X POST https://flyexpense.com/mcp/public \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/call",
    "params": {
      "name": "register_account",
      "arguments": {
        "email": "you@company.com",
        "password": "Str0ngPassw0rd!",
        "fullName": "Your Name",
        "companyName": "Your Company Ltd"
      }
    }
  }'

The response contains an oba_… onboarding token. Pass it to the next tools:

curl -X POST https://flyexpense.com/mcp/public \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "submit_onboarding",
      "arguments": {
        "onboarding_token": "oba_xxx",
        "accept_terms": true
      }
    }
  }'

Security notes

  • The secured connector is strictly read-only for finance data; the only write tools are the guided onboarding tools.
  • Every tool is organization-scoped — you only ever see your own tenant's data.
  • OAuth and static tokens are both bound to your organization; a token is rejected if its organization no longer matches yours.
  • Onboarding tokens are short-lived, single-application, and consumed on submit.

Conclusion

Whether you are an existing user or starting from scratch, the FlyExpense MCP server lets you run your finance operations at the speed of chat. Add the /mcp connector for claude.ai web, or /mcp/public to sign up by chat, and get started.

Frequently Asked Questions

Why does claude.ai web need OAuth instead of a token?

The claude.ai web UI has no field for a static token; it only performs OAuth 2.1 discovery. When you add the /mcp URL, Claude opens an in-browser login and consent screen automatically — you just log in and approve.

Is my finance data safe? What can the AI actually do?

The data tools are strictly read-only and organization-scoped, so the assistant can view but never modify your cards, expenses, bills and reports, and only ever sees your own tenant. The only write-enabled tools are the guided onboarding tools.

What is the oba_ onboarding token and why is it needed?

MCP clients cannot change the Authorization header mid-conversation, so register_account returns a short-lived oba_ token that onboarding tools take as a parameter. It is scoped to one organization and one KYB application, expires in 24 hours, is consumed on submit, and can never read finance data.