Daofy — Multi-Language MCP Server for Delphi & Lazarus/FPC
💡 推广:本工具由 OrcaRouter 赞助支持。OrcaRouter 是一个强大的 AI 路由引擎,能智能调度最合适的 AI 模型处理您的任务。点击上方链接了解详情。
Power your agent
Cài đặt từ nhà phát hành. Không phải endpoint của PlugMCP.
Host a copy with our keys and logs.
Chưa có bản phát hành đóng gói nào trong registry. Làm theo README của kho mã.
URL từ xa hay một lệnh trên máy của bạn? Hai cách cài đặt khác nhau thế nào
Chạy trên PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
MởTừ nhà phát hành
💡 推广:本工具由 OrcaRouter 赞助支持。OrcaRouter 是一个强大的 AI 路由引擎,能智能调度最合适的 AI 模型处理您的任务。点击上方链接了解详情。
Daofy for Delphi — MCP Server that compiles Delphi projects and queries knowledge base for AI assistants.
一个为 AI 助手提供 Delphi 和 Lazarus/Free Pascal 工程编译能力和知识库查询功能的 MCP Server。如果您觉得有用,请不要吝啬您的 Star! ⭐
Daofy(道飞)——为创意插上翅膀。
Daofy 是一个基于 Model Context Protocol (MCP) 的 MCP Server,它允许 AI 助手直接编译 Delphi 和 Lazarus/Free Pascal 项目并查询知识库。
通过这个工具,您可以在与 AI 助手的对话中直接编译工程、查询 API 文档、搜索代码示例,无需手动切换到 IDE 或命令行。
主要优势:
html2text, requests (已在 requirements.txt)python-docx (Word .docx 支持), antiword/catdoc (旧版 Word .doc 支持), PyMuPDF (PDF 支持,推荐) 或 pdfplumber (PDF 支持,备选), beautifulsoup4 (EPUB 支持)用户首次使用或需要重建 Delphi API 文档时,调用 delphi_kb 工具构建文档知识库:
delphi_kb(
action="build",
kb_type="document",
async_mode=true
)
说明:
directory="C:\Program Files (x86)\Embarcadero\Studio\<版本>\Help\Doc"
extensions=[".chm"]:只扫描 CHM 文件,工具会自动解压并导入 HTML 文档async_mode=true:异步执行(耗时数分钟),提交后返回 task_id,通过 async_task(action=status, task_id=...) 轮询进度tools/7z/ 目录下免安装)构建 Delphi 官方 Demos/Samples + 三方库 Demos/Tests 的全文搜索知识库:
delphi_kb(
action="build",
kb_type="example"
)
搜索示例代码:
delphi_kb(
query="TThread.Queue",
kb_type="example"
)
示例知识库仅全文搜索,不解析结构化符号(类/函数),适合快速查找示例用法。
使用 kb_type="all" 时默认不搜索示例知识库,需显式指定 kb_type="example"。
Daofy 内置 Delphi GUI/Console 自动化测试框架,支持 AI 驱动的 UI 交互测试:
DaofyAutomation 单元,AI 通过 automate_delphi 工具发送脚本命令操控界面(点击/输入/截图/断言)waitfor)、RTTI 属性读写(rget/rset)、截图比对keep_alive 模式下进程常驻,避免重复启动开销📖 启用指南: 如何在自己的 Delphi 项目中接入自动化测试,见
docs/automate_test_guide.md的「启用指南」章节。
编译器自动检测(PATH / 注册表 / 常见安装目录),无需手动配置。仅安装对应开发工具后,相关插件自动启用。
所有知识库数据存储在项目根目录的 data/ 文件夹下:
每个知识库目录包含:
*.zvec/ - ZVec 向量数据库目录(文档/示例/项目/三方库知识库)experiences.sqlite - 经验记忆数据库(仅经验知识库保留 SQLite)config.json - 知识库配置文件说明:除经验知识库外,所有知识库已从 SQLite 迁移到 ZVec 向量引擎。文档知识库不再使用 SQLite FTS5,改用 ZVec 全文索引。
每个知识库通过 config.json 文件进行配置,支持自定义数据库、源码路径、构建参数等。
配置文件在首次构建时自动生成,通常无需手动修改。
pip install daofy-for-delphi
安装完成后直接进入 → 配置 AI 助手 步骤即可。
国内用户可使用镜像源加速:
pip install daofy-for-delphi -i https://pypi.tuna.tsinghua.edu.cn/simple
请按以下步骤安装 Daofy:
[] 检查并安装 Git/Python 3.10-3.14/7-Zip
[] 安装 https://github.com/chinawsb/daofy.git(国内用户可用镜像: https://gitee.com/zuoyouruanjian/daofy.git)
[] 安装完成后验证结果并帮我配置当前客户端
git clone https://github.com/chinawsb/daofy.git
# 国内用户可用 Gitee 镜像加速:
# git clone https://gitee.com/zuoyouruanjian/daofy.git
cd daofy
python -m venv venv
Windows:
venv\Scripts\activate
Linux/macOS:
source venv/bin/activate
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
可选国内镜像源:
首次使用时,MCP Server 会自动从 Windows 注册表检测已安装的 Delphi 编译器,无需手动配置。
自动检测支持的 Delphi 版本:
如果需要手动配置或添加自定义编译器,可以直接编辑 config/compilers.json 文件,或使用 check_environment 工具的 detect action 重新检测。
如果通过 pip install daofy-for-delphi 安装,配置最简:
{
"mcpServers": {
"daofy": {
"command": "daofy",
"env": {
"PYTHONUNBUFFERED": "1",
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
}
}
}
}
路径含空格时报错? 如果 Python 安装在
D:\Program Files\...等含空格的路径,部分 MCP 客户端无法正确处理。解决方案:将command改为 Python 解释器完整路径,args改为-m src:{ "mcpServers": { "daofy": { "command": "D:\\Program Files\\Python311\\python.exe", "args": ["-m", "src"], "env": { ... } } } }也可直接指定
server.py:"args": ["D:\\path\\to\\daofy\\src\\server.py"]
以下配置适用于通过 git clone 源码安装的用户,请将路径替换为实际安装路径。
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"daofy": {
"command": "python",
"args": ["C:\\path\\to\\daofy\\src\\server.py"],
"env": {
"PYTHONUNBUFFERED": "1",
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
}
}
}
}
Windows: C:\Users\<用户名>\.trae-cn\mcp_config.json
{
"mcpServers": {
"daofy": {
"command": "F:\\ProPlus\\DelphiPlus\\Experts\\DelphiMCPServer\\delphi-complier-mcp-server\\venv\\Scripts\\python.exe",
"args": [
"F:\\ProPlus\\DelphiPlus\\Experts\\DelphiMCPServer\\delphi-complier-mcp-server\\src\\server.py"
],
"env": {
"PYTHONUNBUFFERED": "1",
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
}
}
}
}
注意: 请将路径修改为您的实际安装路径。
Windows: ~/.codeartsdoer/mcp/mcp_settings.json
{
"mcpServers": {
"daofy": {
"command": "python",
"args": ["src\\server.py"],
"cwd": "C:\\path\\to\\daofy",
"env": {
"PYTHONUNBUFFERED": "1",
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
}
}
}
}
DSH 通过 profile 的 cordis.patch.yml 注册 MCP Server。使用安装脚本 install_mcp.py 一键安装/卸载(与其它 Agent 同一入口):
python install_mcp.py --agent DSH # 安装 Daofy 到默认 profile (web)
python install_mcp.py --agent DSH --dsh-profile cli # 指定 profile
python install_mcp.py --agent DSH --python "D:\Python311\python.exe" # 指定 Python 解释器
python install_mcp.py --agent DSH --pip # pip 安装模式(command=daofy)
python install_mcp.py --agent DSH --uninstall # 卸载 Daofy
也可以不加 --agent,在交互菜单中选择 DSH。安装脚本会自动检测 DSH(~/.dsh/profiles/ 目录或 dsh 命令)。
生成的 cordis.patch.yml 条目(示意):
# ── Daofy for Delphi MCP Server (managed by install_mcp.py; uninstall: 重新运行脚本选择 DSH)
- insert:
- id: mcp-daofy
name: '@deepseek-ai/dsh-mcp-client'
config:
serverName: 'daofy'
transport: stdio
command: 'C:\path\to\python.exe'
args:
- 'C:\path\to\daofy\src\server.py'
env:
PYTHONUNBUFFERED: '1'
PYTHONIOENCODING: 'utf-8'
PYTHONUTF8: '1'
cwd: 'C:\path\to\daofy'
toolCallTimeoutMs: 600000
特性:
!!js 表达式--pip 时直接使用 daofy 命令[] 保证 patch 文件仍是合法 YAML解决方案:
config/compilers.json 文件中的编译器路径是否正确check_environment 工具 action=detect 重新检测编译器解决方案:
pip install -r requirements.txtpip show mcpSpawn D:\Program ENOENT 路径含空格报错pip 安装后,部分 MCP 客户端(Trae 等)在路径含空格时无法正确 spawn。
解决方案:在 MCP 配置中用 Python 解释器完整路径替代 daofy 命令:
{
"command": "D:\\Program Files\\Python311\\python.exe",
"args": ["-m", "src"]
}
也可用源码安装方式:"args": ["D:\\path\\to\\daofy\\src\\server.py"]
解决方案:
delphi_kb 工具的 action=build 构建MIT License
Copyright (c) 2026 吉林省左右软件开发有限公司 Copyright (c) 2026 Equilibrium Software Development Co., Ltd, Jilin
详见 LICENSE 文件。
emit 不再阻塞(可写空间足够才直写,否则入队、满则丢弃),后台消化线程可取消(CancelSynchronousIo 看门狗 + 30s 冷却重试);setup_logger 文件处理器先挂且与 console_logging 解耦——修复客户现场 stderr 管道写满卡死服务(连 MCP initialize 都无法响应)的故障example_knowledge_base._scan_directory 日志 4 个占位符仅传 3 个参数,全量测试下被 pytest 日志捕获器冒泡为 TypeError(24 个用例失败)TLocalVarInfo.GetTypeSize 改为 MapDataSerializer.GetLocalVarTypeSize,并在 MapDataSerializer 接口导出 MakeLocalVarInfo/GetLocalVarTypeSizeinstall_mcp.py 一键安装/卸载 DeepSeek Harness(--agent DSH),读写 cordis.patch.ymldelphi_file 相对路径按 project_path → workspace_root → CWD 解析.dproj 的 DCC_ExeOutput/DCC_DcuOutput 目录允许直接读写exception.logdelphi_kb(build, kb_type=delphi, version=...) 只索引对应 RTL/VCL/FMX 源码SendMessageTimeout + 版本号三事件无锁协议(提交/完成/放弃各 +1,僵尸消息 LParam 过滤),主线程死锁/忙时管道线程最多阻塞 200ms 即让出,异步结果回传不被长阻塞Tests/冒烟测试/ 新增正常路径(waitfor-basic.json)与超时/模态故障路径(waitfor-timeout-modal.json),AutoTest.exe 实测三轮全过get_coding_rules(examples=...) 新增 naming/formatting/documentation/error-handling 四个示例文件,修复 skill 广告示例在服务端不存在的问题lazarus_compile (lazbuild编译)、lazarus_project (项目信息查询)、lazarus_kb (FPC/LCL 源码知识库)、lazarus_file (文件读写与备份)coding-rules/ 拆分为 delphi/、lazarus/、shared/ 三层;get_coding_rules 新增 language 参数(支持 "delphi" 和 "lazarus")OutputParser 新增 FPC 格式支持(File(13,3) Fatal: (2003) message)Winapi.Windows 与 Vcl.Graphics 相对顺序改变导致类型解析错误project() → delphi_project()、ZVec 存储结构、kb_type 补全、section 索引扩展、tutorial 同步修复project → delphi_project,防止非 Delphi 用户误触delphi_rtti 工具: Delphi RTTI 桥接 — 通过 Enhanced RTTI 发现和调用 Delphi 应用的 published 方法(三步法:guide/discover/call)generate_copyright 工具: 软著文档自动生成(源代码/说明书/摘要,PDF 浏览器渲染+自动校验)daofy_update 工具: Daofy 自身版本检查和更新管理(check/update/version)scan_directory 改为生产者-消费者模式,内存峰值从天降至 KB 级DaofyAutomation.RttiDiscovery.pas: 新增 RTTI 能力发现单元,TRttiDiscoverer 类将 Delphi 类型映射为 JSON SchemaDaofyAutomation.Base.pas / Vcl.DaofyAutomation.pas: 新增 rtti_discover 命令路由和 VCL 端 GetRttiClasses 重写src/services/rtti_bridge.py: 新增 RTTI 桥接服务(连接管理/5分钟缓存/discover/call)src/tools/delphi_rtti.py: 新增 MCP 工具 handler(action=guide/discover/call).opencode/skills/delphi-rtti-bridge/SKILL.md: 新增 AI Agent 技能文件(含 YAML frontmatter + 渐进式 L3 文档)scripts/build-skills.py: 技能多平台分发脚本(自动分发到 .claude/ .cursor/ .windsurfrules)tests/test_rtti_bridge.py / tests/test_delphi_rtti.py: 38 个测试用例覆盖桥接服务 + 工具 handlerautomate_delphi 新增 Console 模式: 支持 subprocess stdin/stdout 交互,自动 PE 头检测 GUI vs Consolefile_tool 路径白名单校验 + 脏标记系统: _validate_path() 安全校验,写后标记脏防止行号错位CODING_RULES.mdc 规则重构: 全面重写 delphi_file 写入规则、紧凑输出格式、脏标记保护delphi_file 全操作 RWLock 防并发文件损坏:read/write/format/backup/uses 全部引入多读单写锁,并发写入返回明确错误,引导合并到一次 write(edits=[...])tools/7z/ 补齐 7z.dll,release 包开箱可用tool_docs.py 约束强化:统一写入参数为 edits,并新增并行写入禁令(后续版本推荐 replace/insert/delete 结构化入口).gitignore 排除 dot-prefixed 目录,清理 AI 工作目录追踪delphi_file 写入统一为 write(edits=[...]):一次传入多个 edit,内部按 start_line 升序排列,内存中累积偏移量后一次性写出compilers.json 路径自愈:检测到不在 src/config/ 时自动回退到项目根 config/,避免 MCP 启动时因路径差异直接报错except Exception: pass 添加 logger.debug 异常日志,便于调试时定位失败原因search_knowledge 重构:597→37 行,拆 16 个模块级子函数,行为完全等价delphi_file 部分写入行号修正:0-indexed 文档纠偏,写入后返回偏移量+后续行号调整公式delphi_file(action="uses") 同步返回偏移量信息AGENTS.md 当时新增部分写入规则章节;后续版本已统一为 1-indexed inclusive 行号manage_component 工具:DFM 组件增/删/改/生成 + PAS 自动同步(替代原 generate_component_dfm)delphi_file 重命名+增强:DFM 二进制自动转换、备份管理、搜索定位(原名 file_tool,旧名仍兼容)get_coding_rules 增强:支持按章节分段获取,节省 tokencode_hosting 工具:统一 Gitea/GitHub/GitLab 操作完整版本历史详见 CHANGELOG.md
欢迎提交 Issue 和 Pull Request!
如果您觉得 Daofy for Delphi 对您有帮助,欢迎通过以下方式赞助支持我们。 您的支持让项目走得更远!❤️
账号: [email protected](姓名:管耸寰,请标明QQ号)
账号: wangshengbo(发送红包或转账)
直接群支付,或给群主发红包
QQ官方群: 250530692
如有问题或建议,请提交 Issue。
Daofy for Delphi — MCP Server that compiles Delphi projects and queries knowledge base for AI assistants.
Công cụ
Chưa có danh sách công cụ. Máy chủ từ xa sẽ có danh sách sau lần kiểm tra tình trạng đầu tiên.
Câu hỏi thường gặp
Sao chép cấu hình stdio cho Cursor, Claude Desktop, Claude Code hoặc VS Code trên trang này. Cấu hình dùng bản cài đặt của nhà phát hành, không phải proxy của PlugMCP.
Bản ghi này không liệt kê biến môi trường bắt buộc nào.
Daofy chạy cục bộ qua stdio.
Kiểm tra lần cuối: 2026-11-05. Daofy for Delphi — MCP Server that compiles Delphi projects and queries knowledge base for AI assistants.