money-split-mcp
A remote, multi-user MCP server for splitting group expenses, enabling users to register, create groups, add members, log expenses, and view balances through MCP clients.
README
money-split-mcp
A remote, multi-user MCP server for splitting group expenses (Splitwise-lite). Each user registers an account by email, gets an API key, and uses that key to create groups, add members by email, log expenses, and see who owes whom — all through an MCP client (Claude Desktop, claude.ai connectors, etc.).
How it works
POST /registeris a plain REST endpoint (not an MCP tool) that creates a user and returns a one-time API key.- Every other call goes through
POST /mcp(MCP Streamable HTTP) withAuthorization: Bearer <api_key>. The server is stateless: each request resolves the caller from their API key and builds a fresh, user-scoped set of tools. - Data (users, groups, expenses, shares, settlements) lives in Postgres via Prisma.
Local setup
- Copy
.env.exampleto.envand adjustDATABASE_URLif needed. - Get a local Postgres running, matching
.env'sDATABASE_URL(moneysplit/moneysplit/dbmoneysplitonlocalhost:5432):- Native install:
sudo apt-get install -y postgresql postgresql-contrib, then:sudo -u postgres psql -c "CREATE USER moneysplit WITH PASSWORD 'moneysplit';" sudo -u postgres psql -c "CREATE DATABASE moneysplit OWNER moneysplit;" - Docker (if available):
docker compose up -d
- Native install:
- Install deps and run the first migration:
npm install npm run prisma:migrate - Start the dev server:
npm run dev(listens onhttp://localhost:3000by default). - Run the unit tests any time:
npm test(covers the split/balance math, no DB needed).
Manually testing the full flow
Register two users:
curl -s localhost:3000/register -H 'content-type: application/json' \
-d '{"email":"alice@example.com","name":"Alice"}'
curl -s localhost:3000/register -H 'content-type: application/json' \
-d '{"email":"bob@example.com","name":"Bob"}'
Each response includes an apiKey — save both, they're never shown again.
Then drive the MCP tools with the MCP Inspector:
npx @modelcontextprotocol/inspector
Connect it to http://localhost:3000/mcp (Streamable HTTP transport) with header
Authorization: Bearer <alice's apiKey>, then call tools in order:
create_group{ "name": "Trip to Goa" }→ note the returned groupidadd_member_to_group{ "group_id": "...", "email": "bob@example.com" }add_expense{ "group_id": "...", "description": "Hotel", "amount": 100 }(defaults: paid by Alice, split evenly across all members)get_balances{ "group_id": "..." }→ Alice should show+50, Bob-50, with a suggested settlement of Bob paying Alice 50.- Reconnect the Inspector with Bob's API key and call
settle_up{ "group_id": "...", "to_email": "alice@example.com", "amount": 50 }, thenget_balancesagain to confirm both are back to0.
Deploying to Render
This repo includes a render.yaml Blueprint that provisions a Postgres database and a Node web service together.
- Push this repo to GitHub.
- In the Render dashboard: New > Blueprint, point it at the repo — it will read
render.yamland create both themoney-split-dbdatabase and themoney-split-mcpweb service, wiringDATABASE_URLautomatically. - The web service's build command runs
npx prisma migrate deployafter compiling, keeping the schema in sync on every deploy. (Render's free plan doesn't support the separatepreDeployCommandstep, so it's folded into the build instead.) - Once deployed, verify:
curl https://<your-service>.onrender.com/health
Note: Render's free Postgres plan expires after a fixed trial period — check current Render pricing before relying
on it long-term; swap in any external Postgres (e.g. Neon, Supabase) by just changing DATABASE_URL if needed.
Using it from an MCP client
-
Register a real account against the deployed URL:
curl -s https://<your-service>.onrender.com/register -H 'content-type: application/json' \ -d '{"email":"you@example.com","name":"Your Name"}' -
Add it as a remote MCP server in your client.
Claude Code (CLI) — add it at local scope (not committed to git) with the key pulled from an env var, since
.mcp.jsonwould otherwise be shared/committed:export MONEY_SPLIT_API_KEY=<your apiKey> claude mcp add --transport http money-split https://<your-service>.onrender.com/mcp \ --header "Authorization: Bearer \${MONEY_SPLIT_API_KEY}"Claude Desktop — add to its config:
{ "mcpServers": { "money-split": { "url": "https://<your-service>.onrender.com/mcp", "headers": { "Authorization": "Bearer <your apiKey>" } } } }(Check your specific client's docs for the exact key names it expects for a remote Streamable HTTP server with custom headers — some clients configure this through a UI instead of raw JSON.)
-
Each group member registers their own account and adds the server with their own key — that's what ties MCP activity back to "their" groups and balances.
-
From inside the client: "create a group called Goa Trip", "add bob@example.com to it", "log a ₹3000 hotel expense split evenly", "who owes whom in the Goa Trip group?".
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.