finnplan-mcp
A stateless MCP server for personal finance management on Cloudflare Workers with D1, offering tools for registration, wallet/category/budget management, transactions, transfers, and financial summaries via JWT-secured APIs.
README
Eve Finance Stateless MCP Server (Cloudflare Workers + D1)
Stateless Model Context Protocol (MCP) server for personal finance management deployed on Cloudflare Workers with Cloudflare D1 (SQLite) and Drizzle ORM.
🚀 Features
- Stateless HTTP Transport: Implements Web Standard Streamable HTTP & SSE (
/mcpand/sse) via@modelcontextprotocol/sdk. - Pure MCP-Native Authentication: Register and login directly using MCP tools (
register_user&login_user) without external REST endpoints. - 15-Minute Self-Contained JWT: Cryptographic token verification with zero database queries required for auth on finance tool calls.
- Multi-Tenant Row-Level Security (RLS): Automatically isolates user data via
userIdextracted directly from JWT token payload. - 11 MCP Tools:
register_user: Register withfirstName,lastName,email, andwhatsappNumber(with country code+...) → returns persistentapiKey& 15-minute JWT.login_user: Authenticate withapiKey→ returns fresh 15-minute JWT.submit_feedback: Submit user feedback, bug reports, or feature requests → automatically creates a formatted GitHub Issue with the user's name and email.manage_wallet: Create, list, update wallets.manage_category: Create, list expense and income categories.manage_budget: Create, list, and compute real-time budget utilization status.record_transaction: Record income/expenses with optional admin fee and automatic atomic wallet balance sync.transfer_funds: Transfer money between wallets with optional admin fees and atomic dual-wallet balance adjustment.update_transaction: Update transactions (amount, fee, wallet, category, budget, date, memo, planned status) with automatic balance reconciliation.list_transactions: Dynamic filtering across date ranges, wallets, categories, budgets, and planning status.financial_summary: Aggregate net worth, income, expense, savings, admin fees, and category breakdowns.
- 3 MCP Resources:
finance://db/schemafinance://wallets/listfinance://budgets/active
🔄 Authentication Workflow via MCP
-
Register User via MCP Tool: Call tool
register_user:{ "firstName": "Budi", "lastName": "Setiawan", "email": "budi@example.com", "whatsappNumber": "+6281234567890" }Response:
{ "userId": "usr_k8f9a2...", "name": "Budi Setiawan", "email": "budi@example.com", "whatsappNumber": "+6281234567890", "apiKey": "fp_live_8f3d9b2c...", "token": "eyJhbGciOi...", "tokenType": "Bearer", "expiresIn": 900 } -
Call Finance Tools: Set
Authorization: Bearer <token>in your MCP client headers to executemanage_wallet,record_transaction, etc. -
Re-Login when Token Expires (after 15 minutes): When a token expires, call tool
login_user:{ "apiKey": "fp_live_8f3d9b2c..." }Response: Fresh 15-minute JWT token.
🛠️ Project Setup & Local Development
1. Install Dependencies
npm install
2. Run Tests
Runs the complete test suite covering all 8 tools, 3 resources, RLS tenant isolation, input validations, and pure MCP lifecycle:
npm test
3. Type Checking & Build Dry-Run
npm run typecheck
npm run build
🤖 Coding Agents Quick Start (Claude Code, OpenCode, Pi, OMP)
Connect Eve Finance MCP to your AI coding agents in seconds. For comprehensive configuration and example prompts, see the Coding Agents Setup Guide.
1. Claude Code
claude mcp add --transport http eve-finance https://finnplan-mcp.lutfidmz.workers.dev/mcp
2. OpenCode
In opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"eve-finance": {
"type": "remote",
"url": "https://finnplan-mcp.lutfidmz.workers.dev/mcp"
}
}
}
3. Pi (pi-mcp-adapter)
# 1. Install adapter
pi install npm:pi-mcp-adapter
# 2. Add to .mcp.json
{
"mcpServers": {
"eve-finance": {
"url": "https://finnplan-mcp.lutfidmz.workers.dev/mcp"
}
}
}
4. OMP (Oh My Pi)
In .omp/mcp.json or .mcp.json:
{
"$schema": "https://raw.githubusercontent.com/can1357/oh-my-pi/main/packages/coding-agent/src/config/mcp-schema.json",
"mcpServers": {
"eve-finance": {
"url": "https://finnplan-mcp.lutfidmz.workers.dev/mcp"
}
}
}
⚡ Print Agent Snippets via CLI
npm run agent:snippet [claude|opencode|pi|omp|all]
💾 Local D1 Setup & Migrations
Apply migrations to your local D1 database:
# 1. Execute database migrations locally
npx wrangler d1 execute finance_db --local --file=./drizzle/0000_nice_marvel_boy.sql
npx wrangler d1 execute finance_db --local --file=./drizzle/0001_low_stingray.sql
# 2. Start local development server
npm run dev
🔌 Connecting with MCP Clients
- Endpoint:
http://localhost:8787/mcp(or your deployedhttps://finnplan-mcp.lutfidmz.workers.dev/mcp) - Initial Connection: No headers required to call
register_userorlogin_user. - Authenticated Calls:
{ "Authorization": "Bearer <YOUR_15_MIN_JWT_TOKEN>" }
🚢 Production Deployment
# 1. Create remote D1 database (if not created yet)
npx wrangler d1 create finance_db
# 2. Set your production JWT secret
npx wrangler secret put JWT_SECRET
# 3. Apply migrations to remote D1 database
npx wrangler d1 execute finance_db --remote --file=./drizzle/0000_nice_marvel_boy.sql
npx wrangler d1 execute finance_db --remote --file=./drizzle/0001_low_stingray.sql
# 4. Deploy worker
npm run deploy
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.
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.
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.
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.