Ollama is not an MCP client. It runs models locally and supports tool calling, so the missing piece is a client that sits between the two: it connects to DeepLedger's hosted MCP server, discovers the accounting tools, and hands them to your local model as tool definitions. This guide uses ollmcp, a terminal MCP client built for Ollama.
| Connection setting | Value |
|---|---|
| Server URL | https://mcp.deepledger.ai/mcp |
| Transport | Streamable HTTP |
| Authentication header | Authorization: Bearer <your DeepLedger API key> |
| Model runtime | Ollama on http://localhost:11434 |
If you would rather write your own loop against Ollama's OpenAI-compatible endpoint, the custom AI agent guide has the MCP connection in plain code.
What Actually Runs Where
Three separate pieces, and it is worth being exact about them before you troubleshoot anything:
- QuickBooks Online to DeepLedger. A person authorizes the company once through Intuit. DeepLedger holds that connection.
- Your MCP client to DeepLedger. Your machine sends a DeepLedger API key to the hosted MCP endpoint over HTTPS and gets accounting tools back.
- Your MCP client to Ollama. The model runs on your hardware and never sees an Intuit token.
That third step is the reason people want this setup: the ledger data in the prompt is not sent to a model vendor. It is not an offline setup. The tools read live QuickBooks data, so transactions and reports still travel from Intuit to DeepLedger to your computer. If a client is asking about data residency, describe it that way rather than as air-gapped bookkeeping.
Prerequisites
- Ollama installed and running, with a model that lists the tools capability
- Python 3.11 or newer for the MCP client
- A DeepLedger account with the QuickBooks Online company connected
- Owner or admin access in DeepLedger to create an API key
- Enough VRAM to run your chosen model at a raised context length
Use a demo company while you set this up. A local model is not a safer model, and a first run is not the time to discover what an unfamiliar accounting tool does.
Step 1: Connect the QuickBooks Company
Sign in to DeepLedger, open Settings > Company and QBO Connect, choose Connect QB for the company, and complete Intuit's authorization. You do not need an Intuit developer app for this setup.
Step 2: Create a DeepLedger API Key
In Settings > API Access, select Create API Key, name it for this machine, and set an expiration. The key starts with dl_live_ and is shown once. Copy it before closing the dialog.
A personal key carries the access of the person who created it. It is not read-only and it is not pinned to the company you were looking at. Revoke it in the same screen when the machine is retired.
Step 3: Install the MCP Client
With uv:
uv tool install --upgrade ollmcp
Or with pip, inside a virtual environment:
pip install --upgrade ollmcp
On recent Debian and Ubuntu the system pip is locked by PEP 668 and refuses to install into the OS Python, which surfaces as error: externally-managed-environment. That is a system policy, not an ollmcp problem. Use uv, or a virtual environment.
This guide was written against ollmcp 0.34.0, which needs Python 3.11 or newer. Check the project README if a flag has moved.
Step 4: Register DeepLedger as a Remote Server
ollmcp mcp add --scope user --transport http deepledger https://mcp.deepledger.ai/mcp \
--header "Authorization: Bearer dl_live_your_key_here"
--scope user matters. Without it the command defaults to local scope, which writes to ~/.config/ollmcp/mcp.local.json keyed by the directory you ran it from, so the server exists only when you launch ollmcp from that same directory. User scope writes to ~/.config/ollmcp/mcp.json and loads anywhere.
Either way the header is stored in plain text, so restrict the file:
chmod 600 ~/.config/ollmcp/mcp.json
If you prefer to keep the configuration with a project, write the same server to a JSON file and pass it at launch instead of registering it:
{
"mcpServers": {
"deepledger": {
"type": "streamable_http",
"url": "https://mcp.deepledger.ai/mcp",
"headers": {
"Authorization": "Bearer dl_live_your_key_here"
}
}
}
}
ollmcp --servers-json ./deepledger-mcp.json --model qwen3
Keep that file out of source control. It holds a live credential, not a setting. Use one method or the other: a registered server and a --servers-json server sharing the name deepledger both open, and only one stays active under that name.
Step 5: Give the Model Room for the Tools
This is where most local setups fail, and the symptom is misleading: the model answers in prose and never calls a tool.
Ollama chooses a default context length from available VRAM, and below 24 GiB that default is about 4k tokens. DeepLedger publishes 27 tools, 20 for QuickBooks and 7 for workflow, and their schemas are detailed on purpose. The full set plus a real question does not fit in a 4k window.
Two fixes, and you want both:
OLLAMA_CONTEXT_LENGTH=64000 ollama serve
Ollama's own guidance puts agent workloads at 64k or more, and a tool-calling loop over an accounting server is exactly that.
Then confirm what the model actually got:
ollama ps
The CONTEXT column shows the allocated window, and PROCESSOR shows whether the model is on the GPU. A larger window costs VRAM and latency, so raise it deliberately rather than to the maximum.
The second fix is to stop sending tools the task does not need. Inside ollmcp, /tools opens the selection interface. For a first session, enable qbCompanyProfile and qbReports and disable everything else. This is also the cheapest accuracy improvement you will make: a small tool list is an easier choice for a small model.
Step 6: Run a Read-Only First Session
ollmcp --model qwen3
Before asking anything about the books:
/toolsand cut the list down to company profile and reports.- Leave human-in-the-loop approval alone. It is on by default, so every tool call waits for your
ybefore it runs, and/hilis a toggle that turns it off. /helplists the rest, including/modelto switch models and/reload-serversafter a configuration change.
Then work through a read-only sequence:
1. Confirm the company. "Read the company profile and tell me the company name. Do not change anything." Check it against the books you meant to open. Every DeepLedger result names the company it came from.
2. Pull a bounded report. "Show the profit and loss for August 1 through August 31, 2026, on an accrual basis." Fixed dates and an explicit basis make the answer checkable against QuickBooks.
3. Check it. Open the same report in QuickBooks and compare the totals. You are testing the model's handling of the tool result as much as the connection.
4. Try one step of real work. "List uncategorized transactions for that period and explain what needs review. Do not record anything."
What a Local Model Is Good At Here
Expect the connection to work and the judgment to vary by model size. In practice:
- Reads and lookups go well. Reports, transaction fetches, and master-data lookups are single tool calls with clear arguments.
- Multi-step work degrades first. A close checklist or a categorization pass with duplicate checks means holding a plan across many calls. Smaller models drop steps, repeat calls, or summarize a result they never received.
- Malformed tool calls are the common failure. If a model repeatedly sends the wrong argument shape, that is a model capability problem. Move up a size before you rewrite your prompt a fifth time.
- A confident summary is not a verified number. Ask for the report and check the figure, especially when the model is paraphrasing rather than quoting.
Keep write tools out of the selected set until the read loop is boring. When you do enable them, keep human-in-the-loop on, and route anything uncertain into a DeepLedger review task instead of letting the model decide alone. Uncertain categorization belongs with a person, whichever model is running.
Working With More Than One Company
A personal key reaches every company its creator can access. Ask the agent to call qbCompanyProfile with operation: "list", then operation: "switch" with the returned organizationId. The active company is stored per person and is shared across that person's AI clients, so a switch on your laptop follows you into your other connections. Check the company named in each result before acting on it. The multi-company guide covers the details.
Troubleshooting
401 Unauthorized. The key is incomplete, expired, or revoked, or the header lost its Bearer prefix. A quoting mistake in the shell is the usual cause when the key was pasted into a command.
The model answers without calling tools. Context, almost always. Raise OLLAMA_CONTEXT_LENGTH, confirm with ollama ps, and cut the tool list with /tools. If it persists, check that your model is published with the tools capability; a model without it will never emit a tool call.
The tool list is empty. The server was registered but is not loading. Run /reload-servers, then check the URL and header in ~/.config/ollmcp/mcp.json. If you registered without --scope user, the entry is in mcp.local.json under the directory you were in at the time, and it will not load from anywhere else.
No active company. List the companies, switch explicitly, and read the profile again to confirm.
Reports fail after a successful switch. The company's QuickBooks authorization needs attention in the portal. Reconnecting the MCP client will not repair an Intuit connection.
The first call is very slow. Ollama loads the model on first use, and a larger context takes longer to allocate. Check ollama ps before assuming the MCP connection is at fault.
A write partially completed. Read the result and check QuickBooks before retrying. A timeout is not proof that nothing was recorded.
Frequently Asked Questions
Does Ollama support MCP natively?
No. Ollama runs models and supports tool calling, but it is not an MCP client. To reach an MCP server you run a client such as ollmcp (MCP Client for Ollama), which connects to your MCP servers, discovers their tools, and passes them to the Ollama model as tool definitions.
Does a local model mean my books never leave my machine?
It means your ledger data is never sent to a model vendor. The data still moves between QuickBooks Online, DeepLedger's hosted MCP server, and your computer, because the tools read live QuickBooks data over the internet. Local inference removes the model provider from the path, not the accounting API.
Which Ollama model should I use for bookkeeping tools?
Pick a model published with the tools capability, and prefer a mid-size one. Small models frequently emit malformed tool calls, drop required arguments, or lose track of a multi-step task. Whichever model you choose, verify its numbers against QuickBooks before acting on them.
Why does the connection fail or the model ignore the tools?
Usually context. Ollama picks a default context length from available VRAM, as little as 4k tokens, and DeepLedger publishes 27 tools with detailed schemas. Raise the context length with OLLAMA_CONTEXT_LENGTH and narrow the tool list to the few tools the task needs.
Is the DeepLedger API key read-only?
No. A personal key acts as the person who created it and reaches every company that person can access, including write tools. Selecting fewer tools in your client limits what that agent can choose; it does not reduce what the key can do.
New to the hosted server? Read the QuickBooks MCP server guide, or create a DeepLedger account and connect your first company.
