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
Reedrich MCP Server (Cloudflare Workers + D1)
Stateless Model Context Protocol (MCP) server for personal finance & deterministic wealth planning, inspired by Reed Richards (Mister Fantastic)—giving AI Agents mathematical superpowers to project, optimize, and solve user finances 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. - 12 MCP Tools:
register_user: Register withfirstName,lastName,email, andwhatsappNumber(with country code+...) → returns persistentapiKey(rd_live_...), 15-minute JWT, and dynamiconboardingstatus.login_user: Authenticate withapiKey→ returns fresh 15-minute JWT and dynamiconboardingstatus.submit_feedback: Submit user feedback, bug reports, or feature requests → automatically creates a formatted GitHub Issue onlutfi-zain/reedrich-mcp.manage_wallet: Create, list, update wallets.manage_category: Create, list, and bulk-seed standard expense and income categories (action: "seed_defaults").manage_budget: Create, list, and compute real-time budget utilization status.manage_debt_loan: Manage debts (hutang) and loans given (piutang), counterparty tracking, full/partial repayments, and wallet sync.record_transaction: Record income/expenses with optional admin fee, automatic atomic wallet balance sync, and walletless guardrails.transfer_funds: Transfer money between wallets with optional admin fees, atomic dual-wallet balance adjustment, and walletless guardrails.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, category breakdowns, total debt, and total receivable.
- 4 MCP Resources:
reedrich://db/schema: Database schema and relationship documentation.reedrich://wallets/list: Live list of authenticated user wallets and balances.reedrich://budgets/active: Current active budgets with spending utilization percentages.reedrich://debts/active: Active liabilities and receivables with total remaining balances.
- 4 MCP Prompts (AI Workflow Playbooks):
onboarding_assistant: Step-by-step guidance for setting up initial wallets and standard categories.daily_briefing: Comprehensive financial health overview (balances, active budgets, upcoming debt/loan due dates).financial_planning: Goal timeline projection (e.g. "Kapan bisa beli laptop Rp 15jt?") with deterministic math based on net savings and debt commitments.debt_loan_advisor: Prioritization and repayment strategy for active debts and loan collections.
⚡ Quick Install: Claude Code Plugin & Desktop
Install Reedrich directly in Claude Code CLI or connect with Claude Desktop:
Claude Code Plugin (One-Command Install):
/plugin marketplace add lutfi-zain/reedrich-mcp
/plugin install reedrich-finance@reedrich-marketplace
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"reedrich": {
"type": "http",
"url": "https://reedrich-mcp.lutfidmz.workers.dev/mcp"
}
}
}
👉 Full Claude Plugin Guide & Slash Commands: See docs/CLAUDE_PLUGIN.md.
🔄 Authentication & Onboarding 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": "rd_live_8f3d9b2c...", "token": "eyJhbGciOi...", "tokenType": "Bearer", "expiresIn": 900, "onboarding": { "isComplete": false, "needs": ["wallet", "categories"], "suggestions": ["budget"], "message": "Please set up: wallet, categories. Use the onboarding_assistant prompt for guidance." } } -
Seed Default Categories (On User Confirmation): Call tool
manage_categorywithaction: "seed_defaults":{ "action": "seed_defaults" }Populates 10 standard categories: Makanan & Minuman 🍔, Transportasi 🚗, Belanja 🛍️, Tagihan & Utilitas 💡, Hiburan 🎬, Kesehatan 💊, Gaji 💼, Investasi & Bunga 📈, Usaha / Freelance 💻, Pemasukan Lainnya 🎁.
-
Call Finance Tools: Set
Authorization: Bearer <token>orAuthorization: Bearer <apiKey>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": "rd_live_8f3d9b2c..." }Response: Fresh 15-minute JWT token with live
onboardingstatus.
🛠️ Project Setup & Local Development
1. Install Dependencies
npm install
2. Run Tests
Runs the complete test suite covering all 12 tools, 4 resources, 4 prompts, 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 Reedrich 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 reedrich https://reedrich-mcp.lutfidmz.workers.dev/mcp
2. OpenCode
In opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"reedrich": {
"type": "remote",
"url": "https://reedrich-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": {
"reedrich": {
"url": "https://reedrich-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": {
"reedrich": {
"url": "https://reedrich-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/0002_table_prefixed_schema_and_tz.sql
npx wrangler d1 execute finance_db --local --file=./drizzle/0003_add_debts_loans.sql
# 2. Start local development server
npm run dev
🔌 Connecting with MCP Clients
- Endpoint:
http://localhost:8787/mcp(or your deployedhttps://reedrich-mcp.lutfidmz.workers.dev/mcp) - Initial Connection: No headers required to call
register_userorlogin_user. - Authenticated Calls:
{ "Authorization": "Bearer <YOUR_15_MIN_JWT_TOKEN_OR_rd_live_API_KEY>" }
🚢 Production Deployment
# 1. Set your production JWT secret (if not set)
npx wrangler secret put JWT_SECRET
# 2. Apply migrations to remote D1 database
npx wrangler d1 execute finance_db --remote --file=./drizzle/0003_add_debts_loans.sql
# 3. Deploy worker
npm run deploy
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。