Lunch Money MCP Server

Lunch Money MCP Server

An MCP server providing full integration with the Lunch Money API to manage financial data including transactions, budgets, assets, and categories. It enables AI assistants to perform CRUD operations on financial records through a standardized HTTP interface.

Category
访问服务器

README

Lunch Money MCP Server (HTTP)

A MCP (HTTP) server providing full integration with the Lunch Money API. This server enables AI assistants to interact with your Lunch Money financial data through a standardized interface.

Note: This is designed to be used as a streamable HTTP server. If you're looking for local MCP support (stdio transport), see akutishevsky/lunchmoney-mcp.

Features

  • User Management - Access user account details
  • Categories - Create, update, and organize spending categories
  • Tags - Manage transaction tags
  • Transactions - Full CRUD operations on transactions with advanced filtering
  • Recurring Items - Track and manage recurring expenses
  • Budgets - Create and monitor budgets by category
  • Assets - Track manually-managed assets

Prerequisites

  • Node.js 18+ (for native fetch support)
  • A Lunch Money API access token (Get one here)

Installation

  1. Clone or download this repository
  2. Install dependencies:
npm install
  1. Copy .env.example to .env and add your API token:
cp .env.example .env

Edit .env and add your Lunch Money API token:

LUNCH_MONEY_API_TOKEN=your_api_token_here
PORT=8080

Usage

Development Mode

Run the server in development mode with hot reload:

npm run dev

Production Mode

Build and run:

npm run build
npm start

The server will start on port 8080 (or the port specified in your .env file).

Testing with FastMCP CLI

You can test the server using the FastMCP development tools:

npx fastmcp dev src/index.ts

Or use the MCP Inspector:

npx fastmcp inspect src/index.ts

Testing with MCP Test Client

This project includes a test client script that connects to your MCP server and allows you to test tools programmatically.

First, make sure your server is running:

npm run dev

Then in another terminal, install dependencies (if not already installed) and run the test client:

npm install
npm run test:client

Available test client commands:

  • List all available tools:

    npm run test:client -- --list
    
  • Call a specific tool (defaults to getUser):

    npm run test:client -- --tool getUser
    npm run test:client -- --tool getCategories
    npm run test:client -- --tool getTransactions
    
  • Call a tool with arguments:

    npm run test:client -- --tool getTransactions --args '{"start_date":"2024-01-01","end_date":"2024-12-31"}'
    
  • Show help:

    npm run test:client -- --help
    

Environment Variables:

You can configure the test client using environment variables:

  • MCP_SERVER_URL - Server URL (default: http://localhost:8080)
  • MCP_ENDPOINT - MCP endpoint path (default: /mcp - FastMCP's httpStream default)

Available Tools

User Management

  • getUser - Get the current user's account details including email, name, currency preferences, and settings

Categories

  • getCategories - List all categories including category groups and parent categories
  • createCategory - Create a new spending or income category
  • updateCategory - Update an existing category's properties
  • deleteCategory - Delete a category by ID

Tags

  • getTags - List all transaction tags
  • createTag - Create a new tag for categorizing transactions
  • updateTag - Update an existing tag's name
  • deleteTag - Delete a tag by ID

Transactions

  • getTransactions - List transactions with advanced filtering options including:
    • Date range (start_date, end_date)
    • Category (category_id)
    • Tags (tag_id)
    • Account (account_id)
    • Status (cleared, uncleared, recurring, recurring_suggested)
    • Pagination (offset, limit)
  • createTransaction - Create a new transaction (expense, income, or transfer)
  • updateTransaction - Update an existing transaction's properties
  • deleteTransaction - Delete a transaction by ID
  • bulkUpdateTransactions - Bulk update multiple transactions with the same changes

Recurring Items

  • getRecurringItems - List all recurring expense and income items
  • createRecurringItem - Create a new recurring expense or income item
  • updateRecurringItem - Update an existing recurring item's properties
  • deleteRecurringItem - Delete a recurring item by ID

Budgets

  • getBudgets - List all budgets with their category assignments and date ranges
  • createBudget - Create a new budget for a category with amount and date range
  • updateBudget - Update an existing budget's amount, category, or date range
  • deleteBudget - Delete a budget by ID

Assets

  • getAssets - List all manually-managed assets
  • createAsset - Create a new manually-managed asset
  • updateAsset - Update an existing asset's properties including balance and metadata
  • deleteAsset - Delete an asset by ID

Configuration

Environment Variables

  • LUNCH_MONEY_API_TOKEN (required) - Your Lunch Money API access token
  • PORT (optional) - Server port, defaults to 8080
  • SERVER_API_KEY (optional) - API key for server authentication. If set, all requests must include this key in the Authorization header (format: Bearer <key> or just <key>)

Using with Claude Desktop

Add the following to your Claude Desktop configuration file:

{
  "mcpServers": {
    "lunch-money": {
      "command": "node",
      "args": ["/path/to/lunch-money-mcp/dist/index.js"],
      "env": {
        "LUNCH_MONEY_API_TOKEN": "your_api_token_here"
      }
    }
  }
}

Or for development:

{
  "mcpServers": {
    "lunch-money": {
      "command": "npm",
      "args": ["run", "dev"],
      "cwd": "/path/to/lunch-money-mcp",
      "env": {
        "LUNCH_MONEY_API_TOKEN": "your_api_token_here"
      }
    }
  }
}

Deployment

Deploying to Fly.io

This MCP server can be deployed to Fly.io with API key authentication.

Prerequisites

  1. Install the Fly.io CLI:

    curl -L https://fly.io/install.sh | sh
    
  2. Authenticate with Fly.io:

    fly auth login
    

Initial Setup

  1. Launch your app (this will create fly.toml if it doesn't exist):

    fly launch --no-deploy
    

    During setup:

    • Choose a unique app name (or use the default)
    • Select your preferred region
    • Decline adding a database (not needed)
    • Don't deploy yet (we'll set secrets first)
  2. Set your secrets (API keys):

    fly secrets set LUNCH_MONEY_API_TOKEN=your_lunch_money_token
    fly secrets set SERVER_API_KEY=your_secure_api_key_here
    

    Important: Generate a strong, random API key for SERVER_API_KEY. This will be used to authenticate requests to your MCP server.

  3. Deploy your application:

    fly deploy
    
  4. Verify deployment:

    fly status
    

Using Your Deployed Server

Once deployed, your server will be available at https://your-app-name.fly.dev/mcp.

With API Key Authentication:

All requests must include the API key in the Authorization header:

curl -H "Authorization: Bearer your_secure_api_key_here" \
     https://your-app-name.fly.dev/mcp

Health Check:

The server includes a health check endpoint using FastMCP's built-in /health endpoint (no authentication required):

curl https://your-app-name.fly.dev/health

Managing Secrets

  • View secrets: fly secrets list
  • Update a secret: fly secrets set SERVER_API_KEY=new_key
  • Remove a secret: fly secrets unset SERVER_API_KEY

Updating Your Deployment

After making code changes:

fly deploy

Viewing Logs

fly logs

API Reference

This MCP server integrates with the Lunch Money API v1. All endpoints follow the official API documentation.

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选