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
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.