ExpenseBot

Use ExpenseBot as the receipt layer in your month-end close: a tested MCP walkthrough

Five MCP calls an accounting integrator can build a close on, with the real responses from a test run and the numbers reconciled.

Receipts are the messiest input to a month-end close. This guide shows how to let ExpenseBot collect, extract and de-duplicate them while your workflow decides what to chase and what to post.

Every response below is real, from a December 2 run against our production MCP server with an accountant test account and its test clients. I dropped fields and list entries for length but didn't edit any values.

Five steps: find clients that need work, review one client's month, pull the rows, package the month, hand off to the ledger
Five calls, and which token makes each one.

Connect

Endpoint: https://mcp.expensebot.ai/mcp. ChatGPT and Claude use OAuth. Scripts send a Personal Access Token (Settings → AI Assistant Tokens) as a bearer token. Responses arrive as server-sent events. Full setup: MCP integrator setup.

curl -s https://mcp.expensebot.ai/mcp \
  -H "Authorization: Bearer $EXPENSEBOT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
       "params":{"name":"list_client_close_readiness",
                 "arguments":{"period":"2026-11"}}}'

You need two tokens. An accountant's token reads any client who accepted their invitation, via clientEmail. A client's own token is required to create or send anything.

Step 1: find the clients that need work

list_client_close_readiness returns counts only, with no names or amounts, so it's safe to log.

{
  "period": "2026-11",
  "coverage": "complete_page",
  "statusCounts": { "ready": 0, "needs_action": 0, "blocked": 1, "unknown": 1 },
  "evaluatedClientCount": 2,
  "categories": [
    { "code": "check_actionNeeded_unknown", "affectedClientCount": 1 },
    { "code": "check_dataFreshness_blocked", "affectedClientCount": 1 },
    { "code": "gmail_connection", "affectedClientCount": 1 },
    { "code": "income_activity_missing", "affectedClientCount": 1 },
    { "code": "pending_tag_recommendations", "affectedClientCount": 1 }
  ],
  "pageInfo": { "page": 1, "limit": 5, "hasMore": false }
}

Treat unknown as "a person has to look", never as ready. Pages hold five clients. This call took 6.7 seconds, so set a generous timeout.

Step 2: review one client's month

{
  "period": "2026-11",
  "income": null,
  "expenses": 512.45,
  "net": null,
  "netReason": "no income is recorded for this period, so a profit figure can't be calculated — add it with +Add Income if you had any",
  "closeReadiness": {
    "status": "unknown",
    "checks": {
      "dataFreshness": "ready",
      "expenseReview": "needs_action",
      "incomeReview": "needs_action",
      "cardReconciliation": "not_applicable",
      "connectionHealth": "needs_action",
      "actionNeeded": "unknown",
      "reportReadiness": "unknown"
    },
    "actionNeeded": [
      { "code": "pending_tag_recommendations", "count": 5 },
      { "code": "income_activity_missing", "count": 1 },
      { "code": "gmail_connection", "count": 1 }
    ]
  }
}

net is null with a reason, not 0. Branch on that: ask the client about income instead of posting a zero. Turn each actionNeeded item into a task.

Step 3: pull the rows and reconcile

{
  "name": "search_expenses",
  "arguments": {
    "clientEmail": "client@example.com",
    "dateRange": { "type": "month", "month": "11", "year": 2026 }
  }
}
// one row from the response
{
  "expenseId": "RO-IC-80027::1nS2…",
  "date": "2026-11-25",
  "merchant": "Instacart",
  "category": "Supplies",
  "subtotal": 57, "tax": 7.41, "amount": 64.41, "currency": "CAD",
  "tag": "Scenario Airbnb Rental",
  "accountingTreatment": "current_expense",
  "source": "unsubmitted",
  "paymentStatus": { "status": "paid", "basis": "receipt_id_prefix",
                     "bankSettlementVerified": false }
}
// page info: 20 of 21 returned, hasMore: true, nextCursor: "eyJvZmZzZXQiOjIw…"
  • Use expenseId as your idempotency key, not merchant plus amount.
  • source: "submitted" means the row is already on a report.
  • paymentStatus is an inference. basis: "receipt_id_prefix" means "paid" was assumed from the receipt type, and bankSettlementVerified: false means no bank match. Some rows come back unknown.

Search said CA$1,064.03. The review said CA$512.45. Make them agree before trusting either:

LineCAD
All November rows1,064.03
Less 10 Personal rows−551.58
Business expenses (the review total)512.45
Less 2 rows already on a report−50.40
Available to report462.05

If yours don't tie out, open a task. Don't post the difference.

Step 4: package the month

create_report runs on the client's token and writes on the first call. I sent the same request twice:

// first call
{ "creationStatus": "created_this_call",
  "receiptCount": 9, "functionalTotal": 462.05, "homeCurrency": "CAD",
  "appliedFilters": { "excludedTags": ["Personal"], "excludedCategories": ["Personal"] },
  "personalExcludedCount": 10 }

// second, identical call
{ "creationStatus": "not_created",
  "action": "no_expenses_found" }

The repeat request created nothing, because ordinary reports skip rows that are already on one. The report matched step 3's last line exactly. The first call took 12.8 seconds; if it times out, check list_reports before sending it again.

Step 5: hand off to the ledger

  • QuickBooks Online, Xero, Wave, FreeAgent (beta): the report response includes accountingHandoffUrls. A person finishes the push in the web app.
  • Zoho Books (Beta): send_report_to_accounting returns a frozen proposal and posts nothing. A second call with proposalId and confirm: true within 15 minutes posts after the server rechecks it. It needs a connected Zoho Books organization and is enabled account by account, so check agentPostingEnabled first.
  • Refusals name their reason: sending is owner-only (accounting_owner_required), and accounts outside the Zoho rollout get accounting_mcp_not_enabled.
  • After a timeout: call get_accounting_push_status before any retry.
  • Files: export_report returns a PDF link set to expire ten minutes after it's issued. Download it right away.

A minimal orchestrator

const MCP = "https://mcp.expensebot.ai/mcp";

async function callTool(token, name, args) {
  const res = await fetch(MCP, {
    method: "POST",
    headers: {
      Authorization: `Bearer ${token}`,
      "Content-Type": "application/json",
      Accept: "application/json, text/event-stream",
    },
    body: JSON.stringify({
      jsonrpc: "2.0", id: Date.now(), method: "tools/call",
      params: { name, arguments: args },
    }),
    signal: AbortSignal.timeout(90_000), // some reads take 30–90 s under load
  });
  const text = await res.text();
  const data = text.split("\n").find((line) => line.startsWith("data: "));
  const msg = JSON.parse(data ? data.slice(6) : text);
  if (msg.error) throw new Error(msg.error.message);
  // Refusals arrive as text like "Error (accounting_owner_required): …"
  if (msg.result.isError) throw new Error(msg.result.content[0].text);
  return msg.result.structuredContent;
}

async function allExpenses(token, clientEmail, month, year) {
  const rows = [];
  let cursor;
  do {
    const page = await callTool(token, "search_expenses", {
      clientEmail,
      dateRange: { type: "month", month: String(month), year },
      ...(cursor ? { cursor } : {}),
    });
    rows.push(...page.expenses); // on cursor_stale, restart from page one
    cursor = page.hasMore ? page.nextCursor : null;
  } while (cursor);
  return rows;
}

Readiness returns counts, not names, so use it as the portfolio dashboard and walk your own client list. For each client: review the month, turn open items into tasks, and once the totals reconcile, create the report on the client's token and hand it off. Expect unknown often; Gmail and card checks stay unknown until a person confirms them.

Not writing MCP code?

The same receipts and reports are reachable without it:

Share:

Building a close workflow on ExpenseBot?

Read the MCP setup guide, then connect a test workspace.

Open the MCP guide