@expensebot/mcp-server-auth 0.6.6 → 0.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +2 -2
- package/src/client.js +1 -1
- package/src/index.js +46 -4
- package/src/test.js +11 -1
- package/scripts/descriptions.generated.json +0 -10
package/README.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Authenticated MCP (Model Context Protocol) server for [ExpenseBot](https://www.expensebot.ai). Lets Claude Desktop, Cursor, Claude Code, Continue, Cline, Windsurf, and any MCP-compatible AI assistant search receipts, submit photos, scan Gmail, create reports, and analyze spending using your real ExpenseBot account.
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**46 tools** across:
|
|
6
6
|
- **Search & analytics** — `search_expenses`, `get_spending_summary`, `get_deep_analytics`, `list_categories`, `list_tags`, `list_income_categories`, `search_knowledge`
|
|
7
7
|
- **Income & P&L** *(v0.6.0)* — `get_income_summary`, `get_pnl`, `get_per_tag_pnl`
|
|
8
8
|
- **Mileage & Subscriptions** *(v0.6.1)* — `get_mileage_summary`, `get_subscription_audit`
|
|
9
|
-
- **Receipt capture** — `submit_receipt` (photo/PDF), `add_cash_expense`, `add_mileage_entry`, `add_income`, `parse_expense`, `get_expense_by_id`, `update_expense`, `get_spreadsheet_url`
|
|
9
|
+
- **Receipt capture** — `submit_receipt` (photo/PDF), `get_last_receipt_result`, `add_cash_expense`, `add_mileage_entry`, `add_income`, `parse_expense`, `get_expense_by_id`, `update_expense`, `get_spreadsheet_url`
|
|
10
10
|
- **Gmail** — `scan_gmail`, `process_gmail_receipts`, `scan_gmail_years`, `get_scan_status`
|
|
11
11
|
- **Reports & invoicing** — `create_report`, `list_reports`, `get_report_details`, `share_report`, `export_report`, `list_client_invoices`
|
|
12
12
|
- **Expense review** — `get_expense_splits`, `get_monthly_books_review`, `get_credits_refunds`
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expensebot/mcp-server-auth",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.8",
|
|
4
4
|
"mcpName": "io.github.TotesMagotes/mcp-server-auth",
|
|
5
5
|
"description": "Authenticated MCP server for ExpenseBot — lets Claude Desktop, Cursor, and other AI assistants search your expenses, create reports, and analyze spending using your actual ExpenseBot data.",
|
|
6
6
|
"bin": {
|
|
7
|
-
"expensebot-mcp-auth": "
|
|
7
|
+
"expensebot-mcp-auth": "src/index.js"
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"main": "./src/index.js",
|
package/src/client.js
CHANGED
|
@@ -20,7 +20,7 @@ export class ExpenseBotClient {
|
|
|
20
20
|
headers: {
|
|
21
21
|
Authorization: `Bearer ${this.token}`,
|
|
22
22
|
"Content-Type": "application/json",
|
|
23
|
-
"User-Agent": "expensebot-mcp-auth/0.6.
|
|
23
|
+
"User-Agent": "expensebot-mcp-auth/0.6.8",
|
|
24
24
|
"X-ExpenseBot-MCP-Transport": "stdio",
|
|
25
25
|
...options.headers,
|
|
26
26
|
},
|
package/src/index.js
CHANGED
|
@@ -43,7 +43,8 @@ const client = onboardingMode ? null : new ExpenseBotClient(token);
|
|
|
43
43
|
|
|
44
44
|
const SERVER_INSTRUCTIONS = [
|
|
45
45
|
"ExpenseBot tracks the user's business expenses and income in a Google Sheet they own.",
|
|
46
|
-
"After a
|
|
46
|
+
"After submit_receipt returns a submissionId, call get_last_receipt_result with that exact ID using the polling interval and time allowance returned by submit_receipt. A small batch allows at least 5 minutes and larger batches allow longer. A pending result is normal; never resubmit the same file because that creates a duplicate. Report the final counts, then show spreadsheetUrl and reviewExpensesUrl.",
|
|
47
|
+
"After another expense submission, show the returned spreadsheetUrl and reviewExpensesUrl.",
|
|
47
48
|
"For income writes, show spreadsheetUrl and reviewIncomeUrl.",
|
|
48
49
|
"For Gmail scan progress or completion, call get_scan_status. Report its authoritative status and live phase; on completion show spreadsheetUrl and reviewExpensesUrl, and when action is needed show gmailScanUrl.",
|
|
49
50
|
"For product, setup, billing, Gmail, report, workflow, or troubleshooting questions, call search_knowledge instead of guessing. Use fullAnswer:true when complete instructions are needed.",
|
|
@@ -401,8 +402,9 @@ const TOOLS = [
|
|
|
401
402
|
"simply shares a photo of a receipt or invoice. The receipt image " +
|
|
402
403
|
"is validated, uploaded to cloud storage, and processed " +
|
|
403
404
|
"by AI to extract vendor, amount, date, tax, and category. The expense " +
|
|
404
|
-
"appears in the user's spreadsheet
|
|
405
|
-
"PDFs, mixed together in one
|
|
405
|
+
"appears in the user's spreadsheet in about 1-3 minutes, and longer for " +
|
|
406
|
+
"PDFs or large batches. Handles images and PDFs, mixed together in one " +
|
|
407
|
+
"batch.\n\n" +
|
|
406
408
|
"TO SEND FILES (preferred, and required for PDFs): call this tool with " +
|
|
407
409
|
"filesToUpload listing every file the user gave you. It returns one " +
|
|
408
410
|
"signed upload URL per file. Upload them ONE AT A TIME with an HTTP PUT, " +
|
|
@@ -506,6 +508,38 @@ const TOOLS = [
|
|
|
506
508
|
required: [],
|
|
507
509
|
},
|
|
508
510
|
},
|
|
511
|
+
{
|
|
512
|
+
name: "get_last_receipt_result",
|
|
513
|
+
description:
|
|
514
|
+
"Check the authoritative final outcome of a receipt image/PDF batch submitted " +
|
|
515
|
+
"with submit_receipt. After submit_receipt returns submissionId, call this " +
|
|
516
|
+
"tool with that exact ID using the polling interval and time allowance in " +
|
|
517
|
+
"the submit_receipt response. A small batch allows at least 5 minutes; larger " +
|
|
518
|
+
"batches allow longer. A pending result is normal and must not trigger a " +
|
|
519
|
+
"duplicate resubmission. Returns added, duplicate, skipped, or " +
|
|
520
|
+
"errored verdicts with exact counts and up to 10 processed receipt summaries. " +
|
|
521
|
+
"On completion, tell the user what happened and show spreadsheetUrl plus " +
|
|
522
|
+
"reviewExpensesUrl. This is for uploaded receipts; use get_scan_status for " +
|
|
523
|
+
"Gmail scans. Read-only.",
|
|
524
|
+
inputSchema: {
|
|
525
|
+
type: "object",
|
|
526
|
+
properties: {
|
|
527
|
+
submissionId: {
|
|
528
|
+
type: "string",
|
|
529
|
+
description:
|
|
530
|
+
"Exact submissionId returned by submit_receipt. Strongly preferred because it binds the result to this upload instead of an earlier receipt.",
|
|
531
|
+
},
|
|
532
|
+
withinSeconds: {
|
|
533
|
+
type: "integer",
|
|
534
|
+
minimum: 30,
|
|
535
|
+
maximum: 3600,
|
|
536
|
+
default: 600,
|
|
537
|
+
description:
|
|
538
|
+
"Fallback lookback window when submissionId is unavailable (30-3600 seconds; default 600).",
|
|
539
|
+
},
|
|
540
|
+
},
|
|
541
|
+
},
|
|
542
|
+
},
|
|
509
543
|
{
|
|
510
544
|
name: "add_cash_expense",
|
|
511
545
|
description:
|
|
@@ -1504,6 +1538,14 @@ async function handleTool(name, args) {
|
|
|
1504
1538
|
await client.execute("submit_receipt", args)
|
|
1505
1539
|
);
|
|
1506
1540
|
|
|
1541
|
+
case "get_last_receipt_result":
|
|
1542
|
+
return formatResult(
|
|
1543
|
+
await client.execute("get_last_receipt_result", {
|
|
1544
|
+
submissionId: args.submissionId,
|
|
1545
|
+
withinSeconds: args.withinSeconds,
|
|
1546
|
+
})
|
|
1547
|
+
);
|
|
1548
|
+
|
|
1507
1549
|
case "get_spreadsheet_url":
|
|
1508
1550
|
return formatResult(await client.execute("get_spreadsheet_url", {}));
|
|
1509
1551
|
|
|
@@ -1865,7 +1907,7 @@ function formatResult(result) {
|
|
|
1865
1907
|
|
|
1866
1908
|
async function main() {
|
|
1867
1909
|
const server = new Server(
|
|
1868
|
-
{ name: "expensebot-auth", version: "0.6.
|
|
1910
|
+
{ name: "expensebot-auth", version: "0.6.8" },
|
|
1869
1911
|
{ capabilities: { tools: {} }, instructions: SERVER_INSTRUCTIONS }
|
|
1870
1912
|
);
|
|
1871
1913
|
|
package/src/test.js
CHANGED
|
@@ -21,11 +21,12 @@ import path from "node:path";
|
|
|
21
21
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
22
22
|
const SERVER_PATH = path.join(__dirname, "index.js");
|
|
23
23
|
|
|
24
|
-
const EXPECTED_TOOL_COUNT =
|
|
24
|
+
const EXPECTED_TOOL_COUNT = 46; // + receipt completion + direct workspace links
|
|
25
25
|
const REQUIRED_TOOLS = [
|
|
26
26
|
// v0.5.x
|
|
27
27
|
"search_expenses",
|
|
28
28
|
"submit_receipt",
|
|
29
|
+
"get_last_receipt_result",
|
|
29
30
|
"scan_gmail",
|
|
30
31
|
"create_report",
|
|
31
32
|
// v0.6.0
|
|
@@ -239,6 +240,15 @@ function check(label, ok, details = "") {
|
|
|
239
240
|
/live phase/.test(scanStatus?.description || "") &&
|
|
240
241
|
/reviewExpensesUrl/.test(scanStatus?.description || "")
|
|
241
242
|
);
|
|
243
|
+
const receiptResult = tools.find(
|
|
244
|
+
(tool) => tool.name === "get_last_receipt_result"
|
|
245
|
+
);
|
|
246
|
+
check(
|
|
247
|
+
"get_last_receipt_result binds completion to submit_receipt submissionId",
|
|
248
|
+
receiptResult?.inputSchema?.properties?.submissionId?.type === "string" &&
|
|
249
|
+
/exact ID/.test(receiptResult?.description || "") &&
|
|
250
|
+
/get_scan_status/.test(receiptResult?.description || "")
|
|
251
|
+
);
|
|
242
252
|
}
|
|
243
253
|
|
|
244
254
|
// 2. get_pricing (id=3) — should succeed in onboarding mode
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_meta": {
|
|
3
|
-
"generatedAt": "2026-05-07T05:13:24.014Z",
|
|
4
|
-
"sourceKb": "../server/config/kb/entries/income-and-pnl-analytics.md",
|
|
5
|
-
"note": "Auto-generated from KB. Do NOT edit by hand — re-run `npm run gen-descriptions` after the KB changes."
|
|
6
|
-
},
|
|
7
|
-
"get_income_summary": "Get income totals and breakdowns from the Income tab — Schedule C / T2125 basis. Excludes Schedule B (interest, dividends), tax refunds, and security deposits (mirrors year-end report routing). Examples: \"How much income YTD?\", \"Income by source\", \"by month\", \"by payment method\".",
|
|
8
|
-
"get_pnl": "Compute Profit & Loss across the Income tab and expenses. Examples: \"Am I profitable this year?\", \"Net income last quarter\", \"What's my margin?\", \"P&L for Q1\".",
|
|
9
|
-
"get_per_tag_pnl": "Per-tag P&L — revenue, cost, profit, and margin grouped by tag. Requires both income AND expense rows to be tagged consistently. Examples: ."
|
|
10
|
-
}
|