Hledger MCP
未认领A local MCP server for interacting with the HLedger cli
安装
npx @iiatlas/hledger-mcp /path/to/your/master.journal工具(9 个)
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_close
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.
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.