language-server-mcp
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 作为必需参数
Related MCP server: VSCode LSP MCP Server
发展
安装依赖项:
npm install构建服务器:
npm run build对于使用自动重建的开发:
npm run watch安装
要与 Claude Desktop 一起使用,请添加服务器配置:
在 MacOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"language-server-mcp": {
"command": "/path/to/language-server-mcp/build/index.js"
}
}
}调试
由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们推荐使用MCP Inspector ,它以包脚本的形式提供:
npm run inspector检查器将提供一个 URL 来访问浏览器中的调试工具。
Available Tools
3 toolsget_completionsC
Get completion suggestions for a position in a document
Inputs: character (required), content (required), filePath (required), languageId (required), +2 more.
get_diagnosticsC
Get diagnostic information for a document
Inputs: content (required), filePath (required), languageId (required), projectRoot (required).
get_hoverC
Get hover information for a position in a document
Inputs: character (required), content (required), filePath (required), languageId (required), +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: get_completions provides suggestions, get_diagnostics provides error/warning information, and get_hover provides documentation. There is no overlap or ambiguity between these three core language server operations.
All tools follow a consistent verb_noun pattern with 'get_' prefix and descriptive nouns (completions, diagnostics, hover). The naming is perfectly uniform and predictable throughout the set.
With only 3 tools, the server feels somewhat thin for a language server domain. While these cover fundamental operations, typical language servers would include more capabilities like formatting, references, definitions, or rename operations. The count is borderline minimal.
The tool surface is significantly incomplete for a language server. Missing are essential operations like formatting, finding references, getting definitions, renaming symbols, and code actions. Agents will encounter dead ends when trying to perform common language server tasks beyond the three provided.
Related MCP Connectors
The official Svelte MCP server providing docs and autofixing tools for Svelte development
A TypeScript MCP server for Home Assistant, enabling programmatic management of entities, automati…
A simple Typescript MCP server built using the official MCP Typescript SDK and smithery/cli. This…
A MCP server built for developers enabling Git based project management with project and personal…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables LLMs to understand and work with TypeScript APIs they haven't been trained on by providing structured access to TypeScript type definitions and documentation.46MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server that exposes Language Server Protocol features to external clients, allowing access to hover information, definitions, completions, references, and rename functionalities.43MIT
- AlicenseAqualityDmaintenanceA lightweight MCP server that provides 40 tools for TypeScript/JavaScript refactoring and code intelligence, directly mapping to TypeScript's tsserver protocol commands for accurate structural changes and workspace analysis.4029 npm3MIT
- AlicenseNot gradedqualityDmaintenanceA standalone MCP server that provides TypeScript type inference and hover information using tsgo, enabling AI agents to get type details, diagnostics, references, and more without needing an editor.1MIT