databasedmcp gives your AI assistant databases it keeps between conversations, so everything in this article works from the day you connect it. Free to start, no card.
Get started freeWhy build it yourself
If you freelance or run a small studio, you might pay for FreshBooks mostly to answer two questions: who owes me money, and how much came in this month. You write the invoice in your own template and send it from your own email.
Those answers live in three tables. Tell ChatGPT when you send an invoice and when a payment lands, and it keeps the ledger. At the end of the month you ask what's outstanding instead of digging through your inbox and bank statements.
Connect ChatGPT to databasedmcp
databasedmcp is a remote MCP server that gives AI assistants private SQLite databases, with nothing to install.
ChatGPT connects to remote MCP servers as custom connectors in developer mode. That's on paid plans, on the web. Turn on developer mode in ChatGPT's settings, then create a connector: give it a name, enter https://databasedmcp.com/mcp as the URL and choose OAuth. When ChatGPT opens a databasedmcp page, sign in and select Allow. In a new chat, turn the connector on from the tools menu.
ChatGPT moves these menus between releases. If yours look different, search its settings for developer mode and custom connectors.
Any other MCP client works the same way; the docs have the details.
Copy this prompt to build it
Paste this into ChatGPT to set up the database, its tables and its guide in one go. The rest of this article walks through what it makes and how you use it.
Set up an invoice and client tracker for me in databasedmcp, in one go. 1. Create a database called invoices, described as "Invoice and client tracker: invoices I've sent and payments I've received, recorded by ChatGPT from what I tell it." 2. Create three tables: - clients: id, name (required), contact, terms_days (how many days they get to pay, defaults to 30), notes. - invoices: id, client_id (references clients, required), number (the number on the invoice, required and unique), description, amount_cents (required, in cents), currency (defaults to EUR), issued_on (date, defaults to today), due_on (date, required), status (sent, paid or void, defaults to sent). - payments: id, invoice_id (references invoices, required), amount_cents (required, in cents), paid_on (date, defaults to today), method. 3. Write the database a guide that says what each table is for, to look clients up by name before adding them, that amounts are in cents, that an invoice can have several payments and is marked paid when the payments cover it, and the queries for "what's outstanding, by due date" and "how much was received each month". From then on: when I mention a new client, add them with their payment terms. When I say I sent an invoice, record it with a due date from the client's terms unless I give one. When I say I got paid, record the payment against the invoice, and mark the invoice paid once its payments cover the amount. Show me the tables when you're finished.
Ask for the database
You don't write the schema. Describe what you want:
Set up an invoice tracker in databasedmcp: my clients, every invoice I send them with its number, amount and due date, and the payments I receive against each one. When I tell you I sent an invoice or got paid, record it.
ChatGPT creates a database called invoices and its tables:
CREATE TABLE clients (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
contact TEXT,
terms_days INTEGER NOT NULL DEFAULT 30,
notes TEXT
);
CREATE TABLE invoices (
id INTEGER PRIMARY KEY,
client_id INTEGER NOT NULL REFERENCES clients(id),
number TEXT NOT NULL UNIQUE,
description TEXT,
amount_cents INTEGER NOT NULL,
currency TEXT NOT NULL DEFAULT 'EUR',
issued_on TEXT NOT NULL DEFAULT (date('now')),
due_on TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'sent' CHECK (status IN ('sent', 'paid', 'void'))
);
CREATE TABLE payments (
id INTEGER PRIMARY KEY,
invoice_id INTEGER NOT NULL REFERENCES invoices(id),
amount_cents INTEGER NOT NULL,
paid_on TEXT NOT NULL DEFAULT (date('now')),
method TEXT
);
It also writes the database a guide on how the tables are meant to be used. The guide comes back with the schema whenever an assistant looks the database up. ChatGPT files things the same way next week as today, and so does any other assistant you connect.
# invoices: clients, invoices, payments
- **clients**: one row per client. Look them up by name (LIKE) before adding. `terms_days` is how long they get to pay.
- **invoices**: one row per invoice I send. Amounts are in cents. status: sent, paid, void. `number` is the number on the invoice.
- **payments**: money received against an invoice, in cents. An invoice can have several. Mark it paid when the payments cover it.
Outstanding: `SELECT i.number, c.name, i.due_on, i.amount_cents - coalesce(sum(p.amount_cents), 0) AS owed_cents FROM invoices i JOIN clients c ON c.id = i.client_id LEFT JOIN payments p ON p.invoice_id = i.id WHERE i.status = 'sent' GROUP BY i.id ORDER BY i.due_on`
Received by month: `SELECT strftime('%Y-%m', paid_on) AS month, sum(amount_cents) / 100.0 AS received FROM payments GROUP BY month ORDER BY month DESC`
Use it
From here on you talk, and ChatGPT writes the rows. Each request below is one statement:
New client: Halvorsen Design, contact is Ingrid Halvorsen. They pay in 14 days.
INSERT INTO clients (name, contact, terms_days) VALUES (?, ?, ?) RETURNING id -- params: ["Halvorsen Design","Ingrid Halvorsen",14]
I sent Halvorsen invoice 2026-031 for the brand refresh, 2,400 euros.
INSERT INTO invoices (client_id, number, description, amount_cents, due_on) VALUES (?, ?, ?, ?, date('now', '+14 days'))
-- params: [1,"2026-031","Brand refresh, phase 1",240000]
Amounts are stored in cents, so sums never pick up rounding errors.
I forgot to log 2026-027 from last month: 900 euros for the website audit. It was due two weeks ago.
INSERT INTO invoices (client_id, number, description, amount_cents, issued_on, due_on) VALUES (?, ?, ?, ?, date('now', '-28 days'), date('now', '-14 days'))
-- params: [1,"2026-027","Website audit",90000]
Halvorsen paid 2026-031 in full by bank transfer today.
INSERT INTO payments (invoice_id, amount_cents, method) VALUES (?, ?, ?) -- params: [1,240000,"bank transfer"]
Mark it paid.
UPDATE invoices SET status = 'paid' WHERE id = ? AND amount_cents <= (SELECT coalesce(sum(amount_cents), 0) FROM payments WHERE invoice_id = ?) -- params: [1,1]
The update only goes through if the payments cover the invoice.
Ask it questions
Once there's data, each report you'd pay for is a single query:
Who owes me money, and who's late?
SELECT i.number, c.name, i.due_on, (i.amount_cents - coalesce(sum(p.amount_cents), 0)) / 100.0 AS owed, max(0, CAST(julianday('now') - julianday(i.due_on) AS INTEGER)) AS days_late FROM invoices i JOIN clients c ON c.id = i.client_id LEFT JOIN payments p ON p.invoice_id = i.id WHERE i.status = 'sent' GROUP BY i.id ORDER BY i.due_on
How much came in each month this year?
SELECT strftime('%Y-%m', paid_on) AS month, sum(amount_cents) / 100.0 AS received FROM payments WHERE paid_on >= date('now', 'start of year') GROUP BY month ORDER BY month
Which clients take longest to pay?
WITH settled AS (SELECT i.client_id, julianday(max(p.paid_on)) - julianday(i.issued_on) AS days FROM invoices i JOIN payments p ON p.invoice_id = i.id WHERE i.status = 'paid' GROUP BY i.id) SELECT c.name, count(*) AS invoices, round(avg(s.days), 1) AS avg_days_to_pay FROM settled s JOIN clients c ON c.id = s.client_id GROUP BY c.id ORDER BY avg_days_to_pay DESC
You can also open the database on the website, page through its rows and run read-only SQL yourself.
What you give up
It doesn't make or send invoices, and it doesn't take payments. FreshBooks designs the PDF, emails it, lets clients pay by card and chases late payers for you. ChatGPT can draft the reminder email, but you're the one who sends it.
There's no bank connection, no expense tracking and no tax reports for your accountant. The ledger knows about a payment because you told it. Proper bookkeeping still needs an accounting app. This answers the question that app is slow at: who owes you what, right now.
Try it
databasedmcp is free to start, with no card. Free has 100 tool calls a week, enough to set this up and try it for a week. Starter has 1,000 for everyday use.