Cursor connects to Xero through DeepLedger's hosted MCP server: one entry in mcp.json gives Cursor's agent Xero tools for every organisation you can access, and you switch between them by asking in Agent chat. This guide is for finance people who already use Cursor, and for the developers who build reporting and close tooling for an accounting firm or a multi-entity finance team.
Xero support in DeepLedger is in beta. If Connect to Xero is not offered on a company's Connections tab, contact support.
The QuickBooks Online version of this setup is in Connect Cursor to QuickBooks Online. The entry below is the same, so one entry serves clients on both ledgers.
What you are connecting
| OAuth sign-in | DeepLedger API key | |
|---|---|---|
| Best for | Cursor on your own computer | Setups where a browser sign-in is not possible |
What goes in mcp.json | The URL only | The URL and an Authorization header |
| Acts as | You | The person who created the key |
| Reaches | Every company you can access | All your companies, or one company |
| Revoke in DeepLedger | Settings → Connected apps | Settings → API keys |
Both routes reach the same address, https://mcp.deepledger.ai/mcp. DeepLedger holds each Xero connection, made once by an admin through Xero's sign-in, so Cursor never handles Xero tokens and you never refresh them. The Xero MCP server guide compares hosted, self-hosted and connector-platform options.
Why one sign-in for all your Xero organisations
With a local or self-hosted MCP server, you register and look after a Xero app, its tokens and the install yourself, and every person on the team repeats that setup.
With DeepLedger, the mcp.json entry is tied to you, not to an organisation:
- Every company you can access sits behind one entry, Xero and QuickBooks Online alike.
- Switching is a sentence in Agent chat, so a session can work through clients in turn.
- Your team's access applies. Each person signs in as themselves and sees only the companies they are assigned to.
- Pinned keys for scripts. An API key created for One company cannot switch, which suits jobs that must stay in one organisation.
Before you start
- A DeepLedger account with each Xero organisation connected: Companies → the company → Connections → Connect to Xero.
- Cursor desktop. On Enterprise, admins can restrict which MCP servers and tools are allowed.
- A test organisation, such as Xero's demo company, for the first run.
- Pricing: $20 per Xero connection per month, the same as QuickBooks Online, with unlimited users and a 14-day free trial with no credit card. See pricing.
How do I connect Cursor to Xero?
- Add DeepLedger to
mcp.json. Use~/.cursor/mcp.jsonfor all projects or.cursor/mcp.jsonfor one project, keeping any servers already there:
{
"mcpServers": {
"deepledger": {
"url": "https://mcp.deepledger.ai/mcp"
}
}
}
- Enable the server and sign in. Open the Customize page in Cursor's sidebar, turn on DeepLedger and sign in with your DeepLedger account. DeepLedger supports OAuth discovery and dynamic client registration, so there is no client ID to paste.
- Check the tools loaded. DeepLedger's tools should appear under Available Tools, including
companiesand thexero*tools. - Ask which company you are in. In Agent chat:
Using DeepLedger, which company am I in? List my companies with their ledgers.
Setup steps follow Cursor's MCP documentation.
Using an API key instead
Create a key in DeepLedger under Settings → API keys → Create key, choose All my companies or One company, and set it as DEEPLEDGER_API_KEY in the environment Cursor starts from. Then use:
{
"mcpServers": {
"deepledger": {
"url": "https://mcp.deepledger.ai/mcp",
"headers": {
"Authorization": "Bearer ${env:DEEPLEDGER_API_KEY}"
}
}
}
}
The key acts as the person who created it, with that person's access. It has no read-only switch of its own. Never paste the key itself into a project file that may be committed.
Switch companies by asking
The companies tool has three operations you will use: current, list and switch (by name or company id). In Agent chat:
List my companies.
Switch to Kestrel Freight Ltd and show unpaid bills over 30 days.
Now do the same for Kestrel Freight NZ Ltd.
The switch moves your one active company, which every AI app you use shares. If you run Cursor and Claude side by side, a switch in one moves the other. For long sessions, ask the agent to state the company before each step, and read the company name in each tool result.
Multi-organisation prompts to try
Cursor's agent can also write files in your workspace, which makes it useful for building working papers across clients. Keep those files out of version control.
A month-end pack per organisation
For each Xero company I can access, run the October profit and loss and balance sheet on an accrual basis and write a short markdown summary for each company to the reports/2026-10 folder, one file per company. Do not change anything in Xero.
Aged payables to CSV
Switch to each Xero company in turn and export aged payables as of today to one CSV with a company column. Tell me which companies returned nothing.
Intercompany reconciliation
Read the intercompany account in Kestrel Freight Ltd and in Kestrel Freight NZ Ltd for October. Write a table of matched and unmatched transactions to intercompany-october.md.
Variance review
Compare this quarter's profit and loss with last quarter's for each Xero company. List lines that moved more than 15% and the transactions behind the three largest.
Tracking categories
In Kestrel Freight Ltd, show October revenue by tracking category and flag any invoices with no tracking category set.
Draft journals for review
Switch to Kestrel Freight Ltd. Using the accruals schedule in accruals.csv, draft the October accrual journals as drafts and list them. Do not approve them.
Is it safe to let Cursor write to Xero?
- Drafts by default for new invoices, bills, credit notes and manual journals; payments, spend money, receive money and transfers post straight away.
- Confirmation is required for Xero actions that cannot be undone, such as voids and emailing a document.
- Cursor's own approvals. Cursor's run mode and your admin's policy decide which tool calls ask you first. Review tool arguments, especially the company, before you approve.
- DeepLedger access controls. Read-only members cannot write; owners and admins can make chosen areas read-only for one member; Audit history records each tool call per company.
- Local files are your responsibility. Reports the agent writes to disk are client data.
- Revoke in Cursor by removing the entry, or in DeepLedger under Settings → Connected apps or Settings → API keys.
Troubleshooting
The server shows but has no tools. Check the URL ends in /mcp, toggle the server off and on, and sign in again.
Authentication error with an API key. Make sure DEEPLEDGER_API_KEY is set in the environment Cursor was started from, starts with dl_live_, and has not been revoked.
"Switch not allowed." The key was created for One company. Use an All my companies key or sign in with OAuth.
"Reconnect Xero." That organisation's Xero authorisation has lapsed; an admin reconnects it on the company's Connections tab.
Rate limited. Xero limits calls per organisation per minute. Ask for date ranges rather than everything.
Frequently asked questions
How do I connect Cursor to Xero?
Connect your Xero organisations to DeepLedger, then add a deepledger entry with the URL https://mcp.deepledger.ai/mcp to ~/.cursor/mcp.json. Enable it on Cursor's Customize page, sign in with your DeepLedger account, and ask the agent which company is active.
Can Cursor work in several Xero organisations from one mcp.json entry?
Yes. The one entry reaches every company your DeepLedger user can access, on Xero or QuickBooks Online. Ask the agent to list your companies and switch to one by name. For scripts that must stay in one organisation, use an API key created for One company.
Do I need an API key to use Xero in Cursor?
No. Cursor supports DeepLedger's browser sign-in, so the mcp.json entry needs only the URL. Use a DeepLedger API key only where browser sign-in is not possible, and read it from an environment variable rather than writing it into the file.
Is it safe to keep client Xero data in a Cursor project?
Only if your firm's policy allows it. Anything the agent writes to the workspace, such as a CSV of aged receivables, is client data on your computer and in any repository you push. Keep those files out of version control and delete them when the work is done.
Can Cursor change my Xero books?
Yes, if your DeepLedger access allows writes. New invoices, bills, credit notes and manual journals are created as drafts by default, while payments, spend money, receive money, transfers and edits to approved documents change the books. Read-only DeepLedger members cannot write.
Related guides
- Xero MCP server guide
- Connect Cursor to QuickBooks Online
- One sign-in, every company
- Connect Claude to Xero
- Connect Cursor to Bill.com
See every supported app on AI platforms and integrations and pricing per connection.