bokio-mcp
bokio-mcp
一个用于 Bokio 会计 API 的 MCP 服务器。它通过一个 Bokio 公司暴露 85 个工具 —— 发票、客户、供应商、供应商发票、日记账分录、贷项通知单、会计科目表、会计年度、项目、标签、上传、SIE 导出和银行付款 —— 因此 MCP 客户端可以读取并(可选地)写入你的簿记。
无需账户、无需数据库、无需托管服务。每个服务器实例对应一家公司。
"Which invoices are still unpaid?"
"Book the attached receipt against account 6570."
"Export the SIE file for the 2025 fiscal year."快速开始
使用固定测试数据试用,无需 Bokio 账户:
BOKIO_MOCK=true npx bokio-mcp status
# { "companyName": "Testbolaget AB", "status": "active", ... }BOKIO_MOCK=true 会在进程内提供一个模拟的 Bokio,因此在你拥有任何凭据之前,完整的工具面即可工作。
对于真实数据,请从下面两条凭据路线中选择一条,并将服务器添加到你的 MCP 客户端。
路线 A — 私有集成令牌(推荐)
在 Bokio 中:公司设置 → 集成 → API 令牌 → 创建私有集成。该令牌长期有效,范围限定于该公司,且无需 OAuth 审核。
{
"mcpServers": {
"bokio": {
"command": "npx",
"args": ["-y", "bokio-mcp"],
"env": {
"BOKIO_INTEGRATION_TOKEN": "your-token",
"BOKIO_COMPANY_ID": "the-company-uuid-from-the-bokio-url"
}
}
}
}路线 B — OAuth
在 Bokio 开发者门户中注册一个集成,重定向 URI 为 http://127.0.0.1:7337/callback,然后:
export BOKIO_CLIENT_ID=... BOKIO_CLIENT_SECRET=...
npx bokio-mcp login这会在你的浏览器中打开 Bokio,并将令牌写入 ~/.config/bokio-mcp/tokens.json(模式 0600)。访问令牌会自动刷新,包括刷新令牌轮换。将你的 MCP 客户端指向 npx -y bokio-mcp,并设置相同的两个环境变量。
Related MCP server: QuickBooks Online MCP Server
默认关闭写入
全新安装可以读取但不能写入。变更工具不仅仅是被阻止——它们不出现在 tools/list 中,因此模型永远不会提出它无法执行的编辑:
BOKIO_ALLOW_WRITES=true在 85 个工具中,38 个是只读的,47 个会变更。先不带该标志启动,确认模型读取的内容符合预期,然后再开启写入。
命令
| 通过 stdio 提供服务——MCP 客户端启动的就是它 |
| 在 |
| 通过 OAuth 连接一家公司 |
| 打印当前连接并退出 |
HTTP 传输
用于自托管,例如在反向代理或容器后面:
MCP_AUTH_TOKEN=$(openssl rand -hex 32) bokio-mcp serve --http/mcp 随后由该静态 Bearer 令牌保护。如果没有 MCP_AUTH_TOKEN,服务器仅绑定 127.0.0.1,而不是暴露一个未经身份验证的桥梁来访问实时会计数据。附带了一个 Dockerfile;它默认使用此传输方式。
环境变量
Variable | Default | |
| — | 路线 A:私有集成令牌 |
| — | 路线 A:公司的 UUID |
| — | 路线 B:OAuth 凭据 |
|
| 注册变更工具 |
|
| 提供进程内固定测试数据,而不是 Bokio |
| 参见 |
|
|
| OAuth 令牌的存放位置 |
| — | 可选的静态 AES-256-GCM 加密; |
|
| 内联上传/下载的大小上限 |
|
| HTTP 传输 |
| — | 保护 |
|
|
|
参见 .env.example 获取带注释的版本。
关于令牌存储的说明
OAuth 令牌文件以 0600 模式明文存储,除非设置了 BOKIO_TOKEN_ENCRYPTION_KEY —— 这与 gh 和 aws CLI 的做法相同。在个人机器上,将密钥存储在被加密对象旁边作用不大;当文件存放在不太私密的地方(例如容器镜像或共享主机)时,请设置该密钥。
开发
npm install
npm test # 36 tests, no database, no credentials
npm run typecheck
npm run dev # tsx watch, stdio transportBOKIO_MOCK=true 会在 fetch 层将每个 Bokio 请求路由到进程内模拟,因此它在 stdio、HTTP 以及没有服务器运行的测试中表现一致。test/mcp.test.ts 针对它端到端驱动真实的 MCP 协议。
工具定义是手写在 src/tools/bokio/ 中的,但每个工具的路径和方法都会在编译时由 op() 辅助函数对照 OpenAPI 规范进行检查——路由中的拼写错误会导致构建失败。使用以下命令重新生成规范类型:
npm run gen:bokio不支持
每个实例支持多家公司。 Bokio 凭据是按公司划分的;如需第二家公司,请运行第二个实例。
提升的范围。
bank-payments:*需要 Bokio 对每个集成进行单独批准。银行付款工具已注册,但在你的集成获得批准并将范围添加到BOKIO_SCOPES之前,它们将无法使用。
许可证
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables seamless integration with SnelStart accounting data, allowing users to manage multiple administrations, process invoices, and handle bookings through the B2B API. It supports comprehensive read/write operations, VAT summary generation, and document processing for UBL invoices and bank statements.
- AlicenseBqualityAmaintenanceEnables interaction with the QuickBooks Online Accounting API to manage customers, invoices, expenses, and payments through MCP-compatible clients. It supports comprehensive financial workflows and the generation of reports like Profit and Loss or Balance Sheets.1332Apache 2.0
- FlicenseNot gradedqualityBmaintenanceMulti-tenant MCP server connecting accounting software to AI assistants via ~87 tools. Supports Bokio (Swedish accounting) with mock mode for development.
- AlicenseNot gradedqualityBmaintenanceExposes ~60 tools for the Merit Aktiva accounting API, covering sales/purchase invoices, payments, customers, vendors, items, general ledger, offers, reference data, and reports with both read and write operations.20MIT
Related MCP Connectors
Apideck Unified API MCP — 330 tools across 200+ SaaS connectors (accounting, CRM, HRIS, ATS).
Conta Azul ERP MCP — sales, customers, finance and NF-e via OAuth 2.0. Read + write, 35 tools.
SMB broker MCP: find, verify & book with businesses. 19 tools, 11 free read tools. Free API keys.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/straycatse/bokio-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server