QBO-MCP-TS
Provides tools for managing QuickBooks Online invoices, expenses, customers, payments, and financial reports, with automation features like recurring invoices, payment reminders, and workflow rules.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@QBO-MCP-TSShow me my overdue invoices"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
QuickBooks Online MCP Server
A production-ready, modular Model Context Protocol (MCP) server for QuickBooks Online integration. Built with TypeScript, designed for accountants, with comprehensive automation features and real-time capabilities.
๐ Features
Core Capabilities
โ Modular Architecture - Extensible tool and service system
โ Full CRUD Operations - Invoices, expenses, customers, payments
โ Financial Reporting - P&L, Balance Sheet, Cash Flow, AR/AP Aging
โ Real-Time Updates - SSE transport and QuickBooks webhooks
โ Workflow Automation - Rule-based automation engine
โ Multi-Company Support - Manage multiple QBO companies
โ Production-Ready - Comprehensive error handling, caching, rate limiting
Automation Features
๐ Recurring Invoices - Automated invoice generation (daily โ yearly)
๐ง Payment Reminders - Smart follow-up sequences (4-tier system)
๐ค Workflow Engine - Conditional rules and automated actions
๐ Scheduled Reports - Automated report generation and distribution
Developer Experience
๐งช Testing Infrastructure - Jest with comprehensive test utilities
๐ TypeScript Strict Mode - Complete type safety
๐ Extensive Logging - Structured logging with context
๐ Comprehensive Documentation - Examples and guides
Related MCP server: QuickBooks Online MCP Server
๐ฆ Installation
# Clone the repository
git clone https://github.com/vespo92/QBO-MCP-TS.git
cd QBO-MCP-TS
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env with your QuickBooks credentials
# Build
npm run build
# Run
npm start๐ง Configuration
Environment Variables
# QuickBooks OAuth
CLIENT_ID=your_client_id
CLIENT_SECRET=your_client_secret
COMPANY_ID=your_company_id
REFRESH_TOKEN=your_refresh_token
# Environment
QBO_ENVIRONMENT=sandbox # or 'production'
NODE_ENV=development
# SSE Transport (optional)
SSE_PORT=3100
SSE_HOST=localhost
# Webhook Receiver (optional)
WEBHOOK_PORT=3200
WEBHOOK_VERIFIER_TOKEN=your_webhook_token
# Cache Settings
CACHE_TTL=300
CACHE_MAX_SIZE=100
ENABLE_CACHE=true
# API Settings
RETRY_ATTEMPTS=3
RETRY_DELAY=1000
TIMEOUT=30000
RATE_LIMIT=60
# Redis (optional)
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_DB=0๐ ๏ธ Available Tools
Invoice Management
get_invoices- Query invoices with filteringcreate_invoice- Create invoices with line itemssend_invoice- Email invoices to customers
Expense Management
get_expenses- Query expenses with filteringcreate_expense- Create expenses with auto vendor/account lookup
Customer Management
get_customers- Query and search customersget_customer_balance- Get balance details with overdue tracking
Financial Reporting
get_profit_loss- Profit & Loss statementsget_balance_sheet- Balance Sheet reportsget_cash_flow- Cash Flow statementsget_ar_aging- Accounts Receivable agingget_ap_aging- Accounts Payable aging
Utilities
get_api_status- Server health and metrics
๐ Usage Examples
Create an Invoice
{
"tool": "create_invoice",
"params": {
"customerName": "Acme Corp",
"items": [
{
"description": "Web Design Services",
"amount": 2500,
"quantity": 1
},
{
"description": "Hosting (1 year)",
"amount": 600,
"quantity": 1
}
],
"dueDate": "net 30",
"emailToCustomer": true
}
}Query Overdue Invoices
{
"tool": "get_invoices",
"params": {
"status": "overdue",
"dateFrom": "this year",
"dateTo": "today"
}
}Generate Profit & Loss Report
{
"tool": "get_profit_loss",
"params": {
"startDate": "this quarter",
"endDate": "today",
"accountingMethod": "Accrual",
"summarizeBy": "Month"
}
}๐ Automation Setup
Recurring Invoices
import { automationService } from './services/automation.service';
const scheduleId = await automationService.createRecurringInvoice({
customerId: '123',
lineItems: [
{ description: 'Monthly Retainer', amount: 5000 }
],
frequency: 'monthly',
startDate: new Date('2025-01-01'),
dueInDays: 30,
autoSend: true
});Workflow Rules
import { workflowService } from './services/workflow.service';
workflowService.addRule({
id: 'auto-approve-small-expenses',
name: 'Auto-approve small expenses',
enabled: true,
trigger: 'expense:submitted',
conditions: [
{ field: 'TotalAmt', operator: 'lt', value: 100 },
{ field: 'category', operator: 'in', value: ['Office Supplies'] }
],
actions: [
{ type: 'approve', notify: 'submitter' },
{ type: 'broadcast_event', eventType: 'expense:auto_approved' }
]
});๐ Real-Time Features
Server-Sent Events (SSE)
Start the SSE server for real-time client updates:
import { getSSETransport } from './transports/sse.transport';
const sse = getSSETransport();
await sse.start();
// Events automatically broadcast:
// - invoice:created, invoice:updated, invoice:paid
// - payment:received
// - expense:created
// - customer:created
// - report:ready
// - webhook:receivedQuickBooks Webhooks
Receive real-time notifications from QuickBooks:
import { getWebhookReceiver } from './webhooks/receiver';
const webhooks = getWebhookReceiver({
port: 3200,
verifierToken: process.env.WEBHOOK_VERIFIER_TOKEN
});
// Register handlers
webhooks.on('invoice:create', async (data) => {
console.log('Invoice created:', data.id);
// Cache invalidation, notifications, etc.
});
await webhooks.start();๐ข Multi-Company Support
Manage multiple QuickBooks companies:
import { multiCompanyService } from './services/multi-company.service';
// Add companies
await multiCompanyService.addCompany('company1', {
name: 'Acme Corp',
config: { /* QBO config */ }
});
await multiCompanyService.addCompany('company2', {
name: 'XYZ Inc',
config: { /* QBO config */ }
});
// Switch between companies
multiCompanyService.setActiveCompany('company1');
const invoices = await invoiceService.getInvoices();
multiCompanyService.setActiveCompany('company2');
const expenses = await expenseService.getExpenses();๐พ Redis Cache (Optional)
Enable Redis for distributed caching:
import { createRedisCacheService } from './services/cache-redis.service';
const cache = await createRedisCacheService({
host: 'localhost',
port: 6379,
keyPrefix: 'qbo:',
enableFallback: true // Falls back to in-memory if Redis unavailable
});
// Automatically used by all services๐งช Testing
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverageWriting Tests
import { createMockInvoice, MockQBOApiClient } from './test-utils';
describe('InvoiceService', () => {
it('should create invoice', async () => {
const mockClient = new MockQBOApiClient();
const service = new InvoiceService(mockClient);
const invoice = await service.createInvoice({
customerName: 'Test Customer',
lineItems: [{ description: 'Test', amount: 100 }]
});
expect(invoice.Id).toBeDefined();
});
});๐ Architecture
Service Layer
InvoiceService - Invoice operations and AR aging
ExpenseService - Expense management with vendor lookup
ReportService - 15+ financial reports with PDF export
CustomerService - Customer management and balance tracking
PaymentService - Payment recording and application
AutomationService - Recurring invoices and payment reminders
WorkflowService - Rule-based automation engine
Tool System
BaseTool - Abstract base with automatic validation
ToolRegistry - Auto-discovery and registration
Modular Structure - Each tool is self-contained
Transport Layer
SSE Transport - Real-time server-to-client streaming
Webhook Receiver - QuickBooks event notifications
STDIO Transport - Standard MCP communication
๐ Security
โ OAuth 2.0 with automatic token refresh
โ HMAC-SHA256 webhook signature verification
โ Replay attack prevention
โ Input validation with Zod schemas
โ Sensitive data sanitization in logs
โ Rate limiting and request queuing
๐ Performance
โ Multi-tier caching (in-memory + optional Redis)
โ Request queuing to prevent API throttling
โ Exponential backoff retry logic
โ Batch operations where possible
โ Lazy service initialization
๐ Error Handling
50+ predefined errors with actionable suggestions:
{
code: 'QBO_AUTH_001',
message: 'Your QuickBooks session has expired',
suggestion: 'Refreshing authentication automatically...',
recoverable: true,
severity: 'warning'
}Automatic retry for recoverable errors:
Token refresh failures
Rate limit exceeded
Network timeouts
Transient errors
๐ Documentation
FEATURES.md - Comprehensive feature documentation
ACCOUNTANT_NEEDS_RESEARCH.md - Accountant requirements research
IMPLEMENTATION_PLAN.md - Technical roadmap
API Examples - See
examples/directory
๐ค Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Add tests for new features
Ensure all tests pass
Submit a pull request
๐ License
MIT License - see LICENSE file for details
๐ Acknowledgments
Built with @modelcontextprotocol/sdk
QuickBooks Online API documentation
TypeScript and Node.js communities
๐ Support
Issues: GitHub Issues
Documentation: See docs in repository
API Reference: See FEATURES.md
Made with โค๏ธ for accountants who want to automate their workflows
This server cannot be installed
Maintenance
Latest Blog Posts
- 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/vespo92/QBO-MCP-TS'
If you have feedback or need assistance with the MCP directory API, please join our Discord server