Skip to content

mattebad/Monarch_MCP_Server

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MseeP.ai Security Assessment Badge

Monarch Money MCP Server

A Model Context Protocol (MCP) server for integrating with the Monarch Money personal finance platform. This server provides seamless access to your financial accounts, transactions, budgets, and analytics through Claude Desktop.

My MonarchMoney referral: https://www.monarchmoney.com/referral/ufmn0r83yf?r_source=share

Built with the MonarchMoney Python library by @hammem - A fantastic unofficial API for Monarch Money with full MFA support.

monarch-mcp-server MCP server

πŸš€ Quick Start

1. Installation

  1. Clone this repository:

    git clone https://github.com/robcerda/monarch-mcp-server.git
    cd monarch-mcp-server
  2. Install dependencies:

    Important: This project requires Python 3.12+ (see pyproject.toml).

    Windows (recommended: virtualenv)

    cd C:\path\to\Monarch_MCP_Server
    py -3.12 -m venv .venv
    .\.venv\Scripts\Activate.ps1
    python -m pip install -U pip
    pip install -r requirements.txt
    pip install -e .

    macOS/Linux

    pip install -r requirements.txt
    pip install -e .
  3. Configure your MCP client:

    Cursor (recommended)

    In Cursor: Settings β†’ Features β†’ MCP β†’ Add New MCP Server (Type: stdio)

    • Command: C:\path\to\Monarch_MCP_Server\.venv\Scripts\mcp.exe
    • Args:
      • run
      • --transport
      • stdio
      • C:\path\to\Monarch_MCP_Server\src\monarch_mcp_server\server.py:app
    • Working directory (if available): C:\path\to\Monarch_MCP_Server

    Claude Desktop

    Add this to your Claude Desktop configuration file:

    macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

    Windows: %APPDATA%\Claude\claude_desktop_config.json

    Windows example (no uv required)

    Replace paths with your actual install location.

    {
      "mcpServers": {
        "Monarch Money": {
          "command": "C:\\path\\to\\Monarch_MCP_Server\\.venv\\Scripts\\python.exe",
          "args": [
            "-m",
            "mcp",
            "run",
            "C:\\path\\to\\Monarch_MCP_Server\\src\\monarch_mcp_server\\server.py"
          ],
          "cwd": "C:\\path\\to\\Monarch_MCP_Server"
        }
      }
    }

    uv example (cross-platform)

    {
      "mcpServers": {
        "Monarch Money": {
          "command": "/opt/homebrew/bin/uv",
          "args": [
            "run",
            "--with",
            "mcp[cli]",
            "--with-editable",
            "/path/to/your/monarch-mcp-server",
            "mcp",
            "run",
            "/path/to/your/monarch-mcp-server/src/monarch_mcp_server/server.py"
          ]
        }
      }
    }

    Important: Replace /path/to/your/monarch-mcp-server with your actual path!

  4. Restart Claude Desktop

2. One-Time Authentication Setup

Important: For security and MFA support, authentication is done outside of Claude Desktop.

Open Terminal and run:

cd /path/to/your/monarch-mcp-server
python login_setup.py

Follow the prompts:

  • Choose a login method:
    • Email/password + MFA (direct)
    • Apple/Google SSO (paste a Monarch token copied from your browser session)
  • If using email/password:
    • Enter your Monarch Money email and password
    • Provide 2FA code if you have MFA enabled
  • If using SSO/token:
    • Sign in at https://app.monarchmoney.com
    • Copy the Authorization token from a GraphQL/API request in your browser DevTools
    • Paste it into the script (input is hidden)
  • Session will be saved automatically

3. Start Using in Claude Desktop

Once authenticated, use these tools directly in Claude Desktop:

  • get_accounts - View all your financial accounts
  • get_transactions - Recent transactions with filtering
  • get_budgets - Budget information and spending
  • get_cashflow - Income/expense analysis

✨ Features

πŸ“Š Account Management

  • Get Accounts: View all linked financial accounts with balances and institution info
  • Get Account Holdings: See securities and investments in investment accounts
  • Refresh Accounts: Request real-time data updates from financial institutions

πŸ’° Transaction Access

  • Get Transactions: Fetch transaction data with filtering by date, account, and pagination
  • Create Transaction: Add new transactions to accounts
  • Update Transaction: Modify existing transactions (amount, description, category, date)

πŸ“ˆ Financial Analysis

  • Get Budgets: Access budget information including spent amounts and remaining balances
  • Get Cashflow: Analyze financial cashflow over specified date ranges with income/expense breakdowns

πŸ” Secure Authentication

  • One-Time Setup: Authenticate once, use for weeks/months
  • MFA Support: Full support for two-factor authentication
  • Session Persistence: No need to re-authenticate frequently
  • Secure: Credentials never pass through Claude Desktop

πŸ› οΈ Available Tools

Tool Description Parameters
setup_authentication Get setup instructions None
check_auth_status Check authentication status None
get_accounts Get all financial accounts None
get_transactions Get transactions with filtering limit, offset, start_date, end_date, account_id
get_budgets Get budget information None
get_cashflow Get cashflow analysis start_date, end_date
get_account_holdings Get investment holdings account_id
create_transaction Create new transaction account_id, amount, description, date, category_id, merchant_name
update_transaction Update existing transaction transaction_id, amount, description, category_id, date
refresh_accounts Request account data refresh None

πŸ“ Usage Examples

View Your Accounts

Use get_accounts to show me all my financial accounts

Get Recent Transactions

Show me my last 50 transactions using get_transactions with limit 50

Check Spending vs Budget

Use get_budgets to show my current budget status

Analyze Cash Flow

Get my cashflow for the last 3 months using get_cashflow

πŸ“… Date Formats

  • All dates should be in YYYY-MM-DD format (e.g., "2024-01-15")
  • Transaction amounts: positive for income, negative for expenses

πŸ”§ Troubleshooting

Authentication Issues

If you see "Authentication needed" errors:

  1. Run the setup command: cd /path/to/your/monarch-mcp-server && python login_setup.py
  2. Restart Claude Desktop
  3. Try using a tool like get_accounts

Session Expired

Sessions last for weeks, but if expired:

  1. Run the same setup command again
  2. Enter your credentials and 2FA code
  3. Session will be refreshed automatically

Common Error Messages

  • "No valid session found": Run login_setup.py
  • "Invalid account ID": Use get_accounts to see valid account IDs
  • "Date format error": Use YYYY-MM-DD format for dates

πŸ—οΈ Technical Details

Project Structure

monarch-mcp-server/
β”œβ”€β”€ src/monarch_mcp_server/
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── server.py          # Main server implementation
β”œβ”€β”€ login_setup.py         # Authentication setup script
β”œβ”€β”€ pyproject.toml         # Project configuration
β”œβ”€β”€ requirements.txt       # Dependencies
└── README.md             # This documentation

Session Management

  • The Monarch API token is stored securely in your OS keyring (via keyring)
  • login_setup.py saves the token once; the server loads it automatically
  • Token persists across Cursor/Claude restarts
  • No need for frequent re-authentication (typically lasts weeks)

Security Features

  • Credentials never transmitted through Claude Desktop
  • MFA/2FA fully supported
  • Session files are encrypted
  • Authentication handled in secure terminal environment

πŸ™ Acknowledgments

This MCP server is built on top of the excellent MonarchMoney Python library created by @hammem. Their library provides the robust foundation that makes this integration possible, including:

  • Secure authentication with MFA support
  • Comprehensive API coverage for Monarch Money
  • Session management and persistence
  • Well-documented and maintained codebase

Thank you to @hammem for creating and maintaining this essential library!

πŸ“„ License

MIT License

πŸ†˜ Support

For issues:

  1. Check authentication with check_auth_status
  2. Run the setup command again: cd /path/to/your/monarch-mcp-server && python login_setup.py
  3. Check error logs for detailed messages
  4. Ensure Monarch Money service is accessible

πŸ”„ Updates

To update the server:

  1. Pull latest changes from repository
  2. Restart Claude Desktop
  3. Re-run authentication if needed: python login_setup.py

About

MCP Server for use with Monarch Money

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%