expense-tracker
Allows creating and managing expense tracking spreadsheets in Google Sheets, with tools to create sheets, add expenses, query expenses with filters, and calculate settlement summaries.
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-trackerI paid $45 for groceries, split between Mike and Chris."
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 Tracker MCP Server
A Model Context Protocol (MCP) server for tracking business trip expenses and calculating settlement amounts using Google Sheets.
Overview
This server provides tools to:
Create Google Sheets for expense tracking
Parse expenses from natural language input
Track who paid what and calculate who owes whom
Support multiple participants and settlement calculations
Related MCP server: Trackor
Prerequisites
Node.js 18+
Google Cloud project with Sheets API enabled
Google OAuth 2.0 credentials (or Service Account)
Installation
npm install
npm run build
npm test # Verify all 18 tests passSetup
Option 1: Google OAuth 2.0 (Recommended for Small Projects)
Create a Google Cloud project and enable Sheets + Drive APIs
Create OAuth 2.0 credentials (Desktop application)
Copy
.env.exampleto.envand add your credentials:GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com GOOGLE_CLIENT_SECRET=your-client-secret GOOGLE_REDIRECT_URI=http://localhost:3000/oauth/callback DEFAULT_PARTICIPANTS=Mike,Chris DEFAULT_CURRENCY=MXNComplete OAuth authorization to get refresh token:
npm run build node get-refresh-token.jsCopy the generated
GOOGLE_REFRESH_TOKENto your.env
Option 2: Service Account (Better for Production)
Create a Service Account in Google Cloud Console
Download the JSON key file
Update configuration to use Service Account credentials
Configuration
Create a .env file from .env.example with:
Google OAuth credentials
Default participants list
Preferred currency
Tools
create-expense-sheet - Create a new expense tracking spreadsheet
add-expense - Add a single expense entry
add-expenses-bulk - Parse and add multiple expenses
get-expenses - Query expenses with filters
get-settlement-summary - Calculate final settlement
Using with Claude
Add to your Claude Desktop config (~/.config/Claude/claude_desktop_config.json):
{
"mcpServers": {
"expense-tracker": {
"command": "node",
"args": ["/path/to/expense-tracker-mcp/dist/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id",
"GOOGLE_CLIENT_SECRET": "your-secret",
"GOOGLE_REDIRECT_URI": "http://localhost:3000/oauth/callback",
"GOOGLE_REFRESH_TOKEN": "your-refresh-token",
"DEFAULT_PARTICIPANTS": "Mike,Chris",
"DEFAULT_CURRENCY": "MXN"
}
}
}
}Development
npm run watch # Watch TypeScript compilation
npm run dev # Build and start server
npm test # Run all tests (18 tests)
npm start # Start the serverArchitecture
src/index.ts- MCP server entry point and tool handlerssrc/config.ts- Environment configuration with Zod validationsrc/types.ts- TypeScript type definitionssrc/google/- Google Sheets API integrationauth.ts- OAuth 2.0 authenticationclient.ts- Sheets API clienttypes.ts- Google API types
src/utils/- Utility functionsparsers.ts- Natural language expense parsingsettlement.ts- Settlement calculation logicformatters.ts- Output formatting
Security Notes
Never commit
.envfile - it contains credentialsNever expose refresh tokens in code or logs
Use environment variables for all sensitive data
Consider Service Account for production deployments
Testing
All functionality is tested with 18 comprehensive tests:
npm testLicense
MIT
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
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/chrislfmd/expense-tracker-mcp-claude'
If you have feedback or need assistance with the MCP directory API, please join our Discord server