Skip to main content
MI

Midaz

v0.1.0API Key

Lerian's open-source multi-currency double-entry ledger. Self-hosted: the connection stores your deployment endpoint and agents post entries via codespar_ledger.

5 tools3 env vars๐ŸŒ GLOBALstable on npm

What your agent can do

Midaz gives your agent 5 tools it calls directly โ€” pick the ones it needs, in Claude, Cursor, or any MCP client.

  • create_account โ€” Create an account in a ledger (POST /v1/organizations/{org}/ledgers/{ledger}/accounts). Accounts hold balances per asset code (e.g. BRL, USD, USDC).
  • list_accounts โ€” List a ledger's accounts (GET /v1/organizations/{org}/ledgers/{ledger}/accounts). Paginated via limit/page.
  • get_balance โ€” Read an account's balances (GET /v1/organizations/{org}/ledgers/{ledger}/accounts/{account}/balances). Returns available and on-hold amounts per asset.
Example call
// Your agent calls a tool directly โ€” no glue code.
// CodeSpar's managed tier handles OAuth2, token rotation and rate limits.
const result = await session.call("create_account", { /* ... */ });

Install

terminal
$ npm install @codespar/mcp-midaz

Quickstart

Add this entry to your claude_desktop_config.json (or any MCP-compatible client config).

claude_desktop_config.json
{
  "mcpServers": {
    "midaz": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-midaz"
      ],
      "env": {
        "MIDAZ_BASE_URL": "<your_midaz_base_url>"
      }
    }
  }
}

After restart, your agent can call any of the 5 tools below โ€” try create_account first.

Environment variables ยท 3

Required to authenticate the server. Stored encrypted when using CodeSpar managed hosting.

MIDAZ_BASE_URL
required

Base URL of your self-hosted Midaz onboarding service

MIDAZ_TRANSACTION_URL
optional

Base URL of the Midaz transaction service. Defaults to MIDAZ_BASE_URL.

MIDAZ_API_KEY
optionalsecret

Bearer token when your deployment enforces auth

Available tools ยท 5

Each tool is independent โ€” your agent loads only what it needs to reduce context and response time.

WRITEcreate_account
Create an account in a ledger (POST /v1/organizations/{org}/ledgers/{ledger}/accounts). Accounts hold balances per asset code (e.g. BRL, USD, USDC).
READlist_accounts
List a ledger's accounts (GET /v1/organizations/{org}/ledgers/{ledger}/accounts). Paginated via limit/page.
READget_balance
Read an account's balances (GET /v1/organizations/{org}/ledgers/{ledger}/accounts/{account}/balances). Returns available and on-hold amounts per asset.
WRITEcreate_transaction
Post a balanced double-entry transaction (POST /v1/organizations/{org}/ledgers/{ledger}/transactions/json). The send block debits source accounts and credits distribute targets; amounts must balance. Accounts are referenced by id or @alias.
READget_transaction
Fetch a transaction with its operations (GET /v1/organizations/{org}/ledgers/{ledger}/transactions/{id}).

Compatible frameworks

MCP is a protocol โ€” any framework that speaks it can mount this server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Any MCP clientProtocol

Frequently asked questions

Run `npx -y @codespar/mcp-midaz` and add the config block above to your MCP client โ€” Claude, Cursor, VS Code, or any MCP-compatible client. No build step, no SDK required. Prefer hosted? CodeSpar's managed tier runs it for you with auth handled.
Midaz โ€” MCP server ยท 5 tools | CodeSpar