Skip to main content
Glama
Actual Budget MCP Server

Actual Budget MCP Server

by jimmyzmli
README.md
# Actual Budget MCP Server

[![MCP Version](https://img.shields.io/badge/MCP%20Protocol-2025--11--25-blue.svg)](https://modelcontextprotocol.io)
[![Node.js](https://img.shields.io/badge/Node.js-%3E%3D20.0.0-green.svg)](https://nodejs.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

An enterprise-ready [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for [Actual Budget](https://actualbudget.com/).

This server enables AI assistants and autonomous agents (such as Claude Desktop, Google Antigravity, Cursor, and custom orchestrators) to securely query, reconcile, analyze, and manage personal finances using the official Actual Budget API.

---

## Features

- **Dual Transport Protocols**:
  - **Stdio Transport**: Native standard input/output transport for desktop tools (Claude Desktop, Cursor, local agent runners).
  - **Streamable HTTP Transport (MCP spec 2025-11-25)**: Modern, multi-session HTTP endpoint (`/mcp`) supporting stateful sessions, SSE, and remote agents.
- **High Performance & Resilience**:
  - Persistent in-process connection via official `@actual-app/api` (no subprocess spawning per command).
  - In-memory caching for accounts, categories, category groups, payees, and tags.
  - Process-level SQLite corruption self-healing and PID-isolated instance data directories.
  - Automatic Schema Mismatch detection & package auto-upgrades (`@actual-app/api` and `@actual-app/cli`).
- **Comprehensive Budget Toolset**:
  - Full query engine using ActualQL (`actual_query`) with filters, order-by, grouping, pagination, and count.
  - Full CRUD operations for accounts, transactions (including split transactions), categories, category groups, payees, tags, rules, and schedules.
  - Dynamic skill documentation resource (`actual://skill-docs`) and system prompt guidance.

---

## Architecture

```mermaid
flowchart TD
    subgraph Clients ["AI Clients & Agents"]
        Claude["Claude Desktop / Cursor<br/>(Stdio Transport)"]
        Remote["Remote Agents / Gateway<br/>(Streamable HTTP)"]
    end

    subgraph Server ["Actual Budget MCP Server"]
        Router["Express Router & Transport Layer"]
        Tools["MCP Tool Registry<br/>(Query, Transactions, Accounts, etc.)"]
        Cache["In-Memory Cache & Self-Healing Engine"]
    end

    subgraph ActualCore ["Actual Budget Core"]
        API["@actual-app/api"]
        Instance["Isolated Instance DB<br/>(~/.actual-data/:pid)"]
        Sync["Actual Budget Server<br/>(Local or Remote)"]
    end

    Claude -->|stdin/stdout| Tools
    Remote -->|HTTP| Router
    Router --> Tools
    Tools --> Cache
    Cache --> API
    API --> Instance
    API -->|CRDT Sync| Sync
```

---

## Getting Started

### Prerequisites

- **Node.js**: `v20.0.0` or higher
- An **Actual Budget** server instance (self-hosted or hosted)

### Installation

```bash
git clone https://github.com/your-username/actual-mcp.git
cd actual-mcp
npm install
```

---

## Configuration

You can configure `actual-mcp` using environment variables (via a `.env` file or exported in your shell) or via `~/.actualrc.json`.

Copy the example environment template:

```bash
cp .env.example .env
```

### Environment Variables

| Variable | Description | Default |
|---|---|---|
| `PORT` | Port for the HTTP / MCP server | `3000` |
| `ACTUAL_SERVER_URL` | URL of your Actual Budget server | `http://localhost:5006` |
| `ACTUAL_PASSWORD` | Server password for Actual Budget | — |
| `ACTUAL_SYNC_ID` | Sync ID of the budget file | — |
| `ACTUAL_ENCRYPTION_PASSWORD`| End-to-end encryption password (if enabled on budget) | — |
| `ACTUAL_DATA_DIR` | Root directory for isolated instance SQLite databases | `~/.actual-data` |
| `ACTUAL_RC_PATH` | Path to `.actualrc.json` configuration file | `~/.actualrc.json` |
| `ACTUAL_SKILL_PATH` | Path to custom Markdown skill guide for `actual://skill-docs` | Built-in guide |

### Configuration via `~/.actualrc.json`

If environment variables are not set, `actual-mcp` automatically reads connection details from `~/.actualrc.json`:

```json
{
  "serverUrl": "http://localhost:5006",
  "password": "your_server_password",
  "syncId": "your_sync_id",
  "encryptionPassword": "your_encryption_password"
}
```

---

## Usage

### 1. Stdio Mode (Claude Desktop / Cursor)

Add the server to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "actual": {
      "command": "node",
      "args": [
        "/path/to/actual-mcp/index.js"
      ],
      "env": {
        "ACTUAL_SERVER_URL": "http://localhost:5006",
        "ACTUAL_PASSWORD": "your_server_password",
        "ACTUAL_SYNC_ID": "your_sync_id",
        "ACTUAL_ENCRYPTION_PASSWORD": "your_encryption_password"
      }
    }
  }
}
```

### 2. Streamable HTTP Mode (Standalone Server)

Start the HTTP server on port 3000:

```bash
node index.js --port 3000
```

Once running:
- **MCP Endpoint**: `http://localhost:3000/mcp`
- **Health Check**: `http://localhost:3000/health`

### 3. Cleanup Stale Processes

If previous instances crashed or left zombie processes:

```bash
npm run cleanup
```

---

## Tool Reference

| Tool Name | Category | Description |
|---|---|---|
| `actual_query` | Query | Execute an ActualQL query against all 19 budget tables (`transactions`, `accounts`, `account_groups`, `categories`, `category_groups`, `payees`, `payee_locations`, `rules`, `schedules`, `notes`, `preferences`, `custom_reports`, `dashboard`, etc.). |
| `actual_query_tables` | Query | List all queryable database tables. |
| `actual_query_fields` | Query | List queryable fields for a specified table. |
| `actual_list_accounts` | Accounts | List all active or closed accounts with current balances, `account_group_id`, and attached `note`. |
| `actual_create_account` | Accounts | Create a new budget or off-budget account (with optional `account_group_id` and `note`). |
| `actual_update_account` | Accounts | Update account name, off-budget status, `account_group_id`, or `note`. |
| `actual_get_account_balance` | Accounts | Get current balance of an account with optional date cutoff. |
| `actual_list_account_groups` | Account Groups | List all account groups. |
| `actual_create_account_group` | Account Groups | Create a new account group. |
| `actual_update_account_group` | Account Groups | Update an account group's name. |
| `actual_delete_account_group` | Account Groups | Delete an account group. |
| `actual_get_note` | Notes | Get the note attached to an account, category, category group, or budget month (`YYYY-MM`). |
| `actual_list_notes` | Notes | List all attached notes across accounts, categories, category groups, and budget months. |
| `actual_update_note` | Notes | Create, update, or clear a note for an account, category, category group, or budget month. |
| `actual_get_preferences` | Preferences | Get all budget preferences or a specific preference by key. |
| `actual_set_preference` | Preferences | Set a budget preference value by key. |
| `actual_list_transactions` | Transactions | List transactions filtered by account and date range. |
| `actual_add_transactions` | Transactions | Add one or more transactions (supports split transactions). |
| `actual_update_transaction`| Transactions | Update fields (notes, category, amount, payee) on a transaction. |
| `actual_delete_transaction`| Transactions | Delete a transaction by ID. |
| `actual_merge_transactions`| Transactions | Merge two duplicate transactions into one. |
| `actual_list_categories` | Categories | List budget categories (with optional `include_notes`). |
| `actual_create_category` | Categories | Create a new budget category (with optional `note`). |
| `actual_update_category` | Categories | Update a category's name, hidden status, `group_id`, or `note`. |
| `actual_list_payees` | Payees | List payees or retrieve transfer payees. |
| `actual_create_payee` | Payees | Create a new payee. |
| `actual_list_payee_locations` | Payees | List geographic locations saved for payees. |
| `actual_create_payee_location` | Payees | Create a geographic location for a payee. |
| `actual_delete_payee_location` | Payees | Delete a payee location by ID. |
| `actual_get_nearby_payees` | Payees | Find payees near a given latitude/longitude. |
| `actual_list_rules` | Rules | List transaction categorization rules. |
| `actual_list_schedules` | Schedules | List recurring payment and deposit schedules. |
| `actual_get_schedule_dates` | Schedules | Compute upcoming occurrence dates for a schedule or recurrence config. |
| `actual_load_budget` | Budgets | Load a locally downloaded budget by ID. |
| `actual_import_budget` | Budgets | Import a budget archive (`actual`, `ynab4`, `nynab`). |
| `actual_sync_budget` | Sync | Trigger a sync with the remote Actual Budget server. |
| `actual_get_id` | Resolver | Helper tool to resolve account, account group, category, category group, payee, schedule, or tag names into UUIDs. |

---

## License

This project is licensed under the [MIT License](LICENSE).

TDQS

C2.9/5.0

Scored across 87 tools

Disambiguation3/5

Most tools follow a clear entity+action pattern, making them straightforward to distinguish. However, several clusters overlap: actual_add_transactions vs actual_import_transactions vs actual_update_transaction, actual_query vs actual_execute vs actual_query_tables/query_fields, actual_get_note vs actual_list_notes, and actual_download_budget vs actual_load_budget vs actual_import_budget, plus actual_sync_budget vs actual_sync_receipts. Descriptions help, but an agent could easily pick the wrong query/import/sync variant.

Naming Consistency4/5

Nearly all tools use an actual_<verb>_<noun> pattern (list_accounts, create_category, delete_payee, update_schedule), which is very predictable. Minor deviations like actual_execute, actual_query, actual_get_id, and the two-word actual_hold_budget_next_month break the pure verb_noun template but remain readable.

Tool Count2/5

87 tools is far beyond typical scope, even for a domain spanning accounts, categories, payees, rules, schedules, receipts, notes, queries, and sync. Many are niche or redundant (restore_transaction_notes vs restore_transactions, get_receipt_image, check_receipt_exists, get_nearby_payees), bloating the surface significantly.

Completeness5/5

The surface covers near-full CRUD and lifecycle for every major entity: accounts, groups, categories, payees, tags, rules, schedules, transactions, budget months, notes, preferences, plus receipt management and generic querying. Practically no dead ends remain for the stated budgeting domain.

Maintenance

ActivityActive
ResponsivenessNo recent community issues