SplitEase ā Group expenses with an AI agent
Split bills with exact shares, live balances and fewest-payment settle-ups, plus an AI agent that plans the change and waits for your approval.
SplitEase is a full-stack expense splitter: an Express API, a Next.js web app and a remote MCP server on one live ledger. Autopilot turns plain English or Hinglish into a reviewable plan and runs it only after approval, and Socket.IO pushes every change to every open phone and browser tab.
- 800+
- automated tests
- 29
- MCP tools
- 10
- Autopilot actions
- 3
- platforms, one ledger
What it does
Exact splits
Equal, exact, percent, shares or itemised. Rounding leftovers go to the payer, so every bill adds up.
Fewest payments
Balances are netted and routed through the minimum number of transfers, with two-sided settle-ups.
Autopilot AI agent
Drafts a plan with every share from a chat message. Nothing changes until you approve it.
MCP server
29 tools over OAuth 2.1 so ChatGPT, Claude, Gemini and Cursor can run your groups.
Live everywhere
Socket.IO pushes expenses, settle-ups and invites to every device, and heals itself after a drop.
Secure by default
Firebase-verified tokens, Zod validation, Helmet, per-user rate limits, CodeQL and OpenSSF practices.
Architecture at a glance
- 1Web (Next.js), Android (Expo) and AI clients (MCP) all talk to one Express API.
- 2MCP write tools call the same REST controllers as the apps through an in-process bridge, so rules never drift.
- 3Autopilot plans are hashed and versioned; each step runs in a MongoDB transaction and is read back to verify.
- 4LLM calls fall back across Groq, Cerebras, Gemini and OpenRouter, with an offline parser as the last resort.
README
The repository's own README.md, with its diagrams, folder structure and setup steps.
š Web app Ā Ā·Ā š± Android Ā Ā·Ā š§ Autopilot Ā Ā·Ā š°ļø MCP server Ā Ā·Ā š API docs Ā Ā·Ā š¦ Mobile repo
Contents
- Highlights
- Live everywhere
- Autopilot, the AI agent
- MCP server for ChatGPT, Claude and Gemini
- Smart notifications
- Architecture
- Tech stack
- Run it locally
- Tests and quality
- Security
- Contributing
Highlights
The details behind each card
| Exact splits | Equal, exact, percent, shares or itemised. Rounding leftovers go to the payer, so every bill adds up to the paisa. |
| Groups that fit | Trip (budget + dates), flatmates (monthly bill day), business (receipts required) or general, each with its own categories and default split. Settings lock after the first expense so old splits stay correct. |
| Fewest payments | Balances are netted and routed through the minimum number of transfers. Settle-ups are two-sided: one person claims, the other confirms. One-tap UPI on mobile. |
| Live everywhere | Socket.IO pushes every change to every open phone and browser tab. See Live everywhere. |
| Autopilot AI | Chat in English or Hinglish. It drafts a plan with every share, and nothing changes until you approve. |
| MCP server | 29 tools so ChatGPT, Claude, Gemini and Cursor can run your groups, over OAuth 2.1. |
| Smart nudges | Festival, monthly and trip-season tips via push and web push, with frequency caps, quiet hours and holdout groups. |
| Secure by default | Firebase auth, Zod validation, Helmet, per-user rate limits, NoSQL-injection sanitising, CodeQL and OpenSSF practices. |
Live everywhere
Add a bill on the web and it appears on every member's phone a moment later. No refresh, no restart, no clearing the cache.
| What changes | Who sees it live |
|---|---|
| Expenses, settle-ups, recurring bills | Everyone with the group open, plus every member's home screen |
| Members, invites, join requests, settings, photo | The group page, the creator's pending list, the invitee's invites |
| New, completed or deleted groups | Every member's group list, on web and app |
| Notifications | Every device you're signed in on, not just the last one |
The connection heals itself. It reconnects forever with a fresh token, re-joins every open group, and refetches whatever it missed when the app comes back from the background, the tab becomes visible again or the network returns.
Autopilot, the AI agent
A chat agent that turns plain English or Hinglish into a reviewable plan, and runs it only after you approve. It lives in a floating widget on the web and a full screen in the Android app. See the feature page ā
"rent 21000" ā plan: Rent ā¹21,000, paid by you, split equally (4 people) ā "make it 24000" ā Approve ā¹24,000 ā done, verified
| āļø Changes (always need approval) | š Answers (read-only, instant) |
|---|---|
| Create a group (picks trip / flat / business) | Who owes whom, with the simplest settle-up |
| Add people (contacts join, others get an invite) | Your balance across every group |
| Record an expense you paid (group's default split) | Recent expenses, or search ("food", "taxi") |
| Set a trip budget and budget alerts | |
| Delete an expense you added, or a group you created |
Why it's safe and smart
- Understands casual language. "petrol 1.5k", "maine 900 diye taxi ke liye", "pizza 600 with Aman and Priya". It fills safe defaults and asks one short question only when something is truly missing.
- Instant corrections. While a plan waits: "make it 4000", "Rahul ko hata do", "Priya bhi", "call it Team dinner". No retyping.
- Approval-gated execution. Plans are hashed and versioned, and approvals expire after 24 hours. Every step runs in a MongoDB transaction, is read back to verify it, and is idempotent on retry. Deletes, and amounts of ā¹50,000 or more, need the button, not a typed "yes".
- Grounded numbers. Every amount the model returns must appear in your message, so "3600" can never silently become "36000".
- Reliable on free models. Groq ā Cerebras ā Gemini ā OpenRouter, with per-model cooldowns, a 15 s budget and one repair retry. When every provider is busy, an offline parser still handles common requests.
Switches: AUTOPILOT_ENABLED, AUTOPILOT_WRITES_ENABLED, plus any one provider key (e.g. GROQ_API_KEY).
Details and threat model: docs/autopilot/ Ā· docs/agent-threat-model.md
MCP server for ChatGPT, Claude and Gemini
A remote Model Context Protocol endpoint (Streamable HTTP, OAuth 2.1). It lets AI assistants run your SplitEase account, not just read it: create groups, add bills, settle up, handle invites and monthly bills.
{ "mcpServers": { "splitease": { "url": "https://api.split.elitecrew.online/mcp" } } }
Add the URL as a custom connector in ChatGPT, Claude or Cursor, or use it from the Gemini CLI. Sign-in is the normal SplitEase login page.
| Area | Tools |
|---|---|
| š¤ Account | get_me Ā· get_overall_summary Ā· get_spending_insights Ā· ping |
| š„ Groups | list_groups Ā· get_group Ā· create_group Ā· update_group_settings Ā· add_members Ā· remove_member Ā· get_invite_link Ā· join_group Ā· complete_group Ā· leave_group Ā· delete_group |
| š§¾ Expenses | add_expense Ā· list_expenses Ā· get_expense Ā· get_group_summary |
| š¤ Settling | get_balances Ā· settle_up Ā· list_pending_settlements Ā· respond_to_settlement |
| āļø Invites | list_my_invites Ā· respond_to_invite |
| š Monthly bills | list_recurring_bills Ā· add_recurring_bill Ā· update_recurring_bill Ā· delete_recurring_bill |
- Same rules as the app. Write tools call the exact REST controllers the web and app use, through an in-process bridge. Validation, permissions, settings lock, consent and live updates are identical, so a bill added from ChatGPT shows up in the app instantly.
- Talk naturally. Groups by name ("goa" finds "Goa Trip"), people by name, email or "me". When a name is ambiguous, the tool returns the candidates instead of guessing.
- Built for AI clients. Every tool has
readOnlyHint/destructiveHintannotations, and server instructions explain the rules to the model. A duplicate guard stops retried requests from adding the same bill twice, anddelete_groupneeds the group's exact name as confirmation.
Contracts and auth: docs/mcp-tool-contracts.md Ā· docs/MCP-OAUTH.md
Smart notifications
Gentle, scheduled tips that bring people back without spamming them. No setup needed: they run automatically and can be paused from Admin ā Notifications.
| Tip | When (IST) | Example |
|---|---|---|
| New month | 1st of every month, 10:00 | "Naya mahina, naya hisaab. Is mahine ka rent aur bills abhi add karo." |
| Weekend | One Sunday a month, 12:30 | "Sunday plans? Pay once, split in seconds." |
| Trip season | Nov and Dec, 19:30 | "Puri is calling. Plan a winter getaway, or go big with Goa." |
- Respectful: at most 1 a day and 5 in any 30 days, never between 21:00 and 09:00, new users wait two days, and people already planning a trip get no trip tips.
- Personal: first name and nearby destinations from the profile's state or city (no GPS), in English and Hinglish variants.
- Exactly once: each send is claimed in a unique index first, and the frequency cap is one atomic write per person, so restarts or a second server never double-send.
- Measurable: a 10% holdout per campaign and open tracking per variant, visible on the admin page.
Tapping a tip opens Autopilot with a ready draft ("Create group Puri Trip, budget 30000").
Architecture
flowchart LR
W["š Web Ā· Next.js"] -- "REST + Socket.IO" --> API["āļø API Ā· Express"]
A["š± Android Ā· Expo"] -- "REST + Socket.IO" --> API
M["š¤ ChatGPT Ā· Claude Ā· Gemini"] -- "MCP Ā· OAuth 2.1" --> API
API --> DB[("š MongoDB")]
API --> LLM["š§ Groq Ā· Cerebras Ā· Gemini Ā· OpenRouter"]
API --> P["š Expo push Ā· FCM web push"]
API --> C["š¼ļø Cloudinary Ā· Tesseract OCR"]
API -. "live events" .-> W
API -. "live events" .-> A
Split/
āāā backend/ Express API (:5000 locally)
ā āāā controllers/ groups, expenses, balances, invites, notifications ā¦
ā āāā modules/autopilot/ planner, LLM chain, approval + transactional execution
ā āāā modules/engagement/ scheduled tips: schedule, copy, runner, admin
ā āāā services/mcp/ MCP tools, controller bridge, name resolver
ā āāā utils/realtime.js live-update fan-out to groups and users
ā āāā tests/ Jest: unit, property-based, DB integration
āāā frontend/ Next.js web app (:3000)
āāā docs/ API, Autopilot, MCP, security, invariants
The mobile app lives in its own repo, Gautam5514/splitApp, and talks to the same API.
Tech stack
| Layer | Built with |
|---|---|
| Web | |
| Mobile | |
| API | |
| Data | |
| AI | |
| Auth & push | |
| Quality | |
| Ship |
Run it locally
You need Node 22 (18+ works) and a MongoDB connection string. A free Atlas cluster or a local mongod both work.
git clone https://github.com/Gautam5514/Split-Expense.git && cd Split-Expense
# 1. API
cd backend && npm install
cp .env.example .env # fill in MONGO_URI and auth values
npm run dev # http://localhost:5000
# 2. Web (new terminal)
cd frontend && npm install
cp .env.example .env.local
npm run dev # http://localhost:3000
Only need the basics? Leave Firebase push, Cloudinary, SMTP and AI keys empty; they only matter for push, uploads, email and AI features. To try Autopilot, add AUTOPILOT_ENABLED=true, AUTOPILOT_WRITES_ENABLED=true and one free key such as GROQ_API_KEY (plus NEXT_PUBLIC_AUTOPILOT_ENABLED=true for the web build).
Warning
Never commit
.envor.env.local. They are git-ignored; the.env.examplefiles are templates.
Tests and quality
cd backend && npm test # 660+ unit + property-based tests (fast-check)
cd backend && npm run test:int # real-MongoDB integration: settings lock, group security, MCP tools
cd frontend && npm test # component tests, including the Autopilot widget
Tip
Integration tests need a throwaway database:
mongod --dbpath /tmp/db --port 27099, thenMONGO_TEST_URI=mongodb://127.0.0.1:27099/splitease_test npm run test:int. Never point them at a real database.
CI runs both suites, linting and dependency audits on every pull request, and CodeQL scans for security issues. The mobile repo has its own 220+ tests.
Security
| š Identity | Firebase-verified tokens only; MCP uses OAuth 2.1 with PKCE, hashed tokens and refresh rotation |
| š§± Input | Zod schemas, NoSQL-injection sanitising, size limits, SSRF-safe receipt URLs |
| š¦ Abuse | Per-user and per-token rate limits on the API, Autopilot and MCP |
| šø Money | Only you can be the payer of your expenses; settle-ups are two-sided; financial invariants are tested |
| š Supply chain | CodeQL, Dependabot, npm audit in CI, OpenSSF Best Practices |
Found something? Please report it privately; see the security policy. More: secure development guide Ā· permissions matrix Ā· release process.
Contributing
New to open source? Welcome. Code, docs, bug reports and ideas all count.
- Fork, then branch:
git checkout -b feat/my-change - Make the change, with tests where it makes sense
- Open a pull request
Start with CONTRIBUTING.md and the good first issue label.