LSP - MCP 服务器是一个支持多语言的开发平台,它整合了 Language Server Protocol (LSP) 和 Model Context Protocol (MCP),为开发者提供强大的代码管理和智能提示功能,极大提升开发效率。
LSP - MCP 服务器通过整合 LSP 和 MCP,为开发者打造了强大的代码管理与智能提示功能。下面将详细介绍其安装、运行及使用的相关内容。
npx tritlo/lsp-mcp
其中 是目标语言(如 haskell), 是 LSP 实现的可执行文件路径, 是 MCP 服务的网络地址。npx tritlo/lsp-mcp haskell /path/to/haskell-language-server-wrapper lsp
lsp-mcp-tool get-diagnostics --file /path/to/file
lsp-mcp-tool subscribe resource/lsp-diagnostics://
lsp-mcp-tool info-on-location --file /path/to/file --line 42 --column 10 --language_id haskell
lsp-mcp-tool get-completions --file /path/to/file --line 42 --column 10 --language_id haskell
lsp-diagnostics://
lsp-diagnostics:///path/to/file
lsp-hover:///path/to/file?line={line}&column={column}&language_id={language_id}
lsp-completions:///path/to/file?line={line}&column={column}&language_id={language_id}
resources/list 端点。resources/subscribe 端点。lsp-mcp-plugin create my_plugin
lsp-mcp-plugin register ./my_plugin
LanguageAdapter 接口。lsp-mcp-adapter register MyAdapter
lsp-mcp-server --debug > debug.log 2>&1
config.json 中的参数设置无误。LSP - MCP 服务器遵循 MIT 许可证,允许用户自由使用、修改和分发代码。具体许可内容请参考项目仓库中的 LICENSE 文件。
LSP - MCP 服务器凭借其强大功能和灵活的扩展机制,为开发者提供了高效、智能的代码管理环境。无论是诊断工具、悬浮提示还是代码补全功能,都能显著提升开发效率。