@expensebot/mcp-server-auth 0.6.6 → 0.6.7
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 +1 -1
- package/src/client.js +1 -1
- package/src/index.js +41 -2
- package/src/test.js +11 -1
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expensebot/mcp-server-auth",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
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": {
|
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.7",
|
|
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 after about 15 seconds; retry every 15 seconds for up to 2 minutes. Report the final added/duplicate/skipped/error 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.",
|
|
@@ -506,6 +507,36 @@ const TOOLS = [
|
|
|
506
507
|
required: [],
|
|
507
508
|
},
|
|
508
509
|
},
|
|
510
|
+
{
|
|
511
|
+
name: "get_last_receipt_result",
|
|
512
|
+
description:
|
|
513
|
+
"Check the authoritative final outcome of a receipt image/PDF batch submitted " +
|
|
514
|
+
"with submit_receipt. After submit_receipt returns submissionId, wait about " +
|
|
515
|
+
"15 seconds and call this tool with that exact ID; if found is false, retry " +
|
|
516
|
+
"every 15 seconds for up to 2 minutes. Returns added, duplicate, skipped, or " +
|
|
517
|
+
"errored verdicts with exact counts and up to 10 processed receipt summaries. " +
|
|
518
|
+
"On completion, tell the user what happened and show spreadsheetUrl plus " +
|
|
519
|
+
"reviewExpensesUrl. This is for uploaded receipts; use get_scan_status for " +
|
|
520
|
+
"Gmail scans. Read-only.",
|
|
521
|
+
inputSchema: {
|
|
522
|
+
type: "object",
|
|
523
|
+
properties: {
|
|
524
|
+
submissionId: {
|
|
525
|
+
type: "string",
|
|
526
|
+
description:
|
|
527
|
+
"Exact submissionId returned by submit_receipt. Strongly preferred because it binds the result to this upload instead of an earlier receipt.",
|
|
528
|
+
},
|
|
529
|
+
withinSeconds: {
|
|
530
|
+
type: "integer",
|
|
531
|
+
minimum: 30,
|
|
532
|
+
maximum: 3600,
|
|
533
|
+
default: 600,
|
|
534
|
+
description:
|
|
535
|
+
"Fallback lookback window when submissionId is unavailable (30-3600 seconds; default 600).",
|
|
536
|
+
},
|
|
537
|
+
},
|
|
538
|
+
},
|
|
539
|
+
},
|
|
509
540
|
{
|
|
510
541
|
name: "add_cash_expense",
|
|
511
542
|
description:
|
|
@@ -1504,6 +1535,14 @@ async function handleTool(name, args) {
|
|
|
1504
1535
|
await client.execute("submit_receipt", args)
|
|
1505
1536
|
);
|
|
1506
1537
|
|
|
1538
|
+
case "get_last_receipt_result":
|
|
1539
|
+
return formatResult(
|
|
1540
|
+
await client.execute("get_last_receipt_result", {
|
|
1541
|
+
submissionId: args.submissionId,
|
|
1542
|
+
withinSeconds: args.withinSeconds,
|
|
1543
|
+
})
|
|
1544
|
+
);
|
|
1545
|
+
|
|
1507
1546
|
case "get_spreadsheet_url":
|
|
1508
1547
|
return formatResult(await client.execute("get_spreadsheet_url", {}));
|
|
1509
1548
|
|
|
@@ -1865,7 +1904,7 @@ function formatResult(result) {
|
|
|
1865
1904
|
|
|
1866
1905
|
async function main() {
|
|
1867
1906
|
const server = new Server(
|
|
1868
|
-
{ name: "expensebot-auth", version: "0.6.
|
|
1907
|
+
{ name: "expensebot-auth", version: "0.6.7" },
|
|
1869
1908
|
{ capabilities: { tools: {} }, instructions: SERVER_INSTRUCTIONS }
|
|
1870
1909
|
);
|
|
1871
1910
|
|
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
|