The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

Laravel QuickBooks MCP Server: Connect QuickBooks Online to AI Clients

Last updated on by

Laravel QuickBooks MCP Server: Connect QuickBooks Online to AI Clients image

Laravel QuickBooks MCP Server by 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 table. The ResolveQuickBooksRealm middleware scopes every tool call to the correct company automatically — AI agents never need to specify realm or company IDs:

Route::middleware([
'api',
'auth:api', // or 'sanctum'
ResolveQuickBooksRealm::class,
RefreshQuickBooksToken::class,
])->group(function () {
Mcp::server(QuickBooksServer::class)
->at(config('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:

Route Purpose
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:

Behavior Entities
Soft-delete (deactivate) Customer, Vendor, Employee, Item, Account
Permanent deletion Bill, BillPayment, Estimate, JournalEntry, Purchase
Cannot delete Invoice

Getting Started

Install the package and publish its assets:

composer require rajurayhan/laravel-quickbooks-mcp-server
 
php artisan vendor:publish \
--provider="Raju\QuickBooksMcp\QuickBooksMcpServiceProvider"
 
php artisan migrate

Then configure your Intuit OAuth credentials in .env:

QUICKBOOKS_CLIENT_ID=your_client_id
QUICKBOOKS_CLIENT_SECRET=your_client_secret
QUICKBOOKS_REDIRECT_URI=https://yourdomain.com/quickbooks/callback
QUICKBOOKS_DATA_SOURCE=production

You can find the full documentation and source code on GitHub.

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Laravel Code Review

Get expert guidance in a few days with a Laravel code review

Visit Laravel Code Review
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
SerpApi logo

SerpApi

Access real-time search engine results through a simple API—no more scraping headaches! Use it for AI applications, SEO tools, product research, travel information, and more

SerpApi
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm

The latest

View all →
Drag-and-Drop Sorting for Eloquent Models with Reorderable for Laravel image

Drag-and-Drop Sorting for Eloquent Models with Reorderable for Laravel

Read article
Ship AI with Laravel: Real-Time Streaming Chat UI with Livewire image

Ship AI with Laravel: Real-Time Streaming Chat UI with Livewire

Read article
Frontend Nation 2026 Returns June 3-4 with Laravel in the Lineup image

Frontend Nation 2026 Returns June 3-4 with Laravel in the Lineup

Read article
Use a Google Sheet as Your Laravel Database with the Google Sheets Database Driver image

Use a Google Sheet as Your Laravel Database with the Google Sheets Database Driver

Read article
Larapanda: A Type-Safe Lightpanda Browser SDK for Laravel image

Larapanda: A Type-Safe Lightpanda Browser SDK for Laravel

Read article
Generate HTML Password Rules Attribute in Laravel 13.9.0 image

Generate HTML Password Rules Attribute in Laravel 13.9.0

Read article