Splitwise MCP Server
A standalone MCP server that provides complete access to the Splitwise API, enabling natural language management of expenses, groups, friends, and notifications in MCP-compatible clients like Claude Desktop and VS Code Copilot.
README
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 SETUP.md
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
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.