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
Drivvo keeps a record of every fill-up, with the odometer, litres and cost, and of every service: what was done and when it's due again. Out of those come the numbers you care about: what the car uses per 100 km, what it costs to run and whether the oil change is coming up.
Those records are three tables: cars, fill-ups and services. Tell Grok the odometer and the litres while you're at the pump and it logs the fill-up. When you ask what's due, it compares your latest mileage with what each service said, and gives you the answer in kilometres and days.
Connect Grok to databasedmcp
databasedmcp is a remote MCP server that gives AI assistants private SQLite databases, with nothing to install.
Open grok.com/connectors, add a new connector, choose Custom and enter https://databasedmcp.com/mcp. When Grok opens the databasedmcp page, sign in and select Allow. Then turn the connector on in a chat.
Any other MCP client works the same way; the docs have the details.
Copy this prompt to build it
Paste this into Grok 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 a car maintenance and fuel log for me in databasedmcp, in one go. 1. Create a database called car, described as "Car log: fill-ups, services and what's due". 2. Create three tables: - cars: id, name (required, what I call it), make_model, year. - fillups: id, car_id (references cars), filled_on (date, defaults to today), odometer_km (required), litres (required), total_cost, station. I always fill the tank. - services: id, car_id (references cars), done_on (date, defaults to today), odometer_km, what (required, like "Oil and filter change"), cost, garage, next_due_km and next_due_on (when it's due again, either or both). 3. Write the database a guide that says what each table is for, that consumption comes from the distance between one full tank and the next, that the latest odometer reading across fillups and services is the car's current mileage, and the queries for "my consumption", "what's due" and "what I've spent this year". From then on: when I tell you about a fill-up, log it with the odometer, litres and cost. When I have the car serviced, log what was done and when it's next due. Show me the tables when you're finished.
Ask for the database
You don't write the schema. Describe what you want:
Set up a car log in databasedmcp: my car, every fill-up with the odometer, litres and cost, and services with when they're next due by kilometres or date. When I tell you about a fill-up or a service, log it.
Grok creates a database called car and its tables:
CREATE TABLE cars (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
make_model TEXT,
year INTEGER
);
CREATE TABLE fillups (
id INTEGER PRIMARY KEY,
car_id INTEGER NOT NULL REFERENCES cars(id),
filled_on TEXT NOT NULL DEFAULT (date('now')),
odometer_km INTEGER NOT NULL,
litres REAL NOT NULL,
total_cost REAL,
station TEXT
);
CREATE TABLE services (
id INTEGER PRIMARY KEY,
car_id INTEGER NOT NULL REFERENCES cars(id),
done_on TEXT NOT NULL DEFAULT (date('now')),
odometer_km INTEGER,
what TEXT NOT NULL,
cost REAL,
garage TEXT,
next_due_km INTEGER,
next_due_on 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. Grok files things the same way next week as today, and so does any other assistant you connect.
# car: fill-ups, services, what's due - **cars**: one row per car. - **fillups**: one per fill-up, always a full tank. Consumption for a fill-up is its litres over the distance since the one before. - **services**: what was done, at what mileage, and when it's due again (`next_due_km`, `next_due_on`, either or both). The car's current mileage is the highest `odometer_km` in fillups and services. Consumption: `WITH f AS (SELECT filled_on, odometer_km - lag(odometer_km) OVER (ORDER BY odometer_km) AS km, litres FROM fillups WHERE car_id = ?) SELECT filled_on, km, litres, round(litres * 100.0 / km, 1) AS l_per_100km FROM f WHERE km IS NOT NULL ORDER BY filled_on DESC` What's due: the latest service of each kind, with `next_due_km` minus the current mileage and the days until `next_due_on`. Spent this year: sum of `total_cost` in fillups plus `cost` in services since the start of the year.
Use it
From here on you talk, and Grok writes the rows. Each request below is one statement:
My car's a 2018 Volkswagen Golf. Call it the Golf.
INSERT INTO cars (name, make_model, year) VALUES (?, ?, ?) RETURNING id -- params: ["The Golf","Volkswagen Golf",2018]
Filled up at the Kestrel station on Ring Road. 84,210 km, 41.3 litres, 72.40.
INSERT INTO fillups (car_id, filled_on, odometer_km, litres, total_cost, station) VALUES (?, date('now', '-12 days'), ?, ?, ?, ?)
-- params: [1,84210,41.3,72.4,"Kestrel, Ring Road"]
Told 12 days late, so the date goes back 12 days.
Filled up again. 84,850 km, 38.9 litres, 68.10.
INSERT INTO fillups (car_id, odometer_km, litres, total_cost) VALUES (?, ?, ?, ?) -- params: [1,84850,38.9,68.1]
Oil and filter changed at Lindgren Motors at 84,900 km, 145. Next one at 99,900 km or in a year.
INSERT INTO services (car_id, odometer_km, what, cost, garage, next_due_km, next_due_on) VALUES (?, ?, ?, ?, ?, ?, date('now', '+1 year'))
-- params: [1,84900,"Oil and filter change",145,"Lindgren Motors",99900]
Ask it questions
Once there's data, each report you'd pay for is a single query:
What's the Golf using per 100 km?
WITH f AS (SELECT filled_on, odometer_km - lag(odometer_km) OVER (ORDER BY odometer_km) AS km, litres FROM fillups WHERE car_id = ?) SELECT filled_on, km, litres, round(litres * 100.0 / km, 1) AS l_per_100km FROM f WHERE km IS NOT NULL ORDER BY filled_on DESC -- params: [1]
With full tanks, the litres at one fill-up are what the car burned since the one before: 38.9 litres over 640 km is 6.1 l/100 km.
Is anything due soon?
WITH now_km AS (SELECT max(odometer_km) AS km FROM (SELECT odometer_km FROM fillups WHERE car_id = ? UNION ALL SELECT odometer_km FROM services WHERE car_id = ?)) SELECT s.what, s.next_due_km, s.next_due_km - now_km.km AS km_left, s.next_due_on, round(julianday(s.next_due_on) - julianday('now')) AS days_left FROM services s, now_km WHERE s.car_id = ? AND s.id IN (SELECT max(id) FROM services WHERE car_id = ? GROUP BY what) ORDER BY km_left
-- params: [1,1,1,1]
Only the latest service of each kind counts, and it's due by whichever comes first.
What has the car cost me this year?
SELECT 'fuel' AS what, round(sum(total_cost), 2) AS spent FROM fillups WHERE car_id = ? AND filled_on >= date('now', 'start of year') UNION ALL SELECT 'services', round(sum(cost), 2) FROM services WHERE car_id = ? AND done_on >= date('now', 'start of year')
-- params: [1,1]
You can also open the database on the website, page through its rows and run read-only SQL yourself.
What you give up
Nothing reminds you. Drivvo can notify you when a service is due; here, you find out by asking "is anything due soon?", so make it a habit at the pump. It has no phone app of its own either: you log a fill-up by telling Grok, which takes a sentence instead of a form.
The fuel maths assumes you fill the tank every time. A partial fill makes that one consumption figure wrong, and there are no charts, only the answers to what you ask. databasedmcp keeps rows of text and numbers, not receipts or photos. If you top up by the litre or want graphs of your costs, the app does more.
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.