Delphi编译器MCP是一个轻量级的模型上下文协议(MCP)服务器,它封装了原生Delphi(RAD Studio)编译器。它支持用Object Pascal编写的Win32和Win64项目进行自动调试/发布构建。
Delphi编译器MCP能轻松助力您完成Delphi项目的构建,以下为您介绍其安装和使用方法。
pip install delphi-compiler-mcp
git clone https://github.com/yourusername/delphi-compiler-mcp.git
pip install .
创建(或更新)您的MCP客户端配置,例如 .cursor/mcp.json:
{
"mcpServers": {
"delphi-compiler": {
"command": "delphi-compiler-mcp",
"env": {
"DELPHI_PATH": "C:\\Program Files (x86)\\Embarcadero\\Studio\\23.0"
}
}
}
}
# 默认编译(调试 / Win32)
mcp call delphi-compiler compile
# Win64的发布构建
mcp call delphi-compiler build --platform Win64
如果您的MCP客户端支持自然语言命令(例如通过AI助手),只需说出以下内容即可:
客户端会将这些短语转换为上述相应的MCP调用。