@expensebot/mcp-server-auth 0.1.0 → 0.2.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.
- package/package.json +1 -1
- package/src/index.js +97 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expensebot/mcp-server-auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.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,84 @@ 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
|
+
},
|
|
287
365
|
];
|
|
288
366
|
|
|
289
367
|
// ── Tool Handlers ──────────────────────────────────────────────────────
|
|
@@ -348,6 +426,25 @@ async function handleTool(name, args) {
|
|
|
348
426
|
await client.execute("search_knowledge", args)
|
|
349
427
|
);
|
|
350
428
|
|
|
429
|
+
case "submit_receipt":
|
|
430
|
+
return formatResult(
|
|
431
|
+
await client.execute("submit_receipt", {
|
|
432
|
+
photo: args.photo,
|
|
433
|
+
filename: args.filename,
|
|
434
|
+
mimeType: args.mimeType,
|
|
435
|
+
})
|
|
436
|
+
);
|
|
437
|
+
|
|
438
|
+
case "add_cash_expense":
|
|
439
|
+
return formatResult(
|
|
440
|
+
await client.execute("add_cash_expense", args)
|
|
441
|
+
);
|
|
442
|
+
|
|
443
|
+
case "parse_expense":
|
|
444
|
+
return formatResult(
|
|
445
|
+
await client.execute("parse_expense", { text: args.text })
|
|
446
|
+
);
|
|
447
|
+
|
|
351
448
|
default:
|
|
352
449
|
return {
|
|
353
450
|
content: [{ type: "text", text: `Unknown tool: ${name}` }],
|