MCP 为德尔菲项目呼叫MSBUILD
概览
MCP(模式背景协议)服务器,用于与MSBuild一起构建Delphi项目. dbuiltmcp 通过提供兼容MCP的HTTP API,使得AI助手能够编译Delphi项目. 它自动设置正确的RAD Studio构建环境并执行MSBuild,还原完整的构建输出. - 通过 MCP 协议构建 Delphi 项目(.dproj) - 自动 RAD 工作室环境设置 - Win32:使用 bin\rsvars.bat - Win64:使用 bin64\rsvars64.bat - 支持 Win32 和 Win64 平台 - 调试和释放配置 - 构建(完全重建) 或 Make(递增) 构建类型 - 配置 MSBuild 动词(安静,正常,详细) - 简洁,符号高效输出:一个一行结果头,在失败时只写出错,加上提示/警告和全线上限 - 可配置的构建时断(默认为10分钟) - RAD Studio 13 (Delphi 37.0) - https://github.com/GDKsoftware/Delphi-MCP-Server (可能会有额外负债) 1. 清除储存库 2.
概述(AI 翻译)
MCP(模式背景协议)服务器,用于与MSBuild一起构建Delphi项目.
□ 概览
dbuiltmcp 通过提供兼容MCP的HTTP API,使得AI助手能够编译Delphi项目. 它自动设置正确的RAD Studio构建环境并执行MSBuild,还原完整的构建输出.
□ 特性
- 通过MCP协议建立Delphi项目(.dproj)
- 自动RAD Studio环境设置
- Win32:使用
bin\rsvars.bat - Win64:使用
bin64\rsvars64.bat - 支持Win32和Win64平台
- 调试和发布配置
- 建造(全面重建)或建造(递增)建筑类型
- 可配置的MSBuild动词(静音、正常、详细)
- 简明、节能的符号输出:一个单行结果头,只有故障时才会出错,加上提示/警告和总行上限
- 可配置的构建超时(默认为10分钟)
□ 要求
- RAD Studio 13(德尔菲37.0)
- [T2
□ 安装
- 清除储存库
- 在RAD Studio中打开[[T3]
- 汇编项目
- 运行可执行文件
服务器默认从3001端口开始.
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
dbuildmcp
MCP (Model Context Protocol) server for building Delphi projects with MSBuild.
Overview
dbuildmcp enables AI assistants to compile Delphi projects by providing an MCP-compatible HTTP API. It automatically sets up the correct RAD Studio build environment and executes MSBuild, returning the complete build output.
Features
- Build Delphi projects (.dproj) via MCP protocol
- Automatic RAD Studio environment setup
- Win32: uses
bin\rsvars.bat - Win64: uses
bin64\rsvars64.bat
- Win32: uses
- Support for Win32 and Win64 platforms
- Debug and Release configurations
- Build (full rebuild) or Make (incremental) build types
- Configurable MSBuild verbosity (quiet, normal, detailed)
- Concise, token-efficient output: a one-line result header, errors-only on failure with a configurable error cap, plus hint/warning and total-line ceilings
- Configurable build timeout (default 10 minutes)
Requirements
- RAD Studio 13 (Delphi 37.0)
- https://github.com/GDKsoftware/Delphi-MCP-Server (may have additional depencies)
Installation
- Clone the repository
- Open
Source/dbuildmcp.dprojin RAD Studio - Compile the project
- Run the executable
The server starts on port 3001 by default.
Usage
Starting the Server
Run the compiled executable. The server will start and display:
MCP Server running on port 3001
Press ENTER to stop...
Building a Project
Send a POST request to http://localhost:3001/mcp:
curl -X POST http://localhost:3001/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "msbuild",
"arguments": {
"projectFile": "C:/projects/MyApp/MyApp.dproj",
"platform": "Win64",
"config": "Release",
"buildType": "Build",
"verbosity": "normal"
}
}
}'
Important: Use forward slashes (/) in file paths, not backslashes.
Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
projectFile |
Yes | - | Path to .dproj file (use / not \) |
buildType |
No | Make |
Build (full) or Make (incremental) |
platform |
No | Win64 |
Win32 or Win64 |
config |
No | Debug |
Debug or Release |
verbosity |
No | quiet |
quiet, normal, or detailed |
showHintsAndWarnings |
No | false |
Show hints/warnings in output (default: filtered) |
graphviz |
No | false |
Emit a .gv GraphViz unit-dependency file (passes --graphviz to dcc) |
graphvizExclude |
No | System.*;Vcl.*;Winapi.*;Data.*;Soap.*;Xml.* |
;-separated unit-name wildcards to exclude (only used when graphviz=true) |
graphvizOutDir |
No | next to project | Directory to collect the .gv file, use / not \ (only used when graphviz=true) |
maxErrors |
No | 10 (from settings.ini) |
Max error lines shown on a failed build. 1 = first error only, 0 = all |
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →