local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
Theoretically provides language support for Python code editing, though it has only been tested with TypeScript.
Provides language support for TypeScript code editing with features like hover information, code completion, and diagnostics.
language-server-mcp MCP 服务器
模型上下文协议 (MCP) 服务器为代码编辑提供语言支持。
这是一个基于 TypeScript 的 MCP 服务器,旨在通过提供悬停信息、代码补全和诊断等功能来增强代码编辑体验。它通过提供以下功能演示了核心 MCP 概念:
- 用于代码分析和操作的特定语言工具
- 与模型上下文协议集成,实现无缝通信
特征
语言支持
- 提供代码中符号的悬停信息
- 提供代码完成建议
- 报告诊断信息(错误、警告)
- 仅使用 TypeScript 测试,理论上应该支持 Python。如果可能的话,希望能添加其他语言服务器,或者提供更多语言无关性。
MCP 集成
- 实现 MCP 协议与客户端通信
- 将语言特性公开为 MCP 工具
工具
get_hover
:获取文档中某个位置的悬停信息- 将 languageId、filePath、内容、行和字符作为必需参数
get_completions
:获取文档中某个位置的完成建议- 将 languageId、filePath、content、line 和 character 作为必需参数
get_diagnostics
:获取文档的诊断信息- 将 languageId、filePath 和 content 作为必需参数
发展
安装依赖项:
构建服务器:
对于使用自动重建的开发:
安装
要与 Claude Desktop 一起使用,请添加服务器配置:
在 MacOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json
在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json
调试
由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们推荐使用MCP Inspector ,它以包脚本的形式提供:
检查器将提供一个 URL 来访问浏览器中的调试工具。
You must be authenticated.
基于 TypeScript 的 MCP 服务器旨在通过提供悬停信息、代码完成和诊断等功能来增强代码编辑体验。