MCPVault

hledger_close

MCP tool from Hledger MCP by iiAtlas

produces closing/opening assertions, retain-earnings, or clopen transactions via hledger close. Preview the generated entries with dryRun, then append them atomically (with optional backups) once you’re satisfied.

How to use it

hledger_close is exposed by the Hledger MCP MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the hledger_close tool becomes available to the model automatically. See the full listing for setup details and every tool this server provides.

Install Hledger MCP

$npx @iiatlas/hledger-mcp /path/to/your/master.journal
FULL HLEDGER MCP LISTING

Other tools in Hledger MCP (8)

hledger_add_transaction

accepts structured postings and appends a new transaction after validating with hledger check. Enable dryRun to preview the entry without writing.

hledger_import

wraps hledger import, running the command against a temporary copy of the journal. Provide one or more dataFiles (journal, csv, etc.) and an optional rulesFile; set dryRun to inspect the diff before committing. Successful imports create timestamped .bak files unless --skip-backup is active.

hledger_remove_entry

deletes a transaction by exact text and location, re-validating with hledger check and respecting optional backups.

hledger_replace_entry

swaps an existing entry for new content, keeping spacing tidy and performing a validation pass before committing.

hledger_rewrite

runs hledger rewrite on a temporary copy, letting you specify one or more addPostings instructions for matching transactions. Use dryRun for a diff-only preview or diff: true to include the patch output alongside the applied change.

hledger_web

launches the hledger web UI/API on a free port unless a specific port/socket is supplied. The response includes an instanceId that can be used to track or terminate the server later.

hledger_web_list

returns metadata for each active web instance started by this MCP session (PID, command, base URL, access mode, etc.).

hledger_web_stop

stops a selected instance by instanceId, pid, or port, or stops everything with all=true. You can optionally choose the shutdown signal (SIGTERM by default) and timeout.