All projects
Full-StackWeb + APILive

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.

Open web appView on GitHub
2 stars3 forksUpdated today

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

  1. 1Web (Next.js), Android (Expo) and AI clients (MCP) all talk to one Express API.
  2. 2MCP write tools call the same REST controllers as the apps through an in-process bridge, so rules never drift.
  3. 3Autopilot plans are hashed and versioned; each step runs in a MongoDB transaction and is read back to verify.
  4. 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.

README.md Ā· Gautam5514/Split-Expense

Contents


Highlights

Highlights: exact splits, groups that fit, fewest payments, live everywhere, Autopilot AI, MCP server, smart nudges, secure by default
The details behind each card
Exact splitsEqual, exact, percent, shares or itemised. Rounding leftovers go to the payer, so every bill adds up to the paisa.
Groups that fitTrip (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 paymentsBalances 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 everywhereSocket.IO pushes every change to every open phone and browser tab. See Live everywhere.
Autopilot AIChat in English or Hinglish. It drafts a plan with every share, and nothing changes until you approve.
MCP server29 tools so ChatGPT, Claude, Gemini and Cursor can run your groups, over OAuth 2.1.
Smart nudgesFestival, monthly and trip-season tips via push and web push, with frequency caps, quiet hours and holdout groups.
Secure by defaultFirebase 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 changesWho sees it live
Expenses, settle-ups, recurring billsEveryone with the group open, plus every member's home screen
Members, invites, join requests, settings, photoThe group page, the creator's pending list, the invitee's invites
New, completed or deleted groupsEvery member's group list, on web and app
NotificationsEvery 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

Autopilot flow: you ask, it plans with exact shares, you approve a hashed and versioned plan, it runs in a transaction and verifies

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.

AreaTools
šŸ‘¤ Accountget_me Ā· get_overall_summary Ā· get_spending_insights Ā· ping
šŸ‘„ Groupslist_groups Ā· get_group Ā· create_group Ā· update_group_settings Ā· add_members Ā· remove_member Ā· get_invite_link Ā· join_group Ā· complete_group Ā· leave_group Ā· delete_group
🧾 Expensesadd_expense · list_expenses · get_expense · get_group_summary
šŸ¤ Settlingget_balances Ā· settle_up Ā· list_pending_settlements Ā· respond_to_settlement
āœ‰ļø Inviteslist_my_invites Ā· respond_to_invite
šŸ” Monthly billslist_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 / destructiveHint annotations, and server instructions explain the rules to the model. A duplicate guard stops retried requests from adding the same bill twice, and delete_group needs 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.

TipWhen (IST)Example
New month1st of every month, 10:00"Naya mahina, naya hisaab. Is mahine ka rent aur bills abhi add karo."
WeekendOne Sunday a month, 12:30"Sunday plans? Pay once, split in seconds."
Trip seasonNov 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

JavaScript, Node.js, Express, MongoDB, Next.js, React, Tailwind CSS, Firebase, Jest, GitHub Actions, AWS

LayerBuilt with
WebNext.js React Tailwind CSS Framer Motion Axios
MobileExpo React Native Android Google Play
APINode.js Express Socket.io Zod JWT
DataMongoDB Mongoose Cloudinary
AIModel Context Protocol Groq Google Gemini OpenRouter Tesseract
Auth & pushFirebase OAuth 2.1 Expo Push
QualityJest fast-check ESLint Dependabot
ShipGitHub Actions AWS EC2 PM2 Ubuntu

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 .env or .env.local. They are git-ignored; the .env.example files 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, then MONGO_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

šŸ” IdentityFirebase-verified tokens only; MCP uses OAuth 2.1 with PKCE, hashed tokens and refresh rotation
🧱 InputZod schemas, NoSQL-injection sanitising, size limits, SSRF-safe receipt URLs
🚦 AbusePer-user and per-token rate limits on the API, Autopilot and MCP
šŸ’ø MoneyOnly you can be the payer of your expenses; settle-ups are two-sided; financial invariants are tested
šŸ” Supply chainCodeQL, 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.

  1. Fork, then branch: git checkout -b feat/my-change
  2. Make the change, with tests where it makes sense
  3. Open a pull request

Start with CONTRIBUTING.md and the good first issue label.


If SplitEase helped you, a ⭐ helps others find it.

MIT Ā© 2026 Gautam Pandit