Laravel QuickBooks MCP Server 经过 Raju Rayhan is a Laravel package that exposes QuickBooks Online (QBO) as an MCP server over HTTP transport. It provides 50 MCP tools across 11 QBO entities — customers, vendors, invoices, bills, estimates, etc. — letting AI agents perform full CRUD operations on your books.
The package requires PHP 8.2+, Laravel 11+, and uses
laravel/mcp
for the protocol layer and
spinen/laravel-quickbooks-client
for QuickBooks API access.
Automatic Name-to-ID Resolution
When AI agents reference entities, they can use human-readable names instead of QuickBooks internal IDs. The package resolves names automatically:
# Both of these work when creating a bill:vendor: "Office Depot"vendor: "42"
If a name can't be resolved, the tool returns a descriptive error suggesting the relevant search tool to find the correct entity.
Multi-Tenant Isolation
Each authenticated user maintains one active QuickBooks connection tracked in a
quickbooks_connections
表。
ResolveQuickBooksRealm
middleware scopes every tool call to the correct company automatically — AI agents never need to specify realm or company IDs:
路线
::
中间件
([
‘api’
,
'auth:api'
,
// or 'sanctum'
ResolveQuickBooksRealm
::班级
,
RefreshQuickBooksToken
::班级
,])
->
团体
(
功能
(){
Mcp
::
服务器
(
QuickBooksServer
::班级
)
->
在
(
配置
(
'quickbooks-mcp.path'
));});
A
RefreshQuickBooksToken
middleware proactively refreshes OAuth tokens before they expire, with a configurable buffer (default: 5 minutes).
Built-in OAuth Flow
The package ships with a complete OAuth 2.0 flow for connecting QuickBooks companies. After adding the
HasQuickBooksToken
trait to your User model and setting your Intuit credentials in
.env
, four routes handle the connection lifecycle:
| 路线 | 目的 |
|---|---|
GET /quickbooks/connect |
Initiate OAuth flow |
GET /quickbooks/callback |
Handle OAuth callback |
DELETE /quickbooks/disconnect |
Revoke tokens and remove connection |
GET /quickbooks/connections |
List active connections |
Entity-Aware Delete Behavior
The package respects QuickBooks' deletion rules per entity type:
| 行为 | Entities |
|---|---|
| Soft-delete (deactivate) | Customer, Vendor, Employee, Item, Account |
| Permanent deletion | Bill, BillPayment, Estimate, JournalEntry, Purchase |
| Cannot delete | 发票 |
入门
Install the package and publish its assets:
作曲家
要求
rajurayhan/laravel-quickbooks-mcp-serverphp
工匠
供应商:发布
\
--提供者=
"Raju\QuickBooksMcp\QuickBooksMcpServiceProvider"php
工匠
迁移
Then configure your Intuit OAuth credentials in
.env
:
QUICKBOOKS_CLIENT_ID
=
your_client_idQUICKBOOKS_CLIENT_SECRET
=
your_client_secretQUICKBOOKS_REDIRECT_URI
=
https://yourdomain.com/quickbooks/callbackQUICKBOOKS_DATA_SOURCE
=
生产
You can find the full documentation and source code on GitHub 。






