ExpenseTracker
Provides a bridge between Claude.ai (free plan) and the MCP server via N8N webhooks, enabling expense tracking through Claude's AI interface.
Click on "Deploy 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., "@ExpenseTrackerAdd a $4.50 coffee expense to today's log."
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 v3
A multi-user AI-powered expense tracking server built with FastMCP + FastAPI + PostgreSQL. Users can manage finances using plain English with AI.
Works with:
🖥 Claude Desktop
📱 Claude.ai Free (via N8N)
🌐 Any HTTP client
✨ Features
🔐 JWT Authentication – secure multi-user system
👥 Multi-user support – each user has isolated data
🧰 29 MCP tools for expenses, income, budgets and analytics
🌐 Mobile friendly registration page
☁ Cloud deployable (Railway + Neon)
🤖 AI integration with Claude
🔄 Claude.ai free support using N8N bridge
📁 Project Structure
expense_tracker_v3/
├── CORE
│ ├── main.py
│ ├── run.py
│ ├── app.py
│ ├── config.py
│ ├── context.py
│ ├── db.py
│ ├── init_db.py
│ ├── logger.py
│ ├── utils.py
│ └── create_user.py
│
├── DATABASE
│ ├── schema.sql
│ └── categories.json
│
├── API
│ └── api/
│ ├── __init__.py
│ ├── auth.py
│ ├── middleware.py
│ └── server.py
│
├── MCP TOOLS
│ └── tools/
│ ├── expense_tools.py
│ ├── income_tools.py
│ ├── budget_tools.py
│ ├── category_tools.py
│ ├── summary_tools.py
│ └── utility_tools.py
│
├── FRONTEND
│ └── static/
│ └── register.html
│
├── DEPLOYMENT
│ ├── Procfile
│ ├── pyproject.toml
│ └── requirements.txt
│
└── README.md⚠ Never commit .env to GitHub.
🧰 MCP Tools (29)
Expense Tools
add_expense
update_expense
delete_expense
list_expenses
get_expense_by_id
Related MCP server: Expense Tracker MCP Server
Income Tools
add_income
list_income
delete_income
monthly_income
Budget Tools
set_budget
get_budget
check_budget_status
delete_budget
Category Tools
get_categories
add_category
update_category
delete_category
Summary Tools
summarize_expenses
daily_summary
weekly_summary
monthly_summary
yearly_summary
category_breakdown
top_spending
compare_months
get_balance
Utility Tools
get_last_expenses
search_expenses
export_expenses_csv
🗄 Database Schema
users
id
username
password
created_at
categories
id
name
expenses
id
user_id
date
amount
category_id
note
income
id
user_id
date
amount
source
budgets
id
user_id
category_id
monthly_limitAll queries automatically filter:
WHERE user_id = current_userEach user has completely isolated data.
🚀 Local Setup
1️⃣ Clone Repository
git clone https://github.com/parnajaswanth227/Expense_Tracker_With_Claude.git
cd Expense_Tracker_With_Claude2️⃣ Create Python Environment
uv init
uv venv --python 3.12
.venv\Scripts\activateWindows users:
$env:UV_LINK_MODE="copy"3️⃣ Install Dependencies
uv add fastmcp fastapi uvicorn psycopg[binary] python-dotenv python-jose bcrypt
uv pip install -r requirements.txt4️⃣ Create .env
Create a .env file in the root folder.
DATABASE_URL=postgresql://user:pass@host/dbname?sslmode=require
SECRET_KEY=your_secret_key_here
ALLOW_REGISTRATION=true
ACCESS_TOKEN_EXPIRE_MINUTES=525600Generate a secret key:
python -c "import secrets; print(secrets.token_hex(32))"5️⃣ Start Server
uv run python run.pyServer runs at:
http://localhost:8000🔑 API Endpoints
Method | Endpoint | Description |
GET | /health | Server status |
GET | /register | Signup page |
POST | /auth/register | Create user |
POST | /auth/token | Login |
POST | /mcp | MCP endpoint |
☁ Cloud Deployment
Step 1: Create PostgreSQL Database
Go to:
https://neon.techCreate database and copy connection string.
Step 2: Deploy on Railway
Go to:
https://railway.appCreate project → Deploy from GitHub.
Railway will automatically use:
web: uvicorn api.server:app --host 0.0.0.0 --port $PORTAdd environment variables:
Variable | Value |
DATABASE_URL | Neon database URL |
SECRET_KEY | generated secret |
ALLOW_REGISTRATION | true |
ACCESS_TOKEN_EXPIRE_MINUTES | 525600 |
Step 3: Verify Deployment
https://your-app.railway.app/healthExpected response:
{"status":"ok"}🖥 Using with Claude Desktop
Install MCP server:
uv run fastmcp install claude-desktop main.pyManual configuration:
%APPDATA%\Claude\claude_desktop_config.json{
"mcpServers": {
"ExpenseTracker": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://your-app.railway.app/mcp",
"--header",
"Authorization: Bearer YOUR_TOKEN"
]
}
}
}📱 Using Claude.ai Free (Mobile + Web)
Claude free plan does not support MCP connectors directly. We use an N8N workflow bridge.
N8N Architecture
Claude AI
↓
N8N Webhook
↓
Expense Tracker MCP
↓
PostgreSQL DatabaseSetup N8N
Step 1: Create Account
https://n8n.ioCreate account.
Step 2: Create Workflow
Click:
New WorkflowStep 3: Import Workflow JSON
Click:
⋮ → Import from JSONPaste provided workflow.
Step 4: Add Token
Replace:
YOUR_JWT_TOKEN_HEREwith your token.
Step 5: Activate Workflow
Click Activate.
You will receive webhook URL:
https://yourname.app.n8n.cloud/webhook/expense-trackerConnect N8N to Claude.ai
Open Claude.ai
Go to:
Settings → ConnectorsSelect N8N
Paste your webhook URL.
Claude can now control your expense tracker.
Example Commands
Users can ask Claude:
Add expense ₹500 for lunch todayShow my expenses this monthAdd ₹50,000 salary incomeShow my balanceCheck my budgetClaude will automatically call MCP tools.
👥 Multi-User Flow
User opens /register
↓
Creates username & password
↓
Receives JWT token
↓
Token used in
- Claude Desktop
- N8N workflow
- API callsEach user has separate database data.
🔧 Admin Create Users
python create_user.py --username alice --password pass123Disable public signup:
ALLOW_REGISTRATION=false🐛 Troubleshooting
Error | Solution |
401 Unauthorized | Token expired |
Database error | Check DATABASE_URL |
MCP session error | Restart server |
N8N webhook error | Check workflow JSON |
🔐 Security
Never commit:
.env
JWT tokens
database credentialsRotate tokens if exposed.
📦 Tech Stack
Layer | Technology |
MCP Framework | FastMCP |
API | FastAPI |
Database | PostgreSQL |
Cloud DB | Neon |
Deployment | Railway |
Automation | N8N |
AI Client | Claude |
⭐ Project Goal
Create a fully AI-powered personal finance assistant where users manage expenses using natural language with Claude AI.
If you'd like, I can also help add:
🧭 Architecture diagrams
📸 Screenshots
🔄 Workflow diagrams
🏷 GitHub badges
🎬 Animated demo
to make your GitHub repository look like a professional open-source project.
📸 Screenshots
screenshorts\Screenshot 2026-03-14 113116.png
💻 Web Dashboard – Expense Summary
The AI assistant analyzes your expenses and presents a clear financial overview including income, spending distribution, and balance.
Total income, expenses, and balance
Category-wise spending breakdown
Interactive spending chart
AI-generated financial insights
Example insight:
You've spent ₹2,000 across 3 transactions. Food is the dominant category at 85% (₹1,700). With ₹60,000 income, you're saving 96.7% — a healthy balance of ₹58,000.
📱 Claude AI Mobile – Natural Language Expense Entry
C:\Users\parna\Videos\expense_tracker_v3\screenshorts\WhatsApp Image 2026-03-14 at 11.33.34 AM.jpeg Users can add expenses using natural language with AI.
Add an expense 210 rs for petrol for my bikeClaude automatically:
Detects the transport category
Calls the add_expense MCP tool
Stores the expense in the database
Returns confirmation with details
![]()
Returned response includes:
Expense ID
Amount
Category
Note
Date
This demonstrates how users can manage finances conversationally with AI.
🌐 Live Demo
The project is deployed on Railway Cloud.
📝 User Registration Page
Create a new account:
https://web-production-d3df0.up.railway.app/registerThis page allows users to:
Create a username
Set a password
Generate a JWT token for authentication
🔌 MCP Server Endpoint
Main MCP endpoint used by Claude and N8N:
https://web-production-d3df0.up.railway.app/mcpThis endpoint handles:
MCP tool execution
AI requests from Claude
Automation requests from N8N workflows
🧪 Health Check (Optional)
Check if the server is running:
https://web-production-d3df0.up.railway.app/healthExpected response:
{"status":"ok"}This server cannot be deployed
Maintenance
Related MCP Connectors
- Era ContextOAuthapp.era
Personal finance, bank account, and shared memory connector for Claude, ChatGPT, Gemini Spark & more
Personal finance by conversation: expenses, receipts, statement import, budgets, net worth.
Personal-finance workspace for AI agents: accounts, spending, budgets, goals, and investments.
Personal finance ledger for AI agents — query spending, track bills, forecast cash flow.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAI-powered personal finance analysis through Claude AI using Plaid integration, enabling natural language queries about transactions, subscriptions, budgets, and spending trends.1MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI-driven expense tracking and budget management, including adding expenses, setting budgets, analyzing trends, forecasting, and managing savings goals via natural language.-
- AlicenseNot gradedqualityDmaintenanceEnables users to manage personal expenses through natural conversation with Claude, including adding, updating, deleting expenses, and viewing summaries by category or date range.3MIT
- FlicenseNot gradedqualityDmaintenanceEnables users to manage personal finances using natural language, including tracking expenses, income, budgets, and generating financial summaries.-