mcp-delphi
Delphi and Lazarus/FPC MCP server: build/clean pascal projects via MCP tools.
claude mcp add --transport stdio flydev-fr-mcp-delphi node dist/server.js \ --env RSVARS_BAT="Full path to rsvars.bat (e.g., C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\rsvars.bat)" \ --env MSBUILD_PATH="Full path to msbuild.exe if not in PATH (e.g., C:\Program Files\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe)" \ --env DELPHI_CONFIG="Default Delphi build configuration, e.g., Release or Debug" \ --env DELPHI_PLATFORM="Default Delphi platform, e.g., Win32 or Win64"
How to use
This MCP server exposes Delphi build and clean capabilities via MCP over stdio. It wraps a set of tools that can build and clean Delphi projects (.dproj, .groupproj) using MSBuild, while initializing the RAD Studio environment through rsvars.bat. The server also accommodates additional toolchains (FPC and Lazarus) through the other actions described in the repository, but the primary focus is Delphi via MSBuild with optional rsvars.bat initialization. To use it, start the server with Node, ensuring the environment is prepared (RAD Studio installed and MSBuild available). Clients can then send MCP commands to invoke actions like delphi.build or delphi.clean, passing the required arguments such as project path, configuration, and platform. The server handles environment setup, MSBuild invocation, and result reporting, returning success or failure details for each build task. If you are integrating in CI or automation, you can configure RSVARS_BAT and MSBUILD_PATH via environment variables or a .env file to ensure the Delphi toolchain is correctly wired at runtime.
How to install
Prerequisites
- Windows operating system
- Node.js >= 18
- Embarcadero RAD Studio installed (for rsvars.bat and the Delphi toolchain)
- MSBuild available (from Visual Studio Build Tools or RAD Studio toolchain)
Installation steps
-
Install dependencies and build the server
- Using npm: npm install npm run build
-
Prepare environment variables (example .env) RSVARS_BAT=C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\rsvars.bat MSBUILD_PATH=C:\Program Files\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe DELPHI_CONFIG=Release DELPHI_PLATFORM=Win32
-
Run the MCP Delphi server
- Start via Node with the environment file: node --env-file=.env dist/server.js
- Or, run after installation if distributed with a binary: mcp-delphi-server
-
Verify server is running and accepting MCP commands by issuing a few test commands through an MCP client.
Additional notes
Notes and tips
- Windows-first support: Delphi integration relies on the RAD Studio toolchain and MSBuild. Ensure rsvars.bat can initialize the environment before MSBuild.
- If RSVARS_BAT is not set, MSBuild may fail due to missing environment variables such as BDS or Library paths.
- The server can handle Delphi group projects (.groupproj) by traversing contained projects during MSBuild execution.
- FPC and Lazarus tooling are supported as separate actions (fpc.build, lazarus.build, lazarus.clean). Provide explicit paths when these tools are not in the system PATH.
- If MSBuild is not in PATH, specify MSBUILD_PATH to point to the exact MSBuild executable. Consider adding it to PATH for convenience.
- Ensure the working directory or mounted volumes in container setups preserve paths to the Delphi projects and msbuild if running inside containers or CI runners.
Related MCP Servers
obsidian -tools
Add Obsidian integrations like semantic search and custom Templater prompts to Claude or any MCP client.
ironcurtain
A secure* runtime for autonomous AI agents. Policy from plain-English constitutions. (*https://ironcurtain.dev)
CanvasMCPClient
Canvas MCP Client is an open-source, self-hostable dashboard application built around an infinite, zoomable, and pannable canvas. It provides a unified interface for interacting with multiple MCP (Model Context Protocol) servers through a flexible, widget-based system.
vikunja
Model Context Protocol server for Vikunja task management. Enables AI assistants to interact with Vikunja instances via MCP.
grok-faf
First MCP server for Grok | FAST⚡️AF • URL-based AI context • Vercel-deployed
mcp-turso
MCP server for interacting with Turso-hosted LibSQL databases