quickbooks-mcp

richardbaxterseo/quickbooks-mcp

3.2

If you are the rightful owner of quickbooks-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The QuickBooks MCP Server (BETA) is a Model Context Protocol server that provides natural language access to QuickBooks financial data, built with TypeScript and the node-quickbooks package.

QuickBooks MCP Server (BETA)

⚠️ BETA SOFTWARE: This is beta software. Please test thoroughly in a sandbox environment before using with production data.

A Model Context Protocol (MCP) server that provides natural language access to QuickBooks financial data. Built with TypeScript and the node-quickbooks package.

πŸš€ Features

  • Profit & Loss Reports - Get P&L data with quarterly/monthly breakdowns
  • Company Information - Retrieve basic company details and settings
  • Financial Analysis - Natural language queries for financial data
  • Flexible Date Ranges - Query any time period
  • Detailed Breakdowns - Revenue by service type, expenses by category
  • Real-time Data - Current business transactions and balances

πŸ“‹ Available Functions

get_company_info

Retrieves basic company information including name, address, fiscal year settings, and QuickBooks plan details.

Usage: "What's our company information?" or "Show me company details"

get_profit_and_loss

Generates Profit & Loss reports for specified date ranges with optional period breakdowns.

Parameters:

  • startDate (required): Start date in YYYY-MM-DD format
  • endDate (required): End date in YYYY-MM-DD format
  • summarizeColumnsByPeriod (optional): Boolean for quarterly/monthly breakdown

Usage Examples:

  • "Show me the P&L for Q1 2024"
  • "What's our annual P&L for 2024 with quarterly breakdown?"
  • "Generate a monthly P&L report for March 2025"

πŸ› οΈ Installation & Setup

Prerequisites

  • Node.js 16+ installed
  • QuickBooks Developer account
  • QuickBooks company (sandbox or production)

1. Clone and Install

git clone <repository-url>
cd quickbooks-mcp
npm install

2. Environment Setup

cp .env.example .env
# Edit .env with your QuickBooks API credentials

3. QuickBooks App Configuration

  1. Create QuickBooks App:

  2. OAuth Setup:

    • Add redirect URI: https://developer.intuit.com/v2/OAuth2Playground/RedirectUrl
    • Use OAuth 2.0 Playground to obtain tokens
    • Add tokens to your .env file
  3. Environment Variables:

    QB_CLIENT_ID=your_client_id_here
    QB_CLIENT_SECRET=your_client_secret_here
    QB_ACCESS_TOKEN=your_access_token_here
    QB_REFRESH_TOKEN=your_refresh_token_here
    QB_REALM_ID=your_company_realm_id_here
    QB_ENVIRONMENT=sandbox  # or production
    QB_BASE_URL=https://sandbox-quickbooks.api.intuit.com
    

4. Build and Test

npm run build
npm start

πŸ–₯️ Claude Desktop Integration

Local Configuration Setup

  1. Copy example configuration:

    cp claude-desktop-config.example.json claude-desktop-config.json
    
  2. Update with your credentials: Edit claude-desktop-config.json and replace placeholder values with your actual QuickBooks API credentials.

  3. Add to Claude Desktop: Copy the quickbooks server configuration from your local claude-desktop-config.json into your Claude Desktop configuration file.

⚠️ Security Note: Never commit claude-desktop-config.json - it contains sensitive API credentials and is excluded by .gitignore.

πŸ’¬ Usage Examples

Once connected to Claude Desktop, you can ask natural language questions:

Company Information

  • "What's our company information?"
  • "Show me our business details"
  • "What QuickBooks plan are we on?"

Financial Reports

  • "Show me the P&L for Q1 2024"
  • "What was our revenue in March 2025?"
  • "Generate an annual P&L for 2024 with quarterly breakdown"
  • "How did we perform financially this month?"
  • "What's our year-to-date profit and loss?"

Time Periods

  • "Show me this month's financial performance"
  • "Compare Q1 vs Q2 performance"
  • "What's our YTD revenue breakdown?"

πŸ”§ Development

Development Mode

npm run dev  # Auto-reload during development

Build for Production

npm run build
npm start

Testing

# Test individual functions
node test-simple.mjs
node test-pl.mjs
node test-comprehensive.mjs

πŸ“ Project Structure

quickbooks-mcp/
β”œβ”€β”€ src/
β”‚   └── index.ts              # Main MCP server implementation
β”œβ”€β”€ dist/                     # Compiled JavaScript output
β”œβ”€β”€ .env.example              # Environment variables template
β”œβ”€β”€ .gitignore               # Git ignore rules
β”œβ”€β”€ claude-desktop-config.example.json  # Claude Desktop config template
β”œβ”€β”€ package.json             # Dependencies and scripts
β”œβ”€β”€ tsconfig.json           # TypeScript configuration
β”œβ”€β”€ TOKEN-MANAGEMENT.md     # Token refresh documentation
└── test-*.mjs              # Test scripts

πŸ”’ Security Best Practices

API Key Management

  • βœ… Use environment variables for all credentials
  • βœ… Never commit API keys to version control
  • βœ… Use .env files locally only
  • βœ… Rotate tokens regularly as per QuickBooks guidelines
  • βœ… Use sandbox environment for testing

File Protection

  • .env - Protected by .gitignore
  • claude-desktop-config.json - Protected by .gitignore
  • Only example/template files are committed

Token Management

  • Access tokens expire every 180 days
  • Refresh tokens expire every 101 days
  • See TOKEN-MANAGEMENT.md for refresh procedures

🚨 Beta Limitations

  • Limited Testing: Tested primarily with sandbox data
  • Error Handling: May need refinement for edge cases
  • Token Refresh: Manual token refresh required currently
  • Function Set: Additional QuickBooks endpoints planned
  • Production Use: Thorough testing recommended before production deployment

πŸ—ΊοΈ Roadmap

Planned Features

  • Automatic token refresh
  • Invoice management functions
  • Customer and vendor queries
  • Expense tracking and analysis
  • Cash flow reports
  • Chart of accounts access
  • Multi-company support

Known Issues

  • Manual token refresh required every 180 days
  • Sandbox data may be limited for comprehensive testing

🀝 Contributing

This is beta software. Contributions welcome:

  1. Test with your QuickBooks data
  2. Report issues and edge cases
  3. Suggest additional financial queries
  4. Improve error handling
  5. Add new QuickBooks API endpoints

πŸ“„ License

MIT License - see LICENSE file for details

πŸ“ž Support

  • Review TOKEN-MANAGEMENT.md for token issues
  • Check QuickBooks API documentation for data structure questions
  • Test in sandbox environment first
  • Verify all credentials are properly configured

⚠️ Remember: This is beta software. Always test thoroughly with sandbox data before connecting to production QuickBooks companies.