expense-splitter-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@expense-splitter-mcpCreate a group 'Beach Trip' with Alice, Bob, and Charlie"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Expense Splitter MCP Server
A Model Context Protocol (MCP) server for managing shared expenses between groups. Built with TypeScript, MongoDB, and clean architecture principles.
Instead of manually calculating who owes whom, the server computes optimized settlements using a debt simplification algorithm.
Use Cases
Friends trip expenses
Flatmate shared bills
Carpool cost sharing
Office lunch splits
Vacation planning
Related MCP server: Gatherings MCP Server
Setup
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build for production
npm run build
# Start production
npm start
# Open inspector
npm run inspectorMCP Client Configuration
Claude Desktop / Cursor / VS Code
Add to your MCP settings configuration:
{
"servers": {
"expense-splitter": {
"command": "node",
"args": ["/absolute/path/to/expense-splitter-mcp/dist/index.js"],
"env": {
"MONGODB_URI": "mongodb://test/expense-splitter"
}
}
}
}SSE Transport
Set TRANSPORT=sse in .env, then start the server:
npm startConnect your MCP client to http://localhost:3001/sse.
Available Tools (19)
Group Management
Tool | Description |
| Create a new expense group (with optional currency) |
| List all expense groups |
| Get group details with members |
| Rename a group |
| Soft-delete a group and all associated data |
Member Management
Tool | Description |
| Add a member (with optional email/nickname) |
| Remove a member (only if no expenses or settlements) |
| List all members in a group |
Expense Management
Tool | Description |
| Add expense with equal/exact/percentage split |
| Update an existing expense |
| Soft-delete an expense |
| Search with filters (description, payer, date, etc.) |
Balances & Settlements
Tool | Description |
| Get net balance for each member |
| Compute optimized settlement plan |
| Record a payment between members (with optional note) |
History & Reports
Tool | Description |
| Chronological log of expenses & settlements |
| Summary stats (total, top spender, etc.) |
Import / Export
Tool | Description |
| Export group data (JSON/CSV) |
| Import group from JSON data |
Split Types
Type | Description | Example |
| Amount divided equally among participants | ₹12,000 ÷ 4 = ₹3,000 each |
| Specific amounts per participant | Bob: ₹1,200, David: ₹1,200 |
| Percentage-based split | Alice: 60%, Bob: 40% |
Debt Simplification Algorithm
The server uses a greedy algorithm to minimize the number of transactions:
Compute net balance for each member (
received - paid)Separate into creditors (positive) and debtors (negative)
Sort both lists descending
Match biggest creditor with biggest debtor
Transfer the minimum of both amounts
Repeat until all debts are settled
Complexity: O(n log n)
Example
Raw debts from 4 expenses could result in 6+ individual debts, but the algorithm simplifies them to just 3 transactions.
Complete Example: Goa Trip
Here's a real end-to-end walkthrough showing how an AI assistant uses the Expense Splitter MCP server.
Step 1: Create the Group
User: "Create an expense group called Goa Trip."
AI calls create_group:
{ "name": "Goa Trip", "currency": "INR" }Response:
{ "id": "grp_abc123", "name": "Goa Trip", "currency": "INR" }Step 2: Add Members
User: "Add Alice, Bob, Charlie and David."
AI calls add_member 4 times:
{ "groupId": "grp_abc123", "name": "Alice" }
{ "groupId": "grp_abc123", "name": "Bob" }
{ "groupId": "grp_abc123", "name": "Charlie" }
{ "groupId": "grp_abc123", "name": "David" }Step 3: Hotel Expense (Equal Split)
User: "Alice paid ₹12,000 for the hotel. Split it equally."
AI calls add_expense:
{
"groupId": "grp_abc123",
"description": "Hotel",
"amount": 12000,
"paidBy": "Alice",
"participants": ["Alice", "Bob", "Charlie", "David"],
"splitType": "equal"
}Each person owes ₹3,000. Balances:
Member | Balance |
Alice | +9,000 |
Bob | -3,000 |
Charlie | -3,000 |
David | -3,000 |
Step 4: Dinner (Equal Split)
User: "Bob paid ₹3,200 for dinner."
AI calls add_expense:
{
"groupId": "grp_abc123",
"description": "Dinner",
"amount": 3200,
"paidBy": "Bob",
"participants": ["Alice", "Bob", "Charlie", "David"],
"splitType": "equal"
}Each owes ₹800. Updated balances:
Member | Balance |
Alice | +8,200 |
Bob | -600 |
Charlie | -3,800 |
David | -3,800 |
Step 5: Fuel (Exact Split)
User: "Charlie paid ₹2,400 for fuel. Bob owes ₹1,200 and David owes ₹1,200."
AI calls add_expense:
{
"groupId": "grp_abc123",
"description": "Fuel",
"amount": 2400,
"paidBy": "Charlie",
"participants": ["Bob", "David"],
"splitType": "exact",
"splits": { "Bob": 1200, "David": 1200 }
}Balances:
Member | Balance |
Alice | +8,200 |
Bob | -1,800 |
Charlie | -1,400 |
David | -5,000 |
Step 6: Beach Activities (Equal Split, Subset)
User: "David paid ₹4,000 for beach activities. Split between Alice and David."
AI calls add_expense:
{
"groupId": "grp_abc123",
"description": "Beach Activities",
"amount": 4000,
"paidBy": "David",
"participants": ["Alice", "David"],
"splitType": "equal"
}Balances:
Member | Balance |
Alice | +6,200 |
Bob | -1,800 |
Charlie | -1,400 |
David | -3,000 |
Step 7: Check Balances
User: "Who owes whom?"
AI calls get_balances:
{ "groupId": "grp_abc123" }Response:
Alice +₹6,200 (is owed money)
Bob -₹1,800 (owes money)
Charlie -₹1,400 (owes money)
David -₹3,000 (owes money)Step 8: Simplify Debts
User: "Simplify the debts."
AI calls settle_debts:
{ "groupId": "grp_abc123" }Response:
{
"transactions": [
{ "from": "David", "to": "Alice", "amount": 3000 },
{ "from": "Bob", "to": "Alice", "amount": 1800 },
{ "from": "Charlie", "to": "Alice", "amount": 1400 }
]
}Only 3 transactions settle the entire trip:
David → Alice ₹3,000
Bob → Alice ₹1,800
Charlie → Alice ₹1,400Step 9: Record a Payment
User: "Bob paid Alice ₹1,800."
AI calls record_settlement:
{
"groupId": "grp_abc123",
"from": "Bob",
"to": "Alice",
"amount": 1800,
"note": "UPI transfer for trip settlement"
}Step 10: Updated Balances
User: "Show balances again."
AI calls get_balances:
Alice +₹4,400
Bob ₹0 ✅
Charlie -₹1,400
David -₹3,000Step 11: Trip History
User: "Show trip history."
AI calls get_history:
✓ Hotel ₹12,000 (paid by Alice)
✓ Dinner ₹3,200 (paid by Bob)
✓ Fuel ₹2,400 (paid by Charlie)
✓ Beach Activities ₹4,000 (paid by David)
✓ Settlement: Bob → Alice ₹1,800Step 12: Trip Summary
User: "Give me a summary."
AI calls get_group_summary:
{
"group": "Goa Trip",
"members": 4,
"expenses": 4,
"totalSpent": 21600,
"largestExpense": { "description": "Hotel", "amount": 12000 },
"topSpender": "Alice",
"outstanding": 4400
}Summary:
Goa Trip Summary
────────────────
Members: 4
Expenses: 4
Total Spent: ₹21,600
Largest Expense: Hotel (₹12,000)
Top Spender: Alice
Outstanding Amount: ₹4,400Complete Tool Flow
# | Action | Tool Used |
1 | Create Goa Trip |
|
2 | Add 4 members |
|
3 | Alice paid hotel |
|
4 | Bob paid dinner |
|
5 | Charlie paid fuel |
|
6 | David paid beach |
|
7 | Show balances |
|
8 | Simplify debts |
|
9 | Bob paid Alice |
|
10 | Updated balances |
|
11 | Show history |
|
12 | Trip summary |
|
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Rinkesh-Ranpariya-Simform/expense-splitter-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server