DeepLedger
Menu

For developers

Connect CrewAI to QuickBooks Online: Python MCP Setup (2026)

Connect CrewAI to QuickBooks Online with CrewAI's current MCP API, DeepLedger's hosted endpoint, a revocable API key and a read-only first report.

Published by DeepLedgerUpdated 9 min read

Connect QuickBooks to CrewAI by giving a CrewAI agent an MCPServerHTTP entry in its mcps field, pointed at DeepLedger's hosted MCP server with a DeepLedger API key. DeepLedger holds the QuickBooks Online connection, so the crew needs no Intuit app. The code below is complete: it exposes only the company and report tools, checks the company and runs one Profit and Loss report without writing to QuickBooks.

This guide is for Python developers and finance teams building a CrewAI crew for bookkeeping or reporting.

How do I connect QuickBooks to CrewAI?

  1. Connect the QuickBooks company. In DeepLedger, open Companies, select the company, open its Connections tab and choose Connect to QuickBooks. Complete Intuit's sign-in.
  2. Install CrewAI's MCP dependency. Inside your CrewAI project, run uv add mcp.
  3. Create a DeepLedger API key. In DeepLedger, open Settings → API keys and choose Create key. Pick an Expiration and All my companies or One company, then copy the key; it is shown once.
  4. Export the key as an environment variable. Export the key as DEEPLEDGER_API_KEY in the shell or secret store that runs the crew.
uv add mcp
export DEEPLEDGER_API_KEY="dl_live_..."
  1. Configure your model-provider credential as CrewAI's LLM documentation describes, then save this file:
# quickbooks_crew.py
import os

from crewai import Agent, Crew, Task
from crewai.mcp import MCPServerHTTP
from crewai.mcp.filters import create_static_tool_filter

deepledger = MCPServerHTTP(
    url="https://mcp.deepledger.ai/mcp",
    headers={
        "Authorization": f"Bearer {os.environ['DEEPLEDGER_API_KEY']}"
    },
    streamable=True,
    tool_filter=create_static_tool_filter(
        allowed_tool_names=["qbCompanyProfile", "qbReports"]
    ),
)

analyst = Agent(
    role="QuickBooks report analyst",
    goal="Return a dated report from the correct company without changing the books.",
    backstory=(
        "You verify the company, currency, report dates, and accounting basis "
        "before explaining any totals. You do not infer missing rows."
    ),
    mcps=[deepledger],
    verbose=True,
)

check_report = Task(
    description=(
        "First call qbCompanyProfile with operation current. Then run a "
        "ProfitAndLoss report for 2026-09-01 through 2026-09-30 on the "
        "accrual basis. State the company, home currency, exact dates, basis, "
        "and whether the report says more rows remain. Do not call a write tool."
    ),
    expected_output=(
        "A concise report check naming the company, currency, dates, basis, "
        "completeness status, income, expenses, and net income."
    ),
    agent=analyst,
)

result = Crew(agents=[analyst], tasks=[check_report]).kickoff()
print(result)
  1. Run the crew and compare the report. Run the crew with uv run python quickbooks_crew.py and compare its totals with the same report in QuickBooks Online.

Use the same start date, end date and accounting basis in QuickBooks, and compare the company name and totals. The configuration follows CrewAI's MCP documentation: MCPServerHTTP with url, headers, streamable and tool_filter, passed through the agent's mcps field.

What are you connecting?

Two separate authorizations sit behind the crew:

  1. QuickBooks Online to DeepLedger. An admin connects the company once through Intuit's sign-in. DeepLedger keeps that connection.
  2. CrewAI to DeepLedger. Your Python process sends a DeepLedger API key to the QuickBooks MCP server and gets accounting tools back.

The crew never needs your QuickBooks password or an Intuit token. You need:

  • Python 3.10 through 3.13. CrewAI's installation guide requires Python 3.10 or newer and below 3.14 (as of November 2026).
  • A CrewAI project with the mcp dependency.
  • A DeepLedger account with the QuickBooks Online company connected.
  • A model-provider credential configured as CrewAI's LLM documentation describes.

A DeepLedger API key acts as the person who created it, with that person's access. Any team member can create one. A One company key works only in that company and can't switch. There is no separate read-only switch on a key, so keep it in an environment variable or secret store, never in source code.

Which CrewAI MCP option should you use?

mcps field with MCPServerHTTPMCPServerAdapter
Status in CrewAI's docsRecommended for agent integrationsOlder, for manual lifecycle control
Packagemcpcrewai-tools[mcp]
Transport settingstreamable=True (the default)"transport": "streamable-http"
Tool filteringtool_filter with create_static_tool_filterFilter the returned tool list yourself
Used in this guideYesNo

Follow one API consistently. Mixing examples from both is the most common cause of import errors.

How does the crew pick the right QuickBooks company?

An All my companies key follows its creator's active company. That active company is shared across the person's connected AI apps, so another session can change it. For a single-company report, the profile call in the sample is the check. For several companies:

  1. Call qbCompanyProfile with operation: "list".
  2. Take the exact organizationId from the result.
  3. Call qbCompanyProfile with operation: "switch" and that ID.
  4. Read the company echoed by the switch result.
  5. Run the report and check the company named in the report result too.

Don't switch by a guessed name when two clients are similar. Two crews using keys from the same person share one active company. For parallel crews, give each a One company key, or add an X-Organization-Id header with the company's ID to headers; DeepLedger checks it against the person's access. See the multiple-company guide.

Which tools should the CrewAI agent see?

The filter in the example is deliberately small:

allowed_tool_names=["qbCompanyProfile", "qbReports"]

That is enough for a reporting crew. Add tools only when the task needs them: transaction research adds qbFetchTransactions and qbMasterData; a crew that follows a client's rules adds agentMemory (the AI Brain) and skills; a crew that hands uncertain items to a person adds tasks.

qbCompanyProfile reads the company with current, and also has switch, which changes your active company, and feedback, which sends a message to DeepLedger. None of these writes to QuickBooks.

The filter keeps the model's tool list focused. It does not narrow the key: anyone holding the key can call any tool the creator can. Revoke a key under Settings → API keys when a job or host is retired.

Before you add a write tool, know the company write guard. Every write must carry the company it is meant for (companyId). If companyId is missing or differs from the active company, DeepLedger refuses with COMPANY_REQUIRED or COMPANY_MISMATCH and nothing is written. DeepLedger also requires confirmation for voids and deletes, and supported recording paths check for duplicates and open documents. Read AI write access to QuickBooks, safely before exposing qbBill or qbJournalEntry to a crew.

Next step: verify one company and one report

Start with a demo company. When the crew prints its result:

  1. Check that the company name matches the books you meant to open.
  2. In QuickBooks Online → Reports → Profit and Loss, run the same company, September 1 through September 30, 2026, accrual basis.
  3. Compare income, expenses and net income. If the crew says more rows remain, the result is incomplete.

A plausible total is not proof. If figures differ, fix the dates or basis and rerun before relying on the crew. The P&L verification workflow lists what to compare.

Can I run the crew on a schedule?

Yes, from your own job runner. A scheduled crew is your code acting as the key's owner; DeepLedger does not start anything on its own and only answers the requests the crew sends.

Keep the DeepLedger and model-provider keys in the runner's secret store, use an expiring key where practical, use fixed report dates, keep the output, and alert when a run fails or names the wrong company.

Adding write-tool names does not make a scheduled crew safe for recording. CrewAI's filter is a client-side control, and a generated report is not human approval. A recording crew needs bounded operations, the right companyId on every write, a review step, and testing against an Intuit sandbox first.

Troubleshooting

ModuleNotFoundError: No module named 'mcp'

Run uv add mcp in the CrewAI project, then sync the environment.

ImportError: cannot import name 'MCPServerAdapter'

You are following an older adapter example without crewai-tools[mcp]. For the current approach, import MCPServerHTTP from crewai.mcp and pass it through mcps.

401 Unauthorized

Check that the header starts with Bearer , the key was copied in full, and it hasn't expired or been revoked under Settings → API keys. Don't print the key while debugging; log a short prefix only.

The report names the wrong company

Another app or job switched the shared active company. List, switch by exact ID, and rerun the profile check. Treat a mismatch as a stop.

A write fails with COMPANY_REQUIRED or COMPANY_MISMATCH

The call had no companyId, or it named a different company from the active one. Nothing was written. Confirm the company, then send the write again.

A required tool is missing

A static filter hides every tool not on allowed_tool_names. Add the exact tool name the task needs.

The connection times out or fails on Python 3.14

Check outbound HTTPS from the runtime to https://mcp.deepledger.ai/mcp. CrewAI requires Python below 3.14; use 3.10 through 3.13.

Reports fail after a successful switch

That company's QuickBooks connection needs an admin to reconnect it on its Connections tab in DeepLedger.

Frequently asked questions

How do I connect QuickBooks to CrewAI?

Give a CrewAI agent an MCPServerHTTP configuration in its mcps field. Point it at DeepLedger's hosted QuickBooks MCP server, https://mcp.deepledger.ai/mcp, and send a DeepLedger API key in the Authorization header as a bearer token. The example in this guide exposes only the company-profile and report tools for the first run.

Do I need an Intuit developer account to connect CrewAI to QuickBooks?

No. You connect the QuickBooks Online company to DeepLedger once through Intuit's sign-in, then CrewAI connects to DeepLedger's MCP endpoint with a DeepLedger API key. A direct QuickBooks API integration is different and does require your own Intuit app and OAuth code.

Who can create the DeepLedger API key for a crew?

Any team member can create one under Settings, API keys, Create key. The key acts as the person who created it, with that person's access, and can cover All my companies or One company. There is no separate read-only switch on a key.

Which CrewAI MCP transport should I use?

Use MCPServerHTTP for a remote Streamable HTTP endpoint such as DeepLedger. Its streamable option defaults to true. The older MCPServerAdapter API uses a transport string such as streamable-http, but CrewAI's current documentation recommends the mcps field for ordinary agent integrations.

Which QuickBooks company will the crew use?

An All my companies key follows its creator's active company, which is shared across that person's AI apps. Call qbCompanyProfile with operation list, then switch by organization ID, and confirm the company in each result. A One company key works only in that company, and every write must carry companyId or DeepLedger refuses it.

Can I run the CrewAI report on a schedule?

Yes, from your own job runner. The scheduled crew is your code acting as the key's owner; DeepLedger does not start anything on its own. Keep the DeepLedger and model-provider keys in the runner's secret store, use fixed report dates, and alert when a run fails or names the wrong company.

Sources

CrewAI configuration was checked against CrewAI's documentation on November 2, 2026. We did not run the crew against a live company for this revision.

Browse all AI platforms and integrations.

Ready to get started?

Connect QuickBooks and try your first task with an AI agent.

Create an Account

With your permission, Google Analytics measures visits to our public website and blog. Essential cookies work either way. Change your choice in Cookie settings. Privacy policy