Autopilot for Delphi

There is a big chasm between Claude and your Delphi app

You already work hand in hand with an AI assistant: you give a prompt, the AI writes the code and compiles it. And then it stops dead.
It cannot test the program for you. If your program has an OK button, you have to click it. The AI can’t.

Everything past “compile” is on the far side of that chasm.
The AI needs you at the keyboard to push the buttons and report back.

 

Closing the gap, with… magic

But what if magic exists? What if the AI could push the buttons itself, without a single change to your forms or your business code?

Autopilot for Delphi hands the controls of your running VCL/FMX app to the AI. The AI clicks the buttons, types into the edit boxes, reads the labels, reads and changes any published property, and takes screenshots. No human at the keyboard.

And it all happens in the background: Autopilot never moves your mouse. You keep working while the AI tests your app.

 

Two robots on opposite cliffs joined by a glowing bridge: Autopilot for Delphi closes the gap

DON’T TREAT IT LIGHTLY!
It is way more powerful than it seems at the first look.

How it works

How Autopilot for Delphi works: the AI assistant talks MCP to Autopilot.Mcp.exe, which talks over a Windows named pipe to the Autopilot bridge inside your running Delphi app

 

How to install it

1. Download or clone the source code from GitHub to a folder (example: c:\Autopilot-for-Delphi-main\). In the prompt below, use the path of the folder that holds README.md.

2. Open your AI assistant (Claude/Gemini/etc) session and give it a prompt like this:

I have a new MCP server for you in c:\Autopilot-for-Delphi-main\. Build Source\McpServer\Autopilot.Mcp.dproj (Release, Win32), then register Source\McpServer\Win32_Release\Autopilot.Mcp.exe as the MCP server “autopilot”.
Add this line to your global CLAUDE.md:
“To test the GUI of my Delphi programs, use Autopilot. See: c:\Autopilot-for-Delphi-main\AI-INSTRUCTIONS.md.”

3. The agent will inform you to restart it, so it can use the new installed MCP server.

That’s it. The AI builds Autopilot.Mcp.exe from the source and registers it. Check this if you want to install it manually (but why would you?).

 

How to use it

Demo app

1. Open DemoVCL\Push buttons\Autopilot.PushBtnsDemo.dproj (FMX: DemoFmx\Autopilot.DemoFmx.dproj) and run it.
2. Ask your AI assistant: “List the controls of the Autopilot.Demo app, then click btnIncrement five times, read lblIncrement (in the FMX demo: lblCounter) and confirm it shows the correct answer.”

Your own app

Ask the AI to wire Autopilot into your project. It adds the bridge units and one StartBridge call to your .dpr, and the AUTOPILOT define to your Debug build.
Without that define StartBridge does nothing, so your Release build has no automation in it.

For real work

Hand it one big prompt and leave the computer running. Claude writes the code, builds it, drives the running app to check it. Come back in the morning to a GUI app that is built, fully tested, and working.

 

New features

Repeatable GUI tests, with no AI

Autopilot lets your DUnitX tests start the app, click, type and read the labels, then check the result with Assert.
No AI and no tokens: the tests run on every build. Sample: DemoVCL\Push buttons\UnitTesting\Autopilot.DemoTests.dproj. See:Automated GUI testing in Delphi.

Who said it is only for testing & debugging?

Pushing the real buttons means the AI can operate your program, not just inspect it.

Examples:

  • Email client. If your Delphi app is an email client, the AI can answer customers, search contacts, build templates, harvest addresses – driving your own application, the way the end user would.
  • Bulk data entry. Give the AI a list of 300 customers. It fills each one into your own input form and presses Save. The records go through your Save code, not around it.
  • Batch work in a program that has no command line. That old tool of yours that only has a GUI: the AI enters the file name, presses Process, waits for “Done” and moves on to the next file. All night, if needed.
  • Reproduce a bug report. A customer writes “it goes wrong when I open a project and then click Export”. You paste the customer’s email into the prompt and ask the AI to reproduce the bug. The AI clicks the button and tells you whether the bug shows up, and at which step.
  • Proofread your whole GUI. The AI walks every form and reads every caption and hint. It finds the typos, the buttons with no hint, and the labels nobody translated.
  • Write the user manual. The AI opens each form, takes its own screenshot, reads the captions and hints, and writes the help text for it.

This is full automation, not just testing. And it does all this in the background without moving the mouse!

Your app shows a web page? The AI can get work done there too

Does your app hold a web page inside a TEdgeBrowser? Then the AI can work with that page too, with a little help from your own code.

Your app can already reach its page. TEdgeBrowser.ExecuteScript runs JavaScript inside the page, and DefaultInterface.CallDevToolsProtocolMethod sends real key presses and mouse clicks into it. So your code can fill in a field, press a button on the page and read the answer. Put that code behind a normal button of your app, and the AI does the rest:

  1. The AI types the input into your edit box and clicks your button.
  2. Your code works the web page, then writes the result into a status label.
  3. The AI waits for that label with wait_for and reads the result.

I tested this on a live website: Claude drove my program through Autopilot, and the program’s own code filled in the web page.

Good to know: Autopilot does not click inside the page by itself. The buttons on a web page are HTML, not Delphi controls.

Blind users can talk to your Delphi app

Autopilot gives the AI the names of all the controls, every caption and every label. It can click any button, including TSpeedButton and custom-painted buttons, and type text. New in 3.8, the AI can also ask “which control is at this point of the form?” and get back that one control: its name, class and text. A control on a hidden tab page is never the answer, and a TLabel or a disabled button is found too. VCL and FMX.

Put together, a blind user can ask the AI things like:

  • “What is on this window?”
  • “Which buttons can I press here?”
  • “Fill in the name and press Save.”

Good to know: the AI answers when the user asks. It is a way to talk to the program, not a full screen reader: when the focus moves or a dialog opens, the user asks again (“what changed?”).

The AI drives the Delphi IDE itself

A design-time package (Source\IdeBridge\Autopilot.IdeBridge.dpk) loads Autopilot into the Delphi 13 IDE. Now the AI can read and drive the IDE’s own windows, the same way it drives your app: 41 IDE forms and 3,503 components listed in 58 ms.

Your app can give the AI its own commands

Register a command in your app with RegisterAutopilotCommand, and the AI calls it with the new tool call_method. One call can replace a long chain of clicks and dialogs. Example and details: Your own commands.

All the changes: What’s New.

 

Real-life demo

In a session I told Claude that the “Next page” button in my FMX app (Orinoco eReader) was broken — it wasn’t, but it’s a good test.

Claude Code receiving the prompt to run the Delphi app and test the Next-page button
1. The prompt. “Run the app, press the button, see if the page changes, report back.”
The running Delphi FMX application with an arrow pointing at the Next-page button Claude is about to press
2. Claude drives the running Delphi app and presses the real button (it figures out on its own that the control is named btnNext).
Claude before-and-after report showing PageIndex changed from 1 to 2 and the rendered page changed, proving the button works
3. The verdict: Claude prints this table showing what happens before and after pressing the button. Its (correct) conclusion: the program works.
Video

Thanks Tomas F for posting this nice video.

 

What makes Autopilot different

Other tools can click a Delphi program too. Most of them stop somewhere along the way. Autopilot goes all the way:

  • VCL and FMX, in one tool. Most tools that work inside a Delphi app handle only VCL.
  • Android too. Your FMX app runs on the phone, and the AI still finds every control by its name. Most tools stop at Windows; the few that reach a phone tap at screen coordinates.
  • Every control, by its Delphi name. frmMain.btnSave – also the controls that have no window handle, like TLabel and TSpeedButton. A click runs the control’s own Click method. Many tools click at screen coordinates, or go through Windows UI Automation, which cannot see a TLabel in a VCL app as it ships.
  • Any published property. The AI reads and changes Enabled, ItemIndex, Hint, even Font.Size – not only the text. Most other tools can change only the text, a check box or a selection, or nothing at all.
  • A real MCP server, built in. The AI calls the tools directly. No shell commands, no Python script, no PowerShell harness in between, as several other tools need.
  • No network port. On Windows, the AI reaches your app through a named pipe that only your own Windows user can open. Several other tools open a TCP or HTTP port inside your app.
  • GUI tests with no AI at all. A DUnitX test drives your app through the unit Autopilot.Client: no AI, no tokens, and your build server can run it. Most other tools need an AI or a script for every single run.
  • Delphi 10.3 Rio to 13 Florence. Most other tools that live inside the app were made for, or tested only on, Delphi 12 or 13.
  • Results as text, not as pictures. The AI reads a label’s text in one quick call. Tools that work from screenshots pay for an image, in tokens and in time, on every check.

We looked hard: none of the other tools has all these features under one umbrella.

 

Download

The source code, the MCP server and two demo apps (VCL and FMX).
Manual installation

Prefer to do it by hand? Build Source\McpServer\Autopilot.Mcp.dproj in Delphi (Release, Win32), then register it in Claude Code with one command:

claude mcp add autopilot -- C:\Your\Path\Source\McpServer\Win32_Release\Autopilot.Mcp.exe.

Delphi Community Edition

Delphi Community Edition cannot compile from the command line. The AI asks you to build it once in Delphi, as explained above.

Supported platforms

Officially supported Delphi versions: 10.3 Rio, 11 Alexandria, 12 Athens and 13 Florence. Users report that it works on Delphi 10.2 too.

Platforms: Win32, Win64 (VCL and FMX), Android (FMX). Mac to be added soon.

No third-party dependencies (but it supports madShi).

Autopilot speaks MCP, so it can be used with Claude Code, Kai, Claude Desktop, Cursor, Cline.

Stay informed

Autopilot is getting traction – fast!

You can support the project with one single click

This is a complex program. I started its development in April 2026 and I put a lot of effort and testing in it. Now it is a mature program.

  • Give it a star to encourage further development.
  • Mention it to your friends

 

Even the AI knows which button to click: give Autopilot for Delphi a star on GitHub

The book behind Autopilot

Cover of the book AI-Assisted Development for Delphi (Delphi in All Its Glory, Book 5)

 

Autopilot lets the AI test your application.

My book AI-Assisted Development for Delphi (the 5th book in the Delphi in All Its Glory series) shows how to make the AI write better Delphi code in the first place: CLAUDE.md files, skills, sub-agents, MCP servers, cost control. Autopilot has its own chapter in it.

See the book

Related topics

Leave a Reply

Scroll to Top