BF

basti-fantasti/delphi-build-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

10 stars 3 forks 质量 73 趋势 18Apache-2.0

A mcp Server for AI assisted programming to compile Delphi projects

概览

A Model Context Protocol (MCP) server that enables AI coding agents like Claude Code to compile Delphi projects programmatically. - : Windows targets (Win32/Win64/Win64x) compile via MSBuild, producing byte-identical output to the Delphi IDE — including icons, manifests, and DPI awareness - : MSBuild for Windows targets, direct dcc for cross-compilation (Linux64/Android/Android64) - : Windows targets need only the Delphi installation path — MSBuild reads everything else from the .dproj - : Generate config from IDE build logs with multi-line parsing - : Generate unified config from multiple build logs (Debug/Release × Win32/Win64/Win64x/Linux64) - : Add new platforms or libraries to existing config without regenerating - : Reads .dproj files for build settings and compiler flags - : Compiles both application (.dpr) and package (.dpk) projects with correct output (.exe/.

README

以下为原文 README 节选,完整内容请查看原文。

Delphi Build MCP Server

A Model Context Protocol (MCP) server that enables AI coding agents like Claude Code to compile Delphi projects programmatically.

Features

  • IDE-Identical Windows Builds: Windows targets (Win32/Win64/Win64x) compile via MSBuild, producing byte-identical output to the Delphi IDE — including icons, manifests, and DPI awareness
  • Hybrid Compilation: MSBuild for Windows targets, direct dcc for cross-compilation (Linux64/Android/Android64)
  • Minimal Configuration: Windows targets need only the Delphi installation path — MSBuild reads everything else from the .dproj
  • Automatic Configuration: Generate config from IDE build logs with multi-line parsing
  • Multi-Config Support: Generate unified config from multiple build logs (Debug/Release × Win32/Win64/Win64x/Linux64)
  • Extend Configuration: Add new platforms or libraries to existing config without regenerating
  • Smart Compilation: Reads .dproj files for build settings and compiler flags
  • Package Support: Compiles both application (.dpr) and package (.dpk) projects with correct output (.exe/.bpl)
  • Filtered Output: Returns only errors, filters out warnings and hints
  • Multi-Language Support: Parses both English and German compiler output
  • Response File Support: Handles command lines >8000 characters automatically
  • Cross-Platform: Supports Win32, Win64, Win64x (LLVM), Linux64, Android, and Android64
  • Environment Variables: Auto-expands ${USERNAME} in paths
  • MCP Compatible: Works with Claude Code, Cline, and other MCP clients
  • Network Transport: Streamable HTTP support for remote access (e.g., WSL-Ubuntu to Windows host)
  • WSL Interop: Use from WSL-Ubuntu via stdio through Windows Python or via Streamable HTTP

Quick Start

1. Install

# Install UV if you haven't already
# Windows: powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# macOS/Linux: curl -LsSf https://astral.sh/uv/install.sh | sh
# Or: pip install uv

cd delphi-build-mcp-server
uv venv
uv pip install -e .

2. Generate Configuration

In Delphi IDE:

  1. Tools > Options > Building > Show compiler progress > “Verbose”
  2. Build your project
  3. View > Messages > Right-click > Copy All
  4. Save to build.log

Then generate config:

Single Build Log (simple projects):

# Platform-specific config is generated by default (e.g., delphi_config_win64.toml)
uv run python -m src.config_generator build.log

# Generate generic delphi_config.toml instead
uv run python -m src.config_generator build.log --generic

Multiple Build Logs (multi-platform projects):

For projects targeting multiple platforms (Win32/Win64/Linux64), create build logs for each configuration:

  1. Build in IDE with each Platform/Config combination
  2. Save each build log separately (e.g., build_debug_win32.log, build_release_linux64.log)
  3. Generate config from all logs:
# Separate platform-specific config files (default)
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "delphi-build": { "command": "uv", "args": [ "run", "--directory", "C:\\path\\to\\delphi-build-mcp-server", "main.py" ], "env": { "DELPHI_CONFIG": "C:\\path\\to\\delphi-build-mcp-server\\delphi_config.toml" } } } }