svarun115/splitwise-mcp-server
If you are the rightful owner of splitwise-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Splitwise MCP Server is a standalone Model Context Protocol server that provides full access to the Splitwise API, allowing users to manage their expenses through natural language using various MCP-compatible clients.
Splitwise MCP Server
A standalone Model Context Protocol (MCP) server that provides complete access to the Splitwise API. Use it with Claude Desktop, VS Code Copilot, ChatGPT, or any MCP-compatible client to manage your Splitwise expenses through natural language.
Features
26 MCP Tools organized in 7 categories:
- 👤 User Management (3) - Profile and settings
- 👥 Group Management (7) - Create/manage expense groups
- 🤝 Friend Management (5) - Add/manage friends
- 💰 Expense Management (6) - Create/track expenses with custom splits
- 💬 Comments (3) - Comment on expenses
- 🔔 Notifications (1) - View account activity
- 🛠️ Utilities (2) - Currencies and categories
Supported Clients
- ✅ Claude Desktop (Anthropic's desktop app) - Uses stdio or WebSocket modes
- ✅ VS Code with GitHub Copilot (via splitwise-mcp-vscode extension)
- ✅ ChatGPT (with custom MCP integration)
- ✅ Any MCP-compatible client (stdio or WebSocket+HTTP modes)
Quick Start
1. Install Dependencies
npm install
npm run build
2. Get Splitwise Credentials
Visit secure.splitwise.com/apps and register your app:
- Name: My Splitwise MCP
- Homepage URL:
http://localhost - Callback URL:
http://localhost:8080/callback
Save your Consumer Key and Consumer Secret.
3. Get Access Token
Run the token helper:
npm run get-token
Or manually:
- Visit:
https://secure.splitwise.com/oauth/authorize?client_id=YOUR_CONSUMER_KEY&response_type=code&redirect_uri=http://localhost:8080/callback - Authorize the app and copy the
codefrom the redirect URL - Exchange for token:
curl -X POST "https://secure.splitwise.com/oauth/token" \
-d "grant_type=authorization_code" \
-d "code=YOUR_AUTH_CODE" \
-d "client_id=YOUR_CONSUMER_KEY" \
-d "client_secret=YOUR_CONSUMER_SECRET" \
-d "redirect_uri=http://localhost:8080/callback"
4. Configure Environment
Create .env:
SPLITWISE_ACCESS_TOKEN=your_access_token_here
5. Choose Your Client
Option A: Claude Desktop (Recommended)
Edit your Claude Desktop config file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - Mac/Linux:
~/Library/Application Support/Claude/claude_desktop_config.json
WebSocket mode (requires the adapter or direct connection):
{
"mcpServers": {
"splitwise": {
"command": "splitwise-mcp-server",
"args": [],
"env": {
"SPLITWISE_ACCESS_TOKEN": "your_access_token_here",
"PORT": "3002"
}
}
}
}
Stdio mode (original, uses stdio transport):
{
"mcpServers": {
"splitwise": {
"command": "splitwise-mcp-server",
"args": ["--stdio"],
"env": {
"SPLITWISE_ACCESS_TOKEN": "your_access_token_here"
}
}
}
}
Restart Claude Desktop and test:
"Show me my Splitwise friends"
"List my recent expenses"
"Create a $50 dinner expense split equally"
Option B: VS Code with GitHub Copilot
Install the Splitwise MCP VS Code Extension:
# Install the VS Code extension
code --install-extension splitwise-mcp-1.0.0.vsix
Configure your access token in VS Code settings, then use Copilot Chat:
"Show my Splitwise balance"
"Add a $30 grocery expense to my Roommates group"
See the VS Code extension README for detailed setup.
Option C: Custom MCP Client
The server uses stdio transport and follows the MCP specification. Connect any MCP client:
// Example: Using MCP SDK Client
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
const transport = new StdioClientTransport({
command: 'splitwise-mcp-server',
env: { SPLITWISE_ACCESS_TOKEN: 'your_token' }
});
const client = new Client({ name: 'my-client', version: '1.0.0' }, { capabilities: {} });
await client.connect(transport);
const tools = await client.listTools();
Available Tools
User Management
splitwise_get_current_user- Get your profile infosplitwise_get_user- Get another user's infosplitwise_update_user- Update profile settings
Group Management
splitwise_get_groups- List all groupssplitwise_get_group- Get group detailssplitwise_create_group- Create new groupsplitwise_delete_group- Delete groupsplitwise_restore_group- Restore deleted groupsplitwise_add_user_to_group- Add member to groupsplitwise_remove_user_from_group- Remove member from group
Friend Management
splitwise_get_friends- List all friends with balancessplitwise_get_friend- Get friend detailssplitwise_add_friend- Add single friendsplitwise_add_friends- Add multiple friendssplitwise_remove_friend- Remove friend
Expense Management
splitwise_get_expenses- List/filter expensessplitwise_get_expense- Get expense detailssplitwise_create_expense- Create expense (equal or custom split)splitwise_update_expense- Update expensesplitwise_delete_expense- Delete expensesplitwise_restore_expense- Restore deleted expense
Comments
splitwise_get_comments- Get expense commentssplitwise_add_comment- Add comment to expensesplitwise_delete_comment- Delete comment
Notifications
splitwise_get_notifications- Get recent activity
Utilities
splitwise_get_currencies- Get supported currenciessplitwise_get_categories- Get expense categories
Usage Examples
View balances:
"What do I owe each of my friends?"
"Show me my Splitwise balance"
Create expenses:
"Add a $60 grocery expense split equally in my Roommates group"
"I paid $100 for dinner - I owe $40, John owes $60"
"Create a $1200 monthly rent expense split equally"
Manage groups:
"Create a group called 'Vegas Trip' and add alice@email.com"
"Who's in my Apartment group?"
"Show me all expenses in the Weekend Getaway group"
Filter expenses:
"Show me restaurant expenses from last month"
"List all expenses over $100"
"What did I spend the most on this year?"
Troubleshooting
Authentication failed:
- Verify token in
.envmatches the one inclaude_desktop_config.json - No extra spaces or quotes around the token
- Token hasn't expired - regenerate with
npm run get-token
Server not found:
- Use absolute path in config
- Windows: Use
\\(double backslashes) - Run
npm run buildafter code changes - Path should point to
dist/index.jsnotsrc/index.ts
Tools not appearing in Claude:
- Verify JSON syntax in
claude_desktop_config.json - Completely close and restart Claude Desktop (check system tray)
- Check Claude Desktop logs: Help → Show Logs
Authorization code expired:
- Codes expire in 10 minutes
- Get a new code and exchange immediately
- Use the token helper script to automate:
npm run get-token
For detailed setup instructions, see
Server Modes
The Splitwise MCP server supports multiple deployment modes:
WebSocket Mode (Default)
npm run dev:ws
# or
PORT=4001 npm start
- Starts on port 4001 (configurable via
PORTenv var) - Uses WebSocket + HTTP JSON-RPC protocol
- Recommended for production deployments
- Can be used with HTTP adapter for remote access
Stdio Mode
npm run dev:stdio
# or
npm start -- --stdio
- Uses standard input/output (classic MCP protocol)
- Good for direct client integration
- Default mode when
--stdioflag is passed - Recommended for Claude Desktop
HTTP Adapter Mode
npm run dev:adapter
# or in another terminal while WebSocket server is running:
WS_BACKEND_URL=ws://localhost:4001 npm run adapter
- Runs on port 4000 (configurable via
PORTenv var) - Proxies HTTP/JSON-RPC requests to the WebSocket backend
- Provides HTTP endpoints for testing:
GET /health- Health checkGET /status- Backend connection statusGET /listTools- List available toolsPOST /rpc- JSON-RPC request endpointPOST /- Alternative JSON-RPC endpointWS /- WebSocket upgrade endpoint
Development
# Install dependencies
npm install
# Build TypeScript
npm run build
# Watch mode (auto-rebuild)
npm run watch
# WebSocket mode (default)
npm run dev:ws
# Stdio mode
npm run dev:stdio
# HTTP Adapter mode (in separate terminal with backend running)
npm run dev:adapter
# Get OAuth token
npm run get-token
Development & Running
Local Development
# Terminal 1: Start WebSocket backend
PORT=4001 npm run build
PORT=4001 npm run dev:ws
# Terminal 2: (Optional) Start HTTP adapter
PORT=4000 npm run dev:adapter
# Terminal 3: Test the server
curl http://localhost:4000/health
curl http://localhost:4000/listTools
With Claude Desktop (WebSocket)
- Configure as shown in "Option A: Claude Desktop" above
- Run the server:
PORT=4001 npm start - Restart Claude Desktop
With Claude Desktop (Stdio)
- Configure with
--stdioflag as shown above - Run the server:
npm start -- --stdio - Restart Claude Desktop
Project Structure
SplitwiseMCPServer/
├── src/
│ ├── index.ts # Main MCP server (WebSocket + Stdio modes)
│ ├── http-adapter.ts # HTTP adapter for WebSocket backend
│ ├── splitwise-client.ts # Splitwise API wrapper
│ ├── tools.ts # Tool definitions (26 tools)
│ └── get-token.ts # OAuth helper script
├── dist/ # Compiled output
├── .env # Your credentials (not in git)
├── package.json
└── tsconfig.json
API Reference
All tools follow the Splitwise API v3.0 specification: dev.splitwise.com
Base URL: https://secure.splitwise.com/api/v3.0
Authentication: OAuth 2.0 Bearer Token
Security
- Never commit
.envto version control - Keep your access token private
- Use environment variables for credentials
- Set proper file permissions:
chmod 600 .env(Unix/Mac)
Requirements
- Node.js: 18+
- NPM: Latest
- Splitwise Account: Free or premium
License
MIT
Related
- Splitwise MCP VS Code Extension - Optional VS Code integration
- Splitwise API Documentation - Official API reference
- Model Context Protocol - MCP specification
Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Support
- Issues: GitHub Issues
- Splitwise API: dev.splitwise.com
- MCP Docs: modelcontextprotocol.io
License
MIT License - see LICENSE file for details
Built with: TypeScript 5.3, MCP SDK 1.20.1, Axios 1.6.0