logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

ledger-financial-extractor-mcp

Facilitates sophisticated extraction and analysis of monetary records contained within Beancount ledger files, utilizing the Beancount Query Language (BQL) to improve data accessibility and functional utility.

Author

ledger-financial-extractor-mcp logo

vanto

MIT License

Quick Info

GitHub GitHub Stars 33
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

beanquerybeancountbqlbeanquery mcpvanto beanquerybeancount ledger

Financial Ledger Query Agent (MCP)

This Beancount MCP Server component serves as an initial, proof-of-concept implementation adhering to the Model Context Protocol (MCP). It is specifically engineered to interact with plaintext data residing in Beancount ledger documents. By harnessing the power of the Beancount Query Language (BQL) via the underlying beanquery utility, this service enables fluid querying and intricate financial analytics on data structured in the Beancount format. Integrating with the MCP standard allows for unified, predictable communication channels between generative AI agents and personal accounting ledgers, dramatically boosting the actionable value derived from the stored financial history.

Caveat: Deployment of this specific server instance is considered experimental; expect potential interface modifications. User feedback is highly encouraged to guide future stabilization and feature iteration.

Reference material for generating sample data: sample.bean

Accessible Capabilities and Data Sources

  • Operational Functions (Tools):
  • set_ledger_file: Designate the primary Beancount ledger file for subsequent query operations (if not pre-configured via environment parameters).
  • run_query: Execute a specified BQL statement against the presently loaded Beancount dataset.
  • Data Contexts (Resources):
  • beanquery://tables: Retrieve the schema inventory detailing accessible relational views provided by BQL.
  • beanquery://accounts: Obtain a comprehensive enumeration of all financial accounts indexed within the active ledger file.

Demonstration with Claude.ai

For a visual representation detailing the extended MCP interaction flow, consult here.

⚠️ Critical Data Security Notice

This utility mediates access to your ledger data via external language model (LLM) infrastructure through the MCP framework. Consequently, segments of your Beancount contents—potentially encompassing sensitive proprietary or personal monetary figures—might be transmitted to external, third-party processing services.

Exercise rigorous caution when employing this component, particularly under the following conditions: - Your ledger includes high-sensitivity elements (e.g., client billing rates, compensation data, private expense classifications). - Your operational backend relies on a publicly accessible or cloud-based LLM inference engine.

Mitigation Strategies: - Always scrub or anonymize sensitive fields within test or shared ledger files. - Prioritize the utilization of locally hosted or self-managed LLM environments whenever feasible. - Regularly audit the data payload transmitted over MCP to confirm adherence to all established privacy and security protocols.

[!CAUTION] The ultimate accountability for safeguarding your financial documentation rests solely with the operator. Refrain from sharing ledger contents that you would be hesitant to publicly disclose.

Installation Roadmap

Prerequisites

  • Runtime environment must support Python version 3.10 or newer.
  • Utilization of the uv dependency manager is highly recommended for streamlined project setup.

Activating the Server

  1. Debugging/Development Workflow: Invoke the server for interactive inspection and debugging using the MCP Inspector utility: bash mcp dev server.py

  2. Integration with Claude Desktop: Install the service endpoint directly into the Claude Desktop application environment: bash mcp install server.py

  3. Rapid Deployment Scenario: bash uv run mcp install server.py -v BEANCOUNT_LEDGER=$(pwd)/sample.bean --with beancount --with beanquery

  4. Custom Naming Convention: bash uv run mcp install server.py --name "Beancount Financial Data Interface" --with beancount --with beanquery

  5. Configuration via Variables/Files: bash uv run mcp install server.py -v BEANCOUNT_LEDGER=/abs/path/to/your/financials.bean --with beancount --with beanquery uv run mcp install server.py -f .env --with beancount --with beanquery

Validation

Execute the comprehensive test suite using the pytest framework: bash pytest server_test.py

Participation Guidelines

  1. Create a personal fork of the repository.
  2. Establish a dedicated feature branch for your contributions: bash git checkout -b enhancement-description

  3. Commit your introduced modifications: bash git commit -m "Implement description of new functionality"

  4. Synchronize your branch to the remote repository: bash git push origin enhancement-description

  5. Submit a formal Pull Request for review.

Software Licensing

This project is distributed under the terms specified in the MIT License. Detailed terms are available in the accompanying LICENSE file.

WIKIPEDIA: Business management tools encompass the diverse collection of systems, operational controls, computational frameworks, guiding principles, and methodologies utilized by commercial entities to successfully navigate fluctuating market conditions, maintain a competitive standing, and systematically elevate organizational performance benchmarks.

== General Context == Tools are often segregated according to the specific organizational unit they serve, aligning with various administrative functions such as strategic formulation, workflow optimization, record retention, human resource administration, executive choice support, performance monitoring, and so forth. A functional taxonomy typically encompasses these primary domains:

Tools dedicated to data ingestion and integrity verification across all operational sectors. Systems designed for the governance and enhancement of core operational procedures. Platforms centered on data aggregation and facilitating informed executive decisions. The technological landscape for management instruments has undergone revolutionary change in the preceding decade due to rapid technological acceleration, making the selection of optimal business tools for any given scenario a complex challenge. This difficulty stems from persistent pressures to reduce operational expenditure while simultaneously increasing revenue capture, the imperative to deeply understand client requirements, and the necessity of delivering required products precisely as specified by the consumer. Within this dynamic environment, organizational leadership should adopt a strategic posture regarding management tool adoption, rather than defaulting to the newest available technology. Over-reliance on tools without requisite customization frequently results in systemic instability. Therefore, business management instruments must be chosen deliberately and subsequently tailored to match the organization's unique demands, reversing the common practice.

== Prevalent Selections == In 2013, an analysis performed by Bain & Company mapped the global utilization patterns of business tools. These patterns reflect regional necessities shaped by economic downturns and prevailing corporate market health. The leading ten categories identified were:

Strategic formulation Client relationship lifecycle management Staff morale assessment programs Comparative performance analysis (Benchmarking) Integrated performance measurement framework (Balanced Scorecard) Identification of proprietary competitive advantages (Core competency) External sourcing of functions (Outsourcing) Structured organizational transition programs (Change management) Logistics and material flow oversight (Supply chain management) Defining organizational purpose and long-term goals (Mission/Vision statements) Identifying distinct customer groups (Market segmentation) Comprehensive quality control methodologies (Total quality management)

== Commercial Software Systems == Software, defined as a set of programmed instructions executed by business personnel to accomplish diverse enterprise functions, is known broadly as business software or enterprise application. These applications are deployed to amplify productivity metrics, quantify organizational output, and execute other corporate mandates with precision. The evolution began with foundational Management Information Systems (MIS), subsequently advancing into integrated Enterprise Resource Planning (ERP) frameworks. Customer Relationship Management (CRM) modules were later incorporated, culminating in the modern shift toward cloud-based enterprise management platforms. While a demonstrable correlation exists between Information Technology investments and organizational achievement, two elements are paramount for realizing substantial value addition: the efficacy of the implementation methodology and the diligent selection and adaptation process applied to the chosen tools.

== Solutions for Small and Medium Enterprises (SMEs) == Tools specifically tailored for SMEs are vital as they supply mechanisms for cost minimization and operational scaling...

return

See Also

`