Qbo Multicompany Mcp

io.github.dkaleganov由 GitHub 账号 dkaleganov 发布v0.1.1更新于 Nov 5, 2026

Unofficial read-only MCP server for several QuickBooks Online company files in one AI session.

概览

AI 生成的概览

非官方只读 MCP 服务器,让助手在一次会话中跨多个 QuickBooks Online 公司账套读取数据,每次调用都需指明公司。

可以做什么
  • 列出已配置的公司、其授权状态与服务器构建信息
  • 读取公司资料、会计科目表、供应商、客户,以及类别、项目、付款条件、税码等参考数据
  • 按时间窗口列出并获取交易明细,并可执行一条解析后的 SELECT 查询
  • 生成利润表、资产负债表、总账、账龄等报表,以及其余已记录的报表
  • 按年度汇总各公司的候选供应商付款金额,并列出列表对象上的变更
  • 列出附件元数据,在启用文档并固定存储主机后可选择性下载文件
适用场景
适合为多家 QuickBooks Online 公司记账、希望助手在不混淆账套的前提下比较公司、结账、追踪交易或核对供应商付款的场景;也可作为构建面向智能体的 MCP 服务器的参考示例。
运行要求
以 PyPI 包形式通过 uvx 在本地以 stdio 运行,需要 Python 3.11+ 与 uv。需要自建 Intuit 开发者应用并注册回调地址,提供 Client ID 与 Client Secret(QBO_CLIENT_ID、QBO_CLIENT_SECRET),一份按 key 列出公司的 entities.yaml,令牌存储密钥(QBO_TOKEN_KEY 或 macOS 钥匙串),并为每家公司完成浏览器登录。QBO_ENV 选择沙箱或生产环境。
安装前请注意
只读由代码强制,Intuit 的授权范围本身也允许写入。密钥存放在明文 .env 中,令牌存储密钥对以你身份运行的程序可读,应避免让 AI 会话在仓库目录内运行。公司名称、备注和报表单元格被标记为不可信输入,可能发送给模型提供方。附件下载需显式开启且仅在沙箱验证过;供应商付款合计只是候选值,未经人工核对。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Qbo Multicompany Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

qbo-multicompany-mcp

A read-only MCP server that serves several QuickBooks Online company files to one AI session over stdio. Every call to QuickBooks names its company through an explicit entity key. There's no default company and no matching on company name.

Unofficial. Not affiliated with or endorsed by Intuit. Each user registers their own Intuit app and answers Intuit's questions for themselves.

Who it's for

  • You run or keep books for more than one QuickBooks company and want an assistant to read across them without mixing them up: close the month, compare companies, trace a transaction, cross-check vendor payments.
  • You build tools for AI agents and want a worked example of an MCP server designed around how a model actually behaves.

Other QuickBooks MCP servers exist, some from Intuit, and some serve several companies or write to the books. Compare them against what you need. This one never writes.

text
AI client  -- stdio -->  qbo-multicompany-mcp  -- GET, checked before send -->  QuickBooks Online                              |                              +-- entities.yaml        your companies, by key                              +-- encrypted store      one token chain per company

Quickstart on sandbox

You need Python 3.11+, uv, and an Intuit developer app with http://localhost:8765/callback registered as a development redirect URI.

bash
git clone https://github.com/dkaleganov/qbo-multicompany-mcp.git
bash
cd qbo-multicompany-mcp && uv sync --frozen && cp entities.example.yaml entities.yaml && cp .env.example .env && chmod 600 .env entities.yaml

Put your app's Client ID and Client Secret in .env, and your sandbox companies in entities.yaml. Then create the store key and connect each company in a browser:

bash
uv run qbo-multicompany-mcp-auth --env-file .env --entities entities.yaml init-key
bash
uv run qbo-multicompany-mcp-auth --env-file .env --entities entities.yaml connect acme_main

A first connect usually reports a name mismatch: answer y and copy the printed display_name into entities.yaml. Then add the server to your client with absolute paths. --scope user makes it available to every Claude Code session on your account, so you can run those sessions outside the repo folder:

bash
claude mcp add --scope user qbo -- "<repo>/.venv/bin/qbo-multicompany-mcp" --env-file "<repo>/.env" --entities "<repo>/entities.yaml"

docs/getting-started.md walks through every step, including Claude Desktop and Codex. Production needs more: docs/production.md.

From PyPI, without a clone

uvx runs the published package. Save .env.example as .env and entities.example.yaml as entities.yaml in a private folder, chmod 600 both, and fill them in as above. With <dir> standing for that folder's absolute path:

bash
uvx --from [email protected] qbo-multicompany-mcp-auth --env-file "<dir>/.env" --entities "<dir>/entities.yaml" init-key
bash
uvx --from [email protected] qbo-multicompany-mcp-auth --env-file "<dir>/.env" --entities "<dir>/entities.yaml" connect acme_main
bash
claude mcp add --scope user qbo -- uvx [email protected] --env-file "<dir>/.env" --entities "<dir>/entities.yaml"

Tools

Eighteen by default, and one opt-in. docs/tools.md has every parameter and a "Choosing a tool" table.

ToolReturns
list_entitiesConfigured companies, auth state and token freshness. Makes no request
server_infoBuild, environment, read-only status, store protection. Makes no request
get_company_infoCompany profile, settings and derived capabilities
list_accountsChart of accounts with balances
list_vendorsVendors, the 1099 flag, and whether a tax id is on file, never the id
list_customersCustomers with their balances, and no tax ids, notes or contact fields
list_reference_dataClasses, departments, items, terms, payment methods, tax codes, tax rates
list_transactionsTransactions in a window of up to six months
get_transactionOne transaction with its lines
run_queryOne parsed SELECT, rebuilt from its parse tree and sent by GET
list_changesChanges and deletions within 30 days, on list objects such as vendors and accounts, with no transactions
summarize_vendor_paymentsPer-vendor candidate totals for a calendar year
report_profit_and_lossIncome and expense by section
report_balance_sheetBalances as of a date
report_general_ledgerPostings by account
report_agingOpen payables or receivables by bucket
run_reportThe other 21 documented reports
list_attachmentsAttachment metadata, never a link
get_attachment (opt-in)The file, only with --allow-documents and a pinned storage host

What makes it work well with AI agents

A model will call the wrong company, trust an empty result, and retry a bad value. The server is built around that.

  • An explicit company on every call. With no default, a model has to name the company each time, so a wrong choice shows in the transcript. list_entities gives the keys, and a guard checks the company's name on first use in each process.
  • Results name their company and age. Every answer from QuickBooks carries the entity, environment, the last four digits of the realm id (Intuit's Company ID), and when it was fetched, so a model can say which file a number came from.
  • One list vocabulary. Every list that walks QuickBooks's pages returns count, rows, truncated, duplicates_dropped and pages_walked, so a model learns the shape once.
  • Partial reports say so first. A problem in a cell or a row makes the result partial, and the text a model reads opens with PARTIAL RESULT. An empty report never establishes that there's no data, and list_transactions re-checks a filtered request with zero rows, unfiltered, before it reports "none".
  • Refusals name the fix and never echo a value. A refusal names the parameter and the reason, usually before any request, and no text, id, date or number you sent comes back; it can name a configured entity key or one of this server's own option values. A test sends a marked value through every parameter of every tool and finds it repeated in no refusal.
  • Company text is flagged as untrusted. Names, memos and report cells can carry anything. Every tool that returns them says in its description that they're untrusted input to the model and that the data can reach its provider.
  • Sign-in stays with a person. Consent happens in a terminal and a browser, secrets come from the environment, and no tool takes a secret or an authorization code or returns one. Anything running as you can read a plain .env and the token store's key, from any folder. Keeping AI sessions out of the repo folder keeps .env and entities.yaml out of an agent's working folder; an agent with a shell can still reach both, and the key, as SECURITY.md explains.
  • Descriptions route. Every tool's description says when another fits better, and the "Choosing a tool" table in docs/tools.md covers the whole surface for people.

Read-only, and how that's enforced

Intuit offers no read-only accounting scope: the one scope covers reads and writes alike. So read-only lives in this code. Every request is inspected as a fully built httpx.Request immediately before it's sent, and accounting requests may only be GETs to an allowlisted path on the exact bound company. OAuth calls go only to Intuit's fixed endpoints, the opt-in attachment download goes only to a host you pin, and everything else is denied. docs/design.md has the policy, and how walks, reports and the token store behave.

How it's verified

  • Tests. uv sync --frozen --extra dev, then uv run pytest -q: 2,805 pass and 4 skip, with no credentials and no network. That count needs git 2.32 or later and gitleaks on your PATH; without gitleaks 25 more skip.
  • Mutation gate. A passing suite doesn't prove a safety behaviour is protected, so scripts/mutation_gate.py has 480 entries that each delete one and require its tests to fail. It has controls of its own, so it can't quietly pass by testing nothing.
  • Leak checks. Custom gitleaks rules for Intuit credentials, each proven to fire on a canary, plus scripts/scrub_check.py for identifier-shaped values.
  • Live runs. Every tool has run over stdio in sandbox: the default tools on this release, and get_attachment on a pre-release build. Every default tool ran on production, read-only, on 2026-09-28 with a pre-release build, apart from TaxSummary under run_report, which has never returned rows. What the live runs found is in docs/api-findings.md.

CHANGELOG.md separates what was verified live from what has only run on fixtures.

Example prompts

Which companies can you see, and is each one connected?

Compare profit and loss for acme_main and acme_ops, this fiscal year-to-date against last. Say where each number came from.

Show the balance sheet for acme_ops as of the end of last quarter, then the journal entries behind any account that moved by more than 10%.

Which vendors in acme_ops carry the 1099 flag?

Give me candidate vendor payments for acme_main for 2025, and what needs review.

Known limits

  • Read only, and QuickBooks Online only. There are no writes, and no QuickBooks Desktop.
  • Transactions have their own tools. On transaction types run_query answers COUNT(*) and refuses SELECT *, and list_changes refuses them too. Use list_transactions and get_transaction.
  • Filters validate differently. An unknown parameter name is discarded upstream, a bad enum value is a 400, and an id or text that matches nothing is an empty 200. This server handles each, and docs/design.md explains how.
  • Vendor payment totals are candidates. They're a cross-check against a bank ledger, not a filing classifier, and they haven't been reconciled by hand against one.
  • Sandbox isn't production. A value confirmed in sandbox may not hold on a production company.
  • Some columns are unobserved. Class, department and currency report columns are documented, but no live response has shown them.
  • get_attachment is only proven in sandbox. Production's storage host hasn't been observed, and the host check is a pre-check, not a binding to the address connected to.
  • Walks aren't snapshots. A complete walk can still straddle an edit, and results say non_snapshot.
  • Rate limits and quotas are Intuit's. The server enforces both documented windows, doesn't send a call it can't count, and reports a 429 rather than sleeping through it.
  • uv.lock is fixed at release. It pins every package the server and its tests install, so run uv lock --upgrade on your own schedule. The build backend, hatchling, isn't in it: uv resolves it when it builds the package.

Support

macOS is tested. Windows is unsupported: the store relies on POSIX file locks. Linux should work with QBO_TOKEN_KEY_SOURCE=env but hasn't been tested. This is an alpha, frozen at this release, with best-effort maintenance: bug reports are welcome, and security reports go through SECURITY.md.

License

MIT. See LICENSE.

来源:README.md,提交 70dce08

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

1
  1. v0.1.1最新Nov 5, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分