这是一个MCP(模型上下文协议)服务器,它提供了使用MSBuild在Windows上构建和清理Delphi项目(.dproj/.groupproj)的工具,并通过rsvars.bat初始化RAD Studio环境。
<a href="https://glama.ai/mcp/servers/@flydev-fr/mcp-delphi"> <img width="380" height="200" src="https://gips2.baidu.com/it/u=1063065971,295472341&fm=3081&app=3081&f=PNG?w=760&h=400" alt="Delphi 构建服务器 MCP 服务器" /> </a>pnpm install
pnpm run build
或者使用npm:
npm install
npm run build
你可以通过环境变量配置默认值(如果你想的话,在此目录中使用一个.env文件):
创建一个.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
该服务器通过stdio使用MCP。启动它:
node --env-file=.env dist/server.js
或者,在全局安装后(或作为依赖项),运行二进制文件:
mcp-delphi-server
在开发期间:
pnpm run dev
此仓库包括位于test/projects的小型Delphi测试项目,以及位于test/projects/lazarus的Lazarus示例。辅助脚本位于scripts/。
pnpm run test:build:allpnpm run test:build:console:win32pnpm run test:build:console:win64pnpm run test:build:vcl:win32pnpm run test:build:vcl:win64pnpm run test:build:group:win32pnpm run test:build:group:win64test:clean:*下。{
"name": "delphi.build",
"arguments": {
"project": "C:/path/to/MyApp.dproj",
"configuration": "Release",
"platform": "Win64"
}
}
{
"name": "fpc.build",
"arguments": {
"source": "C:/path/to/lazarus/project1.lpr",
"cpu": "x86_64",
"os": "win64",
"fpcPath": "C:/path/to/fpc.exe"
}
}
{
"name": "lazarus.build",
"arguments": {
"project": "C:/path/to/lazarus/project1.lpi",
"cpu": "x86_64",
"os": "win64",
"lazbuildPath": "C:/path/to/lazbuild.exe"
}
}
dist:pnpm run buildpnpm run test:build:allnpm publish(或pnpm publish)如果在作用域下发布,请相应地设置包名并确保您已使用正确的访问权限登录。