Blog

All Blog Posts  |  Next Post  |  Previous Post



Building an AI Mail Desk for a Car Dealership with Delphi

Tuesday, October 27, 2026

A multi-brand car dealership receives hundreds of mails a week in a shared mailbox: test drive requests, breakdowns on the highway, leasing questions, invoices, trade-ins and the occasional prize scam. Someone has to read every mail, decide who should handle it and answer the customer, often in Dutch, French or German.

AI Mail Desk is a Delphi showcase that hands that first pass to an AI. It fetches mail from Gmail and Outlook, lets an LLM classify every message and write a reply in the customer's language, routes it to the right person and saves the reply as a draft for a human to check. The dealership in the demo, Brightline Motors, is fictional; the components are not.

Customer mails in three languages flow through an AI step into the AI Mail Desk dashboard.

Incoming mail is classified, routed and answered before anyone opens it.

4
languages in the demo inbox: English, Dutch, French and German
15
demo mails, so you can try it without a mailbox
3
TMS product families in one application
0
replies sent to a customer without a person


What the Demo Does

Fetches mail
From Gmail and Outlook, including photos and PDF attachments.
Classifies every mail
With the AI service of your choice: department, car brand, priority, a one-line summary and a spam verdict.
Routes it
Through a routing table, so Audi sales and Volkswagen sales go to different people. Returning customers are remembered.
Writes the reply
In the customer's language, saved as a threaded draft. Nothing is sent without a person.
Acts on it
Forwards to the handler and files the original, books workshop slots, alerts the on-call mechanic and translates.
Runs as an MCP server
Claude, n8n or any other LLM client can work the inbox, while a FireMonkey dashboard shows what happens.


One Server, Many Clients

The heart of the system is GarageMailMCP.exe, a console application built with TMS AI Studio. It owns the inbox, the routing table, the settings, the work queues and the customer history, and every part of it is available as an MCP tool. The FireMonkey dashboard is one client of that server; an LLM is another. What Claude changes in the routing table shows up in the dashboard within a second, and the other way round.

MCP clients on the left connect over HTTP to the triage server, which talks to Gmail, Outlook, an AI service, calendars and Pushover.

The triage server owns the state; the dashboard and any LLM work through the same MCP tools.

That split is more than an architecture diagram. Because every action is a tool, the same server can be operated by a person clicking buttons, by an assistant inside the dashboard, or by an automation that triages new mail every few minutes and only leaves the decisions to people.


Three Product Families, One Application

Each part of the demo leans on a different TMS product:

AITMS AI Studio
Triage and translations through TTMSMCPCloudAI (OpenAI, Claude, Gemini, Mistral, Ollama and more), the attribute-based MCP server, and TTMSMCPClient for the in-app assistant.
FNCTMS FNC Cloud Pack
Gmail, Outlook, Google Calendar, Outlook Calendar and Pushover.
FNCTMS FNC UI Pack
The dashboard: TTMSFNCDataGrid with conditional formatting, TTMSFNCKanbanBoard, TTMSFNCPlanner and TTMSFNCChat.

The inbox of the dashboard with department badges, priorities, confidence bars and the detail panel of a selected mail.

The dashboard inbox: department badges, priority, AI confidence and the analysis of the selected mail.


Try It Without a Mailbox

You do not need a Google or Microsoft account to explore the demo. Start the server, start the dashboard and click Get mail: with no mailbox connected, thirteen realistic customer mails in English, Dutch, French and German arrive, plus two spam mails. Pick an AI service and API key on the Settings page, or choose the offline keyword rules to see the flow without an AI.

THE WHOLE TOOLBARGet mail→Triage with AI→Forward
✓
Safe by default
Drafts and forwards are simulated until you connect a real mailbox on the Settings page, and forwarding stays in dry-run mode until you switch it off there.

"The LLM does the reading and sorting; your Delphi code does the connecting."


Download AI Mail Desk

The complete demo is on GitHub. Run the prebuilt binaries to try it in a few minutes, or clone the repository and build it yourself to follow along with the code in this series.

The release has two zips, one per edition:

  • AIMailDesk-Garage-Win32.zip: the Brightline Motors showcase that this series is about.
  • AIMailDesk-Configurable-Win32.zip: the configurable edition. It contains no car dealership: you pick a business template on its Setup page and define your own categories, routing and replies.
Option 1: Run the binaries
  1. Open the Releases page and download one of the zips.
  2. Unzip it to a folder of your own and keep its folder structure: the demo looks for its sample attachments there.
  3. Garage edition: start MCPServer\GarageMailMCP.exe first, then GarageMailDesk.exe. Configurable edition: start MailDesk.exe, which starts MailDeskServer.exe by itself.
  4. Click Get mail and then Triage with AI.
Option 2: Build from source

Clone the repository:

git clone https://github.com/tmssoftware/tms.demos.aimaildesk.git

You need Delphi (the projects are made with Delphi 13) with TMS AI Studio, TMS FNC Core, TMS FNC Cloud Pack and TMS FNC UI Pack installed. Trial versions are available on each product page.

Build the server MCPServer\GarageMailMCP.dproj and the dashboard GarageMailDesk.dproj for Win32, or MailDesk\Server\MailDeskServer.dproj and MailDesk\MailDesk.dproj for the configurable edit



Bradley Velghe


  1. Building an AI Mail Desk for a Car Dealership with Delphi

  2. Classify and Route Customer Mail with AI in Delphi

  3. AI That Reads Attachments, Remembers Customers and Catches Spam



This blog post has not received any comments yet.



Add a new comment

You will receive a confirmation mail with a link to validate your comment, please use a valid email address.
All fields are required.



All Blog Posts  |  Next Post  |  Previous Post