@expensebot/mcp-server-auth 0.1.0 → 0.3.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +172 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expensebot/mcp-server-auth",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "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.",
5
5
  "bin": {
6
6
  "expensebot-mcp-auth": "./src/index.js"
package/src/index.js CHANGED
@@ -284,6 +284,141 @@ const TOOLS = [
284
284
  required: ["query"],
285
285
  },
286
286
  },
287
+ {
288
+ name: "submit_receipt",
289
+ description:
290
+ "Submit a photo or PDF of a receipt for processing. The receipt image " +
291
+ "is sent as base64, validated, uploaded to cloud storage, and processed " +
292
+ "by AI to extract vendor, amount, date, tax, and category. The expense " +
293
+ "appears in the user's spreadsheet within 30 seconds.",
294
+ inputSchema: {
295
+ type: "object",
296
+ properties: {
297
+ photo: {
298
+ type: "string",
299
+ description:
300
+ "Base64-encoded image or PDF data (JPEG, PNG, HEIC, WebP, or PDF). Max 15MB.",
301
+ },
302
+ filename: {
303
+ type: "string",
304
+ description: "Optional filename (e.g., 'lunch_receipt.jpg')",
305
+ },
306
+ mimeType: {
307
+ type: "string",
308
+ enum: [
309
+ "image/jpeg",
310
+ "image/png",
311
+ "image/heic",
312
+ "image/webp",
313
+ "application/pdf",
314
+ ],
315
+ description: "MIME type of the file (default: image/jpeg)",
316
+ },
317
+ },
318
+ required: ["photo"],
319
+ },
320
+ },
321
+ {
322
+ name: "add_cash_expense",
323
+ description:
324
+ "Add an expense without a receipt (cash purchase, tip, etc.). " +
325
+ "Writes directly to the user's expense spreadsheet.",
326
+ inputSchema: {
327
+ type: "object",
328
+ properties: {
329
+ merchant: { type: "string", description: "Merchant/vendor name" },
330
+ total: { type: "number", description: "Total amount" },
331
+ date: {
332
+ type: "string",
333
+ description: "Expense date (YYYY-MM-DD)",
334
+ format: "date",
335
+ },
336
+ category: { type: "string", description: "Expense category" },
337
+ subtotal: { type: "number", description: "Subtotal before tax" },
338
+ tax: { type: "number", description: "Tax amount" },
339
+ tip: { type: "number", description: "Tip amount" },
340
+ currency: { type: "string", description: "Currency code (default: USD)" },
341
+ city: { type: "string", description: "City/location" },
342
+ notes: { type: "string", description: "Notes or description" },
343
+ },
344
+ required: ["merchant", "total", "date", "category"],
345
+ },
346
+ },
347
+ {
348
+ name: "parse_expense",
349
+ description:
350
+ "Parse a natural language expense description into structured fields. " +
351
+ "Does NOT add the expense — just returns the parsed fields for review. " +
352
+ 'Example: "Lunch at Chipotle $15.50 today" → {merchant: "Chipotle", total: 15.50, ...}',
353
+ inputSchema: {
354
+ type: "object",
355
+ properties: {
356
+ text: {
357
+ type: "string",
358
+ description:
359
+ 'Natural language expense (e.g., "Coffee at Starbucks $6.50 yesterday")',
360
+ },
361
+ },
362
+ required: ["text"],
363
+ },
364
+ },
365
+ {
366
+ name: "process_gmail_receipts",
367
+ description:
368
+ "Process specific Gmail emails as receipts. Pass Gmail message IDs " +
369
+ "and they'll be converted to PDF, extracted by AI, and added to the " +
370
+ "user's expense spreadsheet. Max 25 emails per request. Requires " +
371
+ "Gmail to be connected in ExpenseBot settings.",
372
+ inputSchema: {
373
+ type: "object",
374
+ properties: {
375
+ emailIds: {
376
+ type: "array",
377
+ items: { type: "string" },
378
+ description: "Gmail message IDs to process as receipts",
379
+ },
380
+ accountEmail: {
381
+ type: "string",
382
+ description:
383
+ "Optional: which Gmail account to use (for users with multiple linked accounts)",
384
+ },
385
+ },
386
+ required: ["emailIds"],
387
+ },
388
+ },
389
+ {
390
+ name: "scan_gmail",
391
+ description:
392
+ "Trigger a background Gmail scan to discover and process receipt " +
393
+ "emails. Runs asynchronously — returns immediately, user gets an " +
394
+ 'email summary when done. Like clicking "Find Receipts in Gmail" ' +
395
+ "in the UI. Default: scans last 60 days.",
396
+ inputSchema: {
397
+ type: "object",
398
+ properties: {
399
+ lookbackDays: {
400
+ type: "integer",
401
+ description:
402
+ "How many days back to scan (default 60, max depends on subscription)",
403
+ default: 60,
404
+ },
405
+ startDate: {
406
+ type: "string",
407
+ format: "date",
408
+ description: "Optional: explicit start date (YYYY-MM-DD) instead of lookbackDays",
409
+ },
410
+ endDate: {
411
+ type: "string",
412
+ format: "date",
413
+ description: "Optional: explicit end date (YYYY-MM-DD)",
414
+ },
415
+ accountEmail: {
416
+ type: "string",
417
+ description: "Optional: which Gmail account to scan",
418
+ },
419
+ },
420
+ },
421
+ },
287
422
  ];
288
423
 
289
424
  // ── Tool Handlers ──────────────────────────────────────────────────────
@@ -348,6 +483,43 @@ async function handleTool(name, args) {
348
483
  await client.execute("search_knowledge", args)
349
484
  );
350
485
 
486
+ case "submit_receipt":
487
+ return formatResult(
488
+ await client.execute("submit_receipt", {
489
+ photo: args.photo,
490
+ filename: args.filename,
491
+ mimeType: args.mimeType,
492
+ })
493
+ );
494
+
495
+ case "add_cash_expense":
496
+ return formatResult(
497
+ await client.execute("add_cash_expense", args)
498
+ );
499
+
500
+ case "parse_expense":
501
+ return formatResult(
502
+ await client.execute("parse_expense", { text: args.text })
503
+ );
504
+
505
+ case "process_gmail_receipts":
506
+ return formatResult(
507
+ await client.execute("process_gmail_receipts", {
508
+ emailIds: args.emailIds,
509
+ accountEmail: args.accountEmail,
510
+ })
511
+ );
512
+
513
+ case "scan_gmail":
514
+ return formatResult(
515
+ await client.execute("scan_gmail", {
516
+ lookbackDays: args.lookbackDays,
517
+ startDate: args.startDate,
518
+ endDate: args.endDate,
519
+ accountEmail: args.accountEmail,
520
+ })
521
+ );
522
+
351
523
  default:
352
524
  return {
353
525
  content: [{ type: "text", text: `Unknown tool: ${name}` }],