# mcp-midaz

Connects your coding agent to a self-hosted Midaz ledger to inspect balances, create accounts, and post balanced double-entry transactions.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 274
- Author: codespar
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/codespar/mcp-dev-latam/tree/HEAD/packages/banking/midaz
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-midaz

## What it does

Midaz is an open-source ledger engine for tracking multiple currencies and assets across private infrastructure. Instead of connecting to an external SaaS, this MCP server points directly to your self-hosted setup. It provides five tools that allow an assistant to paginate through account records, check available or on-hold balances per asset, and open new accounts inside a designated ledger.

Financial operations follow strict double-entry mechanics: debits and credits must balance, otherwise Midaz rejects the transaction entirely. Everything maps through an organization-to-ledger hierarchy. Because of this structure, tools require explicit `organization_id` and `ledger_id` values, enabling one session to orchestrate activity across separate ledgers.

Without an active Midaz backend in your environment, this server cannot function. You point it to your network using `MIDAZ_BASE_URL` and `MIDAZ_TRANSACTION_URL`, while `MIDAZ_API_KEY` remains optional unless your deployment mandates bearer authentication.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `MIDAZ_BASE_URL`, `MIDAZ_TRANSACTION_URL`, `MIDAZ_API_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env MIDAZ_BASE_URL=<MIDAZ_BASE_URL> --env MIDAZ_TRANSACTION_URL=<MIDAZ_TRANSACTION_URL> --env MIDAZ_API_KEY=<MIDAZ_API_KEY> --transport stdio midaz -- npx -y @codespar/mcp-midaz
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add midaz --env MIDAZ_BASE_URL=<MIDAZ_BASE_URL> --env MIDAZ_TRANSACTION_URL=<MIDAZ_TRANSACTION_URL> --env MIDAZ_API_KEY=<MIDAZ_API_KEY> -- npx -y @codespar/mcp-midaz
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "midaz": {
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-midaz"
            ],
            "env": {
                "MIDAZ_BASE_URL": "<MIDAZ_BASE_URL>",
                "MIDAZ_TRANSACTION_URL": "<MIDAZ_TRANSACTION_URL>",
                "MIDAZ_API_KEY": "<MIDAZ_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "midaz": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-midaz"
            ],
            "env": {
                "MIDAZ_BASE_URL": "<MIDAZ_BASE_URL>",
                "MIDAZ_TRANSACTION_URL": "<MIDAZ_TRANSACTION_URL>",
                "MIDAZ_API_KEY": "<MIDAZ_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e MIDAZ_BASE_URL=<MIDAZ_BASE_URL> -e MIDAZ_TRANSACTION_URL=<MIDAZ_TRANSACTION_URL> -e MIDAZ_API_KEY=<MIDAZ_API_KEY> midaz npx -y @codespar/mcp-midaz
```
Replace <…> with your own values

## When to use it
- Check available and on-hold asset balances across ledger accounts
- Post balanced double-entry transactions between internal accounts
- Register new accounts under an existing ledger
- Inspect historical transactions alongside their individual operations

## Example prompts
- Transfer 1250 BRL from the treasury account to vendor-acme and print both ending balances.
- List all active accounts under ledger_main for organization org_fin.
- Fetch the current USD balance and hold amounts on account acc_789.

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [CCXT](https://affpapa.org/en/nevibecode/mcp/ccxt.md) — MCP server · ★ 44583
- [Finance Toolkit](https://affpapa.org/en/nevibecode/mcp/finance-toolkit.md) — MCP server · ★ 5458
- [EdgarTools](https://affpapa.org/en/nevibecode/mcp/edgartools.md) — MCP server · ★ 2814
- [LetsFG — Flights & Hotels](https://affpapa.org/en/nevibecode/mcp/letsfg-flights-hotels.md) — MCP server · ★ 2188
- [AutoTS](https://affpapa.org/en/nevibecode/mcp/autots.md) — MCP server · ★ 1434

From the same set: [codespar/mcp-dev-latam](https://affpapa.org/en/nevibecode/by/codespar/mcp-dev-latam.md) — 124 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
