
允许AI代理与Delphi 11、12、13 LSP服务器通信(DelphiLSP.exe <——需要有效的Delphi/Embarcadero许可证!)
概览
一款模型上下文协议(MCP)服务器,向AI助手和其他MCP客户端展示语言服务器协议(LSP)能力。 - 德尔菲海滨海(DelphiLSP.exe年)- 自由帕斯卡尔(pasls.exe年) - MCP规范:- LSP规范: - MCP ↔ LSP 桥接 JSON-RPC 2.0 - 基于 stdio 的传输 - 动态工作区发现 - AI 代理语义代码智能 - 支持 Delphi 和 Free Pascal - 调试同步支持(--等待) - 自动项目发现(.dpr / .lpr) - LSP 重试逻辑和自动文档打开 - 兼容以下设备:- Claude Desktop - Gemini-CLI - Antigravity - 其他兼容 MCP 客户端 - 前往定义 - 查找参考 - 悬停鼠标信息 - 代码补全 - 工作区符号搜索 - MCP规范(2025-11-25)https://modelcontextprotocol.io/specification/2025-11-25 - 语言服务器协议规范 3.17 https://microsoft.github.io/language-server-protocol/specifications/lsp/3.
概述(AI 翻译)
一款模型上下文协议(MCP)服务器,向AI助手和其他MCP客户端展示语言服务器协议(LSP)能力。
支持两者:
- 德尔菲海滨大道(
DelphiLSP.exe) - 自由帕斯卡尔(
pasls.exe)
目标规格
- MCP规范:2025-11-25
- LSP规范:3.17
特色
- 使用 JSON-RPC 2.0 的 MCP ↔ LSP 桥接器
- 基于StdiO的交通
- 动态工作区发现
- 人工智能代理的语义代码智能
- 德尔斐和自由帕斯卡尔的支持
- 调试器同步支持(
--wait) - 自动项目发现(
.dpr/.lpr) - LSP 重试逻辑和自动文档打开
- 兼容:
- Claude桌面
- Gemini-CLI
- 反重力
- 其他兼容MCP的客户端
支持的运营
- 前往定义
- 查找参考文献
- 悬停信息
- 代码补全
- 工作区符号搜索
项目信息
| 项目 | 详情 |
|---|---|
| 作者 | 天巴克飞行 |
| 联系方式 | [email protected] |
| 版本 | 0.08 |
| 仓库 | https://github.com/SkybuckFlying/Delphi-LSP-MCP-Server |
规格
- MCP规范(2025-11-25) https://modelcontextprotocol.
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Delphi LSP MCP Server
A Model Context Protocol (MCP) server that exposes Language Server Protocol (LSP) capabilities to AI assistants and other MCP clients.
Supports both:
- Embarcadero Delphi (
DelphiLSP.exe) - Free Pascal (
pasls.exe)
Target Specifications
- MCP Specification: 2025-11-25
- LSP Specification: 3.17
Features
- MCP ↔ LSP bridge using JSON-RPC 2.0
- stdio-based transport
- Dynamic workspace discovery
- Semantic code intelligence for AI agents
- Delphi and Free Pascal support
- Debugger synchronization support (
--wait) - Automatic project discovery (
.dpr/.lpr) - LSP retry logic and auto-document-open
- Compatible with:
- Claude Desktop
- Gemini-CLI
- Antigravity
- Other MCP-compatible clients
Supported Operations
- Go to Definition
- Find References
- Hover Information
- Code Completion
- Workspace Symbol Search
Project Information
| Item | Details |
|---|---|
| Author | Skybuck Flying |
| Contact | [email protected] |
| Version | 0.08 |
| Repository | https://github.com/SkybuckFlying/Delphi-LSP-MCP-Server |
Specifications
-
MCP Specification (2025-11-25)
https://modelcontextprotocol.io/specification/2025-11-25 -
Language Server Protocol Specification 3.17
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/
Requirements
- Windows OS
- Delphi 13 (RAD Studio 13.0+) or Free Pascal
DelphiLSP.exeorpasls.exe
Building
Delphi IDE
- Open
DelphiLSPMCPServer.dpr - Select Project → Build
Command Line
dcc64 DelphiLSPMCPServer.dpr
Usage
Command Line Options
DelphiLSPMCPServer [options]
Options:
--lsp-path Path to LSP executable
--workspace Workspace root or file:// URI
--log-level debug, info, warning, error
--debug Enable verbose diagnostics
--wait Wait for debugger before startup
--help Show help
Dynamic Workspace Discovery
Starting with v0.05, the server can automatically determine the active workspace.
Detection Strategy
-
MCP
initializerequest- Reads
rootUriorrootPath
- Reads
-
Current Working Directory fallback
-
Automatic
.dpr/.lprproject detection
This allows AI agents to switch projects dynamically without restarting the server configuration.
AI Optimization
The repository includes:
DelphiLSP.md
This file instructs AI agents to prioritize semantic tools such as:
hovergoto_definition
instead of relying on text-based searches.
Recommended GEMINI.md Setup
# Project Context
Refer to DelphiLSP.md for semantic code analysis instructions.
Use LSP semantic tools instead of grep/text searching whenever possible.
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"delphi-lsp": {
"command": "C:\\Tools\\DelphiLSPMCPServer.exe",
"args": [
"--log-level",
"info",
"--lsp-path",
"G:\\Tools\\PascalLanguageServer\\pasls.exe"
]
}
}
}