mcp-server
v0.24.0MCP server for rustledger - validate, query, and format Beancount ledgers
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
validate
Validate a Beancount ledger — the same checks the `rledger check` CLI runs, including booking, balance assertions and per-transaction zero-sum. Returns validation errors and warnings if any issues are found.
| Parameter | Type | Description |
|---|---|---|
source * | string | The Beancount ledger source text to validate |
query
Run a BQL (Beancount Query Language) query on a ledger. Use this for account balances, filtering transactions, aggregations, etc.
| Parameter | Type | Description |
|---|---|---|
query * | string | The BQL query to execute (e.g., "SELECT account, sum(position) GROUP BY account") |
source * | string | The Beancount ledger source text |
balances
Get account balances from a ledger. This is a shorthand for running a BALANCES query.
| Parameter | Type | Description |
|---|---|---|
source * | string | The Beancount ledger source text |
format
Format a Beancount ledger with consistent alignment and spacing.
| Parameter | Type | Description |
|---|---|---|
source * | string | The Beancount ledger source text to format |
parse
Parse a Beancount ledger and return the directives as structured data.
| Parameter | Type | Description |
|---|---|---|
source * | string | The Beancount ledger source text to parse |
completions
Get BQL query completions at a cursor position. Useful for building query editors.
| Parameter | Type | Description |
|---|---|---|
cursor_pos * | number | The cursor position (character offset) in the query |
partial_query * | string | The partial BQL query text |
list_plugins
List available native plugins that can process ledgers.
run_plugin
Run a native plugin on a ledger.
| Parameter | Type | Description |
|---|---|---|
plugin_name * | string | The name of the plugin to run (use list_plugins to see available plugins) |
source * | string | The Beancount ledger source text |
editor_completions
Get context-aware completions for Beancount source at a given position. Returns account names, currencies, directives, etc. When `file_path` is given, `include` directives are resolved so completions also offer accounts/commodities defined in included files.
| Parameter | Type | Description |
|---|---|---|
character * | number | Character position in the line (0-indexed) |
line * | number | Line number (0-indexed) |
file_path | string | Path to the ledger file under the cursor. Read from disk when `source` is omitted, and used to resolve `include` directives (relative to its directory) so the result reflects the whole ledger, not jus… |
source | string | The Beancount ledger source text. Optional when `file_path` is given; if both are provided, `source` is the (unsaved) buffer contents and wins, while `file_path` still anchors include resolution. |
editor_hover
Get hover information for a symbol at the given position. Returns documentation for accounts, currencies, and directives. When `file_path` is given, `include` directives are resolved so an account's balance and transaction count reflect the whole ledger, not just the edited file.
| Parameter | Type | Description |
|---|---|---|
character * | number | Character position in the line (0-indexed) |
line * | number | Line number (0-indexed) |
file_path | string | Path to the ledger file under the cursor. Read from disk when `source` is omitted, and used to resolve `include` directives (relative to its directory) so the result reflects the whole ledger, not jus… |
source | string | The Beancount ledger source text. Optional when `file_path` is given; if both are provided, `source` is the (unsaved) buffer contents and wins, while `file_path` still anchors include resolution. |
editor_definition
Get the definition location for a symbol (account or currency). Returns the location of the Open or Commodity directive. Operates on the edited document only (cross-file definitions are not resolved).
| Parameter | Type | Description |
|---|---|---|
character * | number | Character position in the line (0-indexed) |
line * | number | Line number (0-indexed) |
file_path | string | Path to the ledger file to read when `source` is omitted. This tool operates on the edited document only; `include` directives are not followed (its result is a location within this file). |
source | string | The Beancount ledger source text. Optional when `file_path` is given; if both are provided, `source` is the (unsaved) buffer contents and wins, while `file_path` still anchors include resolution. |
editor_document_symbols
Get all symbols in the document for an outline/structure view. Returns all directives with their positions. Operates on the edited document only (included files are not inlined).
| Parameter | Type | Description |
|---|---|---|
file_path | string | Path to the ledger file to read when `source` is omitted. This tool operates on the edited document only; `include` directives are not followed (its result is a location within this file). |
source | string | The Beancount ledger source text. Optional when `file_path` is given; if both are provided, `source` is the (unsaved) buffer contents and wins, while `file_path` still anchors include resolution. |
editor_references
Find all references to a symbol (account, currency, or payee) at the given position. Returns all locations where the symbol is used. Operates on the edited document only (cross-file references are not resolved).
| Parameter | Type | Description |
|---|---|---|
character * | number | Character position in the line (0-indexed) |
line * | number | Line number (0-indexed) |
file_path | string | Path to the ledger file to read when `source` is omitted. This tool operates on the edited document only; `include` directives are not followed (its result is a location within this file). |
source | string | The Beancount ledger source text. Optional when `file_path` is given; if both are provided, `source` is the (unsaved) buffer contents and wins, while `file_path` still anchors include resolution. |
ledger_stats
Get statistics about a ledger: counts of directives, accounts, currencies, date range, etc.
| Parameter | Type | Description |
|---|---|---|
source * | string | The Beancount ledger source text |
list_accounts
List all accounts in the ledger with their open/close dates and currencies.
| Parameter | Type | Description |
|---|---|---|
source * | string | The Beancount ledger source text |
list_commodities
List all currencies/commodities used in the ledger.
| Parameter | Type | Description |
|---|---|---|
source * | string | The Beancount ledger source text |
account_activity
Get activity summary for a specific account: first/last transaction, total transactions, currencies used.
| Parameter | Type | Description |
|---|---|---|
account * | string | The account name to analyze (e.g., 'Assets:Checking') |
source * | string | The Beancount ledger source text |
format_check
Check if a ledger is properly formatted. Returns differences if formatting would change the file.
| Parameter | Type | Description |
|---|---|---|
source * | string | The Beancount ledger source text |
bql_tables
Get documentation for BQL tables (entries, postings, etc.) and their available columns.
directive_at_line
Get the directive at a specific line number in the source.
| Parameter | Type | Description |
|---|---|---|
line * | number | Line number (1-indexed) |
source * | string | The Beancount ledger source text |
find_transactions
Find transactions matching criteria: payee, narration, tags, or date range.
| Parameter | Type | Description |
|---|---|---|
source * | string | The Beancount ledger source text |
from_date | string | Filter by start date (YYYY-MM-DD) |
limit | number | Maximum number of results (default: 50) |
narration | string | Filter by narration (substring match) |
payee | string | Filter by payee (substring match) |
tag | string | Filter by tag |
to_date | string | Filter by end date (YYYY-MM-DD) |
report
Generate financial reports: balance sheet, income statement, holdings, or net worth.
| Parameter | Type | Description |
|---|---|---|
report_type * | string | Type of report to generate |
source * | string | The Beancount ledger source text |
currency | string | Convert all amounts to this currency (optional) |
validate_file
Validate a Beancount file from the filesystem — the same checks the `rledger check` CLI runs, including booking, balance assertions and per-transaction zero-sum. Handles includes automatically.
| Parameter | Type | Description |
|---|---|---|
file_path * | string | Path to the Beancount file to validate |
query_file
Run a BQL query on a Beancount file from the filesystem.
| Parameter | Type | Description |
|---|---|---|
file_path * | string | Path to the Beancount file |
query * | string | The BQL query to execute |
format_file
Format a Beancount file. Can optionally write the formatted output back to the file.
| Parameter | Type | Description |
|---|---|---|
file_path * | string | Path to the Beancount file to format |
write | boolean | If true, write the formatted output back to the file |
import_categorize
Suggest an expense/income account for a transaction based on its payee and description. Uses the ledger's existing accounts as candidates. Returns a prompt you can use to ask the LLM for categorization, along with the list of known accounts.
| Parameter | Type | Description |
|---|---|---|
date * | string | The transaction date (YYYY-MM-DD) |
narration * | string | The transaction description/narration |
source * | string | The beancount ledger source (to extract known accounts) |
amount | string | The transaction amount (e.g., '-85.23') |
currency | string | The currency (default: USD) |
payee | string | The transaction payee (e.g., 'WHOLE FOODS MARKET') |
import_review
Find transactions in the ledger that need import review (have import-confidence metadata). Returns transactions grouped by confidence level.
| Parameter | Type | Description |
|---|---|---|
source * | string | The beancount ledger source |