databasedmcp

← Articles

How to build a support ticket desk with Claude

Paste a customer's message into Claude for a draft reply, and have it log the ticket too. Every request is tracked from the inbox to solved.

7 min read

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 free

Why build it yourself

If one or two of you answer customers, Zendesk or Help Scout is a lot of machinery. What you need is a short list: who wrote, what they need, whether you've answered, and whether it's solved. Your inbox holds the messages. What gets lost is where each one stands.

You probably paste the hard ones into Claude to draft a reply. While it's there, it can log the ticket: the customer, the problem, what you sent back. A week later, ask what's still open and who's waited longest.

Connect Claude to databasedmcp

databasedmcp is a remote MCP server that gives AI assistants private SQLite databases, with nothing to install.

In Claude on the web, desktop or mobile, open Settings → Connectors, choose Add custom connector and enter https://databasedmcp.com/mcp. Select Connect, sign in to databasedmcp with your email or Google, and select Allow. Then turn databasedmcp on for a conversation from the tools menu.

Claude asks before it runs anything that changes or deletes data. Reading runs without asking.

Any other MCP client works the same way; the docs have the details.

Copy this prompt to build it

Paste this into Claude 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.

prompt
Set up a support desk for me in databasedmcp, in one go.

1. Create a database called support, described as "Support desk: customers, tickets and the replies on each, logged by Claude from messages I paste".
2. Create three tables:
   - customers: id, name (required), email, company, created_at (defaults to now).
   - tickets: id, customer_id (references customers, required), subject (required), topic (one or two words, reused across tickets, like billing, shipping or login), priority (1 urgent to 3 whenever, defaults to 2), status (open, waiting or solved, defaults to open), opened_at (defaults to now), solved_at (NULL until it's solved).
   - messages: id, ticket_id (references tickets, required), from_me (1 for my replies, 0 for theirs, defaults to 0), body (required), at (defaults to now).
3. Write the database a guide that says what each table is for: open means it's my turn, waiting means it's theirs. It should say to look customers up by email or name before adding them, to summarise long emails in two or three sentences, and that when a customer writes about something they already have an open ticket for, the message goes on that ticket and it goes back to open. Include the query for my queue: open tickets with the customer's name, most urgent first, then oldest first.

From then on: when I paste a customer's message, log it as a ticket (adding the customer if they're new) or add it to their open one. When I send a reply, log it as a message from me. When I say we're waiting on them, set the ticket to waiting; when it's solved, set solved and solved_at. 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 support desk in databasedmcp: customers, tickets with a status and priority, and a log of what was said on each ticket. When I paste a customer's message, log it as a ticket or add it to their open one, and record the reply we send.

Claude creates a database called support and its tables:

schema
CREATE TABLE customers (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  email TEXT,
  company TEXT,
  created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE tickets (
  id INTEGER PRIMARY KEY,
  customer_id INTEGER NOT NULL REFERENCES customers(id),
  subject TEXT NOT NULL,
  topic TEXT,
  priority INTEGER NOT NULL DEFAULT 2 CHECK (priority BETWEEN 1 AND 3),
  status TEXT NOT NULL DEFAULT 'open' CHECK (status IN ('open', 'waiting', 'solved')),
  opened_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
  solved_at TEXT
);

CREATE TABLE messages (
  id INTEGER PRIMARY KEY,
  ticket_id INTEGER NOT NULL REFERENCES tickets(id),
  from_me INTEGER NOT NULL DEFAULT 0 CHECK (from_me IN (0, 1)),
  body TEXT NOT NULL,
  at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
);

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. Claude files things the same way next week as today, and so does any other assistant you connect.

guide
# support: tickets from pasted messages

- **customers**: one per person who writes in. Look them up by email or name before adding.
- **tickets**: one per problem. status: open (my turn), waiting (their turn), solved. priority: 1 (urgent) to 3 (whenever). `topic` is one or two words, reused across tickets (billing, shipping, login). Set `solved_at` when it's solved.
- **messages**: what was said, in order. `from_me` is 1 for my replies, 0 for theirs. Summarise long emails in two or three sentences.

If a customer writes about something they already have an open ticket for, add a message to it and set it back to open.

My queue: `SELECT t.id, c.name, t.subject, t.priority, t.opened_at FROM tickets t JOIN customers c ON c.id = t.customer_id WHERE t.status = 'open' ORDER BY t.priority, t.opened_at`

Use it

From here on you talk, and Claude writes the rows. Each request below is one statement:

New customer: Anna Berg from Fernwood Bakery, anna@fernwood-bakery.example.
execute
INSERT INTO customers (name, email, company) VALUES (?, ?, ?) RETURNING id
-- params: ["Anna Berg","anna@fernwood-bakery.example","Fernwood Bakery"]
Anna says the checkout charged her customers shipping twice since yesterday. That's urgent, log it.
execute
INSERT INTO tickets (customer_id, subject, topic, priority) VALUES (?, ?, ?, ?) RETURNING id
-- params: [1,"Checkout charges shipping twice","billing",1]
Draft a reply saying we've found it and refunds go out today. I sent it, log it.
execute
INSERT INTO messages (ticket_id, from_me, body) VALUES (?, ?, ?)
-- params: [1,1,"Found the cause: a discount rule added shipping a second time. Fixed now, and refunds for affected orders go out today."]
Mark it as waiting on her to confirm.
execute
UPDATE tickets SET status = 'waiting' WHERE id = ?
-- params: [1]
Anna confirmed the refunds arrived. Close it.
execute
UPDATE tickets SET status = 'solved', solved_at = datetime('now') WHERE id = ? AND status != 'solved'
-- params: [1]

Ask it questions

Once there's data, each report you'd pay for is a single query:

What's on my plate, most urgent first?
query
SELECT t.id, c.name, t.subject, t.priority, t.opened_at FROM tickets t JOIN customers c ON c.id = t.customer_id WHERE t.status = 'open' ORDER BY t.priority, t.opened_at
What do people write in about most, and how long does each take to solve?
query
SELECT topic, count(*) AS tickets, round(avg(julianday(solved_at) - julianday(opened_at)), 1) AS days_to_solve FROM tickets WHERE status = 'solved' GROUP BY topic ORDER BY tickets DESC
Which tickets have been waiting on the customer for more than 5 days?
query
SELECT t.id, c.name, t.subject, max(m.at) AS last_message FROM tickets t JOIN customers c ON c.id = t.customer_id JOIN messages m ON m.ticket_id = t.id WHERE t.status = 'waiting' GROUP BY t.id HAVING last_message < datetime('now', '-5 days') ORDER BY last_message

You can also open the database on the website, page through its rows and run read-only SQL yourself.

What you give up

This doesn't touch email. Zendesk and Help Scout give you a shared inbox: messages arrive as tickets, replies go out from it, and the thread stays in one place. Here, a ticket exists because you pasted or described it. You still send the reply from your own mail. That works for a handful of tickets a day. For a queue that never empties, it's the wrong tool.

You get no help centre, customer portal, satisfaction surveys or notifications. A colleague on your account can browse the tickets on the website, but nothing tells them a new one came in. If customers need to see their ticket status, or a team splits the queue, pay for a help desk.

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.

Create an account

More articles · databasedmcp · Docs