by chinawsb
Provides Delphi project compilation and knowledge‑base query capabilities for AI assistants, enabling direct compile, syntax check, and semantic search of Delphi code and documentation.
Delphi MCP Server delivers compilation and knowledge‑base services for Delphi projects, allowing AI assistants to compile whole projects or single units, retrieve class/function definitions, perform semantic code searches, and consult Delphi help documentation without leaving the chat interface.
pip install -r requirements.txt.src/server.py script (e.g., python src/server.py).compile_project, search_class, semantic_search_project, or get_coding_rules from the assistant to trigger compilation or knowledge‑base queries..dproj/.dpr) with MSBuild, generating EXE/DLL..pas units.Q: Which Delphi versions are supported? A: All versions from Delphi 2005 up to Delphi 13 (Florence) are auto‑detected via the registry.
Q: Do I need to manually configure the compiler path?
A: No. The server auto‑detects installed compilers. Manual configuration is optional via set_compiler_config or editing config/compilers.json.
Q: How are knowledge bases stored?
A: Global Delphi source and help bases reside in data/delphi-knowledge-base/ and data/help-knowledge-base/. Project‑specific bases are created under <project>/.delphi-kb/.
Q: What if the server cannot start?
A: Verify the Python environment, ensure all dependencies are installed, and check that the MCP library version matches the requirements (pip show mcp).
Q: Can I use the server on Linux/macOS? A: The server runs on any OS with Python 3.10‑3.14, but Delphi compilers are Windows‑only, so full compilation features require Windows.
一个为 AI 助手(如 Claude Desktop、CodeArts Agent 等)提供 Delphi 工程编译能力和知识库查询功能的 MCP Server。如果您觉得有用,请不要吝啬您的 Star! ⭐
Delphi MCP Server 是一个基于 Model Context Protocol (MCP) 的服务器,它允许 AI 助手直接编译 Delphi 项目并查询 Delphi 知识库。通过这个工具,您可以在与 AI 助手的对话中直接编译 Delphi 工程、查询 API 文档、搜索代码示例,无需手动切换到 IDE 或命令行。
主要优势:
请按以下步骤安装 Delphi MCP Server:
[] 检查并安装 Git/Python 3.10-3.14/7-Zip (安装时优先使用国内镜像源加速下载)
[] 安装 https://github.com/chinawsb/delphi-complier-mcp-server.git
[] 安装完成后验证结果并帮我配置当前客户端
git clone https://github.com/chinawsb/delphi-complier-mcp-server.git
cd delphi-complier-mcp-server
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 版本:
如果需要手动配置或添加自定义编译器,可以通过 MCP 工具 set_compiler_config 进行配置,或直接编辑 config/compilers.json 文件。
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"delphi-compiler": {
"command": "python",
"args": ["C:\\path\\to\\delphi_mcp_server\\src\\server.py"],
"env": {
"PYTHONUNBUFFERED": "1",
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
}
}
}
}
Windows: ~/.codeartsdoer/mcp/mcp_settings.json
{
"mcpServers": {
"delphi-compiler": {
"command": "python",
"args": ["src\\server.py"],
"cwd": "C:\\path\\to\\delphi_mcp_server",
"env": {
"PYTHONUNBUFFERED": "1",
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
}
}
}
}
| 工具名称 | 功能描述 |
|---|---|
compile_project |
编译 Delphi 工程 |
compile_file |
编译单个 Delphi 单元文件(仅语法检查) |
get_compiler_args |
获取编译器命令行参数(不执行编译) |
set_compiler_config |
配置 Delphi 编译器 |
check_environment |
检查编译器环境状态 |
| 工具名称 | 功能描述 |
|---|---|
build_knowledge_base |
构建 Delphi 源码知识库 |
search_class |
搜索 Delphi 类定义 |
search_function |
搜索 Delphi 函数/过程定义 |
semantic_search |
语义搜索 Delphi 代码 |
get_knowledge_base_stats |
获取知识库统计信息 |
list_delphi_versions |
列出已安装的 Delphi 版本 |
| 工具名称 | 功能描述 |
|---|---|
init_project_knowledge_base |
初始化项目知识库 |
search_project_class |
在项目中搜索类定义 |
search_project_function |
在项目中搜索函数定义 |
semantic_search_project |
在项目中进行语义搜索 |
get_project_kb_stats |
获取项目知识库统计信息 |
get_thirdparty_paths |
获取项目的三方库路径 |
| 工具名称 | 功能描述 |
|---|---|
build_help_knowledge_base |
构建 Delphi 帮助文档知识库 |
search_help |
搜索 Delphi 帮助文档 |
get_help_kb_stats |
获取帮助文档知识库统计信息 |
| 工具名称 | 功能描述 |
|---|---|
get_coding_rules |
获取 Delphi 源码编码规则 |
| 知识库类型 | 位置 | 说明 |
|---|---|---|
| Delphi 源码知识库 | data/delphi-knowledge-base/ |
Delphi 官方源码,全局共享 |
| 帮助文档知识库 | data/help-knowledge-base/ |
Delphi CHM 帮助文档,全局共享 |
| 项目知识库 | <项目目录>/.delphi-kb/ |
项目特定,包含三方库和项目源码 |
| 知识库 | 文档数 | 类数量 | 函数数量 |
|---|---|---|---|
| Delphi 源码 | 3,081 | 17,731 | 168,925 |
| 帮助文档 | 160,174 | - | - |
解决方案:
config/compilers.json 文件中的编译器路径是否正确set_compiler_config 工具重新配置编译器解决方案:
pip install -r requirements.txtpip show mcp解决方案:
build_knowledge_base 工具MIT License
Copyright (c) 2026 吉林省左右软件开发有限公司 Copyright (c) 2026 Equilibrium Software Development Co., Ltd, Jilin
详见 LICENSE 文件。
get_coding_rules 工具,用于获取 Delphi 源码编码规则欢迎提交 Issue 和 Pull Request!
如有问题或建议,请提交 Issue。
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.