About
Best ai assistant to manager your daily expenses
README
A human-in-the-loop, AI-powered expense management system built using a Chrome Extension + MCP-based Backend Orchestrator
A production-inspired system demonstrating correct AI boundaries, MCP compliance, and security-first orchestration — not a toy chatbot.
📌 High-Level Overview
This project is composed of three explicitly separated layers, each with a single responsibility:
- Chrome Extension (Thin Client UI)
- AI Backend Orchestrator (Decision & Security Layer)
- Expense MCP Server (Pure Tool Executor)
The system enables users to manage expenses via natural language, while guaranteeing:
- Explicit user confirmation before execution
- Deterministic tool behavior
- Strict security boundaries
- Correct MCP philosophy adherence
🧭 System Architecture (Bird’s-Eye View)
flowchart TB
U[User]
CE[Chrome Extension<br/>Thin Client UI]
BO[Backend Orchestrator<br/>AI Decision Layer]
LLM[LLM<br/>Intent Translation Only]
MCP[Expense MCP Server<br/>Pure Tools]
DB[(PostgreSQL)]
U --> CE
CE -->|JWT| BO
BO --> LLM
BO --> MCP
MCP --> DB
🎯 Design Philosophy
Human-in-the-Loop AI (Non-Autonomous)
- User enters a natural-language command
- Backend LLM only translates intent
- User explicitly confirms the action
- Backend executes exactly one MCP tool
❗ The AI never auto-executes ❗ MCP servers never contain intelligence
🧩 Component Breakdown
1️⃣ Chrome Extension — Thin Client
Responsibilities
- Floating UI rendering
- Google Sign-In (Chrome Identity API)
- JWT storage (
chrome.storage.local) - Confirmation UI
- BYOK management interface
Explicitly NOT Responsible For
- Calling LLM APIs
- Parsing intent
- Selecting tools
- Executing actions
- Storing expenses or secrets
📁 Extension Structure
floating-ai-expense-extension/
│
├── manifest.json # MV3 configuration
├── webpack.config.js
├── public/
│ └── styles.css
│
├── src/
│ ├── contentScript.jsx
│ ├── FloatingWidget.jsx
│ ├── Auth.jsx
│ ├── Settings.jsx
│ ├── ConfirmAction.jsx
│ └── api.js
│
└── dist/
└── contentScript.js
🔐 Authentication Flow (Chrome Extension)
sequenceDiagram
participant U as User
participant CE as Chrome Extension
participant G as Google OAuth
participant BO as Backend
U->>CE: Click "Sign in with Google"
CE->>G: Request ID Token
G-->>CE: ID Token
CE->>BO: POST /auth/google
BO-->>CE: Signed JWT
2️⃣ Backend Orchestrator — AI Decision Layer
What This Backend IS
- AI intent translation layer
- Security boundary
- Tool execution gatekeeper
- Multi-tenant isolation enforcer
What This Backend IS NOT
- Expense database
- MCP server
- Autonomous agent
- Chatbot with side effects
🔑 Authentication Model (JWT-Based)
1. Extension sends Google ID Token
2. Backend verifies token with Google
3. Backend creates / fetches user
4. Backend issues signed JWT
5. JWT attached to every request
JWT Payload Example
{
"user_id": "google-sub-123",
"email": "[email protected]",
"iat": 1700000000,
"exp": 1700003600
}
🧠 Why the LLM Lives in the Backend (NOT MCP)
✅ Correct Architecture
User → Backend (LLM) → Structured JSON → MCP Tool
❌ Incorrect Architecture
User → MCP Server with LLM + Logic
Why This Separation Matters
- MCP servers stay reusable
- Tool execution is deterministic
- LLM output is sandboxed & validated
- Security remains centralized
🔐 Security Model (Defense-in-Depth)
- Google OAuth — identity verification
- JWT — stateless authentication
- AES-256-GCM — BYOK encryption
- Tool allow-list — execution safety
user_idinjection — data isolation
🔑 BYOK (Bring Your Own Key)
Users may optionally provide their own LLM API key.
Guarantees
- Encrypted before storage
- Stored only in Supabase
- Decrypted in memory only
- Never logged or exposed
🧩 Expense MCP Server
Purpose
A pure MCP tool server responsible only for expense operations.
Hard Rules
- No authentication
- No LLM
- No business decisions
- Deterministic execution
- Backend-injected
user_id
🛠️ MCP Tool Definitions
1️⃣ add_expense
Adds a new expense record.
Arguments
- user_id (string, required)
- date (YYYY-MM-DD)
- amount (positive number)
- category (string)
- merchant (optional)
- note (optional)
2️⃣ list_expenses
Lists expenses within a date range.
Arguments
- user_id
- start_date (YYYY-MM-DD)
- end_date (YYYY-MM-DD)
3️⃣ summarize_expenses
Aggregates expenses by category.
Arguments
- user_id
- start_date
- end_date
Returns
- Array of
{ category, total }ordered by total DESC
4️⃣ monthly_report
Generates a monthly summary.
Arguments
- user_id
- month (YYYY-MM)
Returns
- total_spending
- expense_count
- category_breakdown
- natural-language summary
🧠 Intent → Execution Flow
sequenceDiagram
participant U as User
participant CE as Chrome Extension
participant BO as Backend
participant LLM as LLM
participant MCP as MCP Server
U->>CE: Natural language input
CE->>BO: POST /llm/intent
BO->>LLM: Translate intent
LLM-->>BO: { tool, arguments }
BO-->>CE: Confirmation payload
U->>CE: Explicit confirm
CE->>BO: POST /execute
BO->>MCP: Execute tool (user_id)
📊 Why This Is Resume-Grade
- Correct MCP architecture
- Human-in-the-loop AI
- Deterministic tool execution
- JWT-based Google authentication
- Secure BYOK handling
- Chrome Extension (MV3)
🎓 Interview One-Liner
“This is a human-in-the-loop AI system where the frontend is intentionally dumb, the backend acts as an AI decision layer, and MCP servers remain pure executors with deterministic behavior.”
🚀 Future Improvements
- Redis-based rate limiting
- Per-tool audit logs
- Async execution via queues
- OpenAPI generation
- CI/CD pipeline
Installing Expense Manager
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/Saksham-hacked/expense-managerFAQ
Is Expense Manager MCP free?
Yes, Expense Manager MCP is free — one-click install via Unyly at no cost.
Does Expense Manager need an API key?
No, Expense Manager runs without API keys or environment variables.
Is Expense Manager hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Expense Manager in Claude Desktop, Claude Code or Cursor?
Open Expense Manager on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
Playwright
Browser automation, scraping, screenshots
by MicrosoftPuppeteer
Browser automation and web scraping.
by modelcontextprotocolopentabs-dev/opentabs
Plugin-based MCP server + Chrome extension that gives AI agents access to web applications through the user's authenticated browser session. 100+ plugins with a
by opentabs-devrobhunter/agentdeals
1,500+ developer infrastructure deals, free tiers, and startup programs across 54 categories. Search deals, compare vendors, plan stacks, and track pricing chan
by robhunterCompare Expense Manager with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All browse MCPs
