VB

vanto/beanquery-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

53 stars 5 forks 质量 49 趋势 0MIT

vanto/beanquery-mcp 是从 https://github.com/vanto/beanquery-mcp. 导入的 MCP 服务器候选

概览

vanto/beanquery-mcp 是从 https://github.com/vanto/beanquery-mcp. 导入的 MCP 服务器候选

概述(AI 翻译)

Beancount MCP 服务器是模型上下文协议(MCP)的实验性实现,旨在与 Beancount 账本文件接口。利用 Beancount 查询语言(BQL)和 Beanquery 工具,该服务器实现了对 Beancount 格式存储的财务数据的无缝查询和分析。通过集成 MCP,该服务器促进了 AI 助手与 Beancount 账本之间的标准化通信,提升了财务数据的可访问性和实用性。

注意:该服务器处于实验阶段,可能会有重大变更。建议在开发环境中使用,并反馈改进。

生成的样本账本可在 sample.bean 中找到

可用资源与工具

  • 工具:
  • set_ledger_file:将 Beancount ledger 文件设置为用于查询(如果不是通过环境变量设置的话)。
  • run_query:对已加载的 Beancount 文件运行 BQL 查询。
  • 资源:
  • beanquery://tables:获取 BQL 可访问的表列表。
  • beanquery://accounts:获取加载的 Beancount 文件中的账户列表。

用 Claude.ai 举例

有关扩展MCP互动的截图,请见此处。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Beanquery MCP

The Beancount MCP Server is an experimental implementation of the Model Context Protocol (MCP) designed to interface with Beancount ledger files. Leveraging the Beancount Query Language (BQL) and the beanquery tool, this server enables seamless querying and analysis of financial data stored in Beancount format. By integrating MCP, the server facilitates standardized communication between AI assistants and Beancount ledgers, enhancing the accessibility and utility of financial data.

Note: This server is experimental and may undergo significant changes. It is recommended to use it in a development environment and provide feedback for further improvements.

A generated sample ledger can be found in sample.bean

Available Resources and Tools

  • Tools:
    • set_ledger_file: Set the Beancount ledger file to use for queries (if not set via environment variable).
    • run_query: Run a BQL query against the loaded Beancount file.
  • Resources:
    • beanquery://tables: Get a list of tables that BQL can access.
    • beanquery://accounts: Get a list of accounts in the loaded Beancount file.

Example using Claude.ai

For a screenshot with expanded MCP interactions, see here.

⚠️ Privacy Warning

This tool interfaces with language model providers (LLMs) via the Model Context Protocol (MCP), and as such may transmit parts of your Beancount ledger—including potentially confidential or private financial information—to third-party services.

Please use this tool with caution, especially when:

  • Your ledger contains sensitive data (e.g., client names, salary details, health-related expenses).
  • You are using a cloud-hosted or non-self-hosted LLM backend.

Recommendations:

  • Mask or redact sensitive data in test ledgers.
  • Use self-hosted LLMs when possible.
  • Review the data being sent via MCP to ensure compliance with your privacy and security requirements.

[!CAUTION] You are responsible for the protection of your financial data. Do not share ledgers you would not be comfortable exposing.

Setup

Prerequisites

  • Python 3.10 or later
  • uv for managing Python projects (recommended)

Usage

Running the Server

  1. Development Mode: Use the MCP Inspector to test and debug your server:

    mcp dev server.py
    
  2. Claude Desktop Integration: Install the server into Claude Desktop:

    mcp install server.py
    
    • Quick Start:
      uv run mcp install server.py -v BEANCOUNT_LEDGER=$(pwd)/sample.bean --with beancount --with beanquery
      
    • Custom Name:
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →