language-server-mcp
The language-server-mcp is a TypeScript-based server that provides language support for code editing via the Model Context Protocol (MCP).
It offers three main capabilities:
Hover Information: Retrieve details for code symbols using
get_hoverCode Completion: Get suggestions at specific positions with
get_completionsDiagnostics: Fetch errors and warnings through
get_diagnostics
Each function requires parameters like languageId, filePath, content, and projectRoot. The server is primarily tested with TypeScript, with theoretical support for Python and potential for additional language 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.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@language-server-mcpget hover info for line 15 character 7 in my typescript file"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
language-server-mcp MCP Server
A Model Context Protocol (MCP) server providing language support for code editing.
This is a TypeScript-based MCP server designed to enhance code editing experiences by providing features such as hover information, code completion, and diagnostics. It demonstrates core MCP concepts by providing:
Language-specific tools for code analysis and manipulation
Integration with the Model Context Protocol for seamless communication
Features
Language Support
Provides hover information for symbols in code
Offers code completion suggestions
Reports diagnostic information (errors, warnings)
Only tested with typescript, theoretically should support Python. Would love to add additional language servers or be more agnostic if possible.
MCP Integration
Implements the MCP protocol for communication with clients
Exposes language features as MCP tools
Tools
get_hover: Get hover information for a position in a documentTakes languageId, filePath, content, line, and character as required parameters
get_completions: Get completion suggestions for a position in a documentTakes languageId, filePath, content, line, and character as required parameters
get_diagnostics: Get diagnostic information for a documentTakes languageId, filePath, and content as required parameters
Related MCP server: VSCode LSP MCP Server
Development
Install dependencies:
npm installBuild the server:
npm run buildFor development with auto-rebuild:
npm run watchInstallation
To use with Claude Desktop, add the server config:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"language-server-mcp": {
"command": "/path/to/language-server-mcp/build/index.js"
}
}
}Debugging
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
npm run inspectorThe Inspector will provide a URL to access debugging tools in your browser.
Available Tools
3 toolsget_completionsC
Get completion suggestions for a position in a document
| Name | Required | Description | Default |
|---|---|---|---|
| character | Yes | Zero-based character offset for completion position | |
| content | Yes | The current content of the file | |
| filePath | Yes | Absolute or relative path to the source file | |
| languageId | Yes | The language identifier (e.g., "typescript", "javascript") | |
| line | Yes | Zero-based line number for completion position | |
| projectRoot | Yes | Important: Root directory of the project for resolving imports and node_modules where the tsconfig.json or jsconfig.json is located |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure but provides minimal information. It mentions getting 'completion suggestions' but doesn't describe what format these suggestions come in, whether there are rate limits, authentication requirements, or any side effects. The description doesn't contradict annotations (since none exist), but it fails to provide the behavioral context needed for a tool with 6 required parameters.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized for the tool's complexity and front-loads the core purpose immediately. Every word earns its place in communicating the essential function.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 6 required parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what kind of completions are returned, in what format, or any behavioral characteristics. The agent would need to guess about the tool's behavior and output based solely on the parameter schema, which is inadequate for a tool of this complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description mentions 'for a position in a document' which hints at the line/character parameters, but provides no additional semantic context beyond what's already in the schema (which has 100% coverage). The schema descriptions already clearly explain each parameter's purpose, so the description adds minimal value. This meets the baseline of 3 for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Get' and resource 'completion suggestions' with the context 'for a position in a document', making the purpose immediately understandable. It distinguishes from sibling tools like get_diagnostics and get_hover by focusing specifically on completion suggestions rather than diagnostics or hover information. However, it doesn't specify what type of completions (e.g., code completions, text completions) or from what source.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. There are no explicit instructions about when this tool is appropriate, what prerequisites might be needed, or how it differs from other completion-related tools that might exist. The agent must infer usage purely from the tool name and parameter schema.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_diagnosticsC
Get diagnostic information for a document
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The current content of the file | |
| filePath | Yes | Absolute or relative path to the source file | |
| languageId | Yes | The language identifier (e.g., "typescript", "javascript") | |
| projectRoot | Yes | Important: Root directory of the project for resolving imports and node_modules where the tsconfig.json or jsconfig.json is located |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure but only states the basic action. It doesn't reveal whether this is a read-only operation, if it has side effects, performance characteristics, or what the output looks like (e.g., error messages, warnings). This leaves significant gaps for a tool with four required parameters.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, direct sentence with no wasted words, making it highly concise and front-loaded. It efficiently communicates the core purpose without unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of four required parameters and no annotations or output schema, the description is incomplete. It doesn't explain what 'diagnostic information' includes (e.g., errors, linting results) or provide context for parameter usage, leaving the agent with insufficient information to use the tool effectively beyond basic invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, clearly documenting all four parameters (content, filePath, languageId, projectRoot). The description adds no additional semantic context beyond the schema, such as how parameters interact or examples of valid values, so it meets the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get') and resource ('diagnostic information for a document'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_completions' or 'get_hover', which likely also operate on documents but provide different types of information.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'get_completions' or 'get_hover'. It lacks context about what 'diagnostic information' entails or scenarios where it's appropriate, offering no explicit or implied usage instructions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_hoverC
Get hover information for a position in a document
| Name | Required | Description | Default |
|---|---|---|---|
| character | Yes | Zero-based character offset for hover position | |
| content | Yes | The current content of the file | |
| filePath | Yes | Absolute or relative path to the source file | |
| languageId | Yes | The language identifier (e.g., "typescript", "javascript") | |
| line | Yes | Zero-based line number for hover position | |
| projectRoot | Yes | Important: Root directory of the project for resolving imports and node_modules where the tsconfig.json or jsconfig.json is located |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe behavioral traits like whether it's read-only, what the output format might be, potential errors, or performance characteristics. For a tool with 6 required parameters and no annotations, this leaves significant gaps in understanding how the tool behaves.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that states the purpose clearly without unnecessary words. It's appropriately sized and front-loaded with the essential information. Every word earns its place in this concise formulation.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (6 required parameters, no annotations, no output schema), the description is insufficiently complete. It doesn't explain what 'hover information' entails, what format the response might have, or any behavioral aspects. For a tool that likely returns structured data about code elements at a specific position, more context about the expected output would be helpful.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all 6 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Get') and resource ('hover information') with specific context ('for a position in a document'). It distinguishes from sibling tools like 'get_completions' and 'get_diagnostics' by focusing on hover functionality rather than completions or diagnostics. However, it doesn't explicitly differentiate from siblings beyond the inherent difference in purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description doesn't mention sibling tools, prerequisites, or specific contexts for invocation. It lacks explicit instructions on when this tool is appropriate compared to other tools in the server.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v1.0.0- First observed
get_completions - First observed
get_diagnostics - First observed
get_hover
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.
Maintenance
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.11 npm46MIT
- AlicenseNot gradedqualityAmaintenanceAn MCP server that exposes Language Server Protocol features to external clients, allowing access to hover information, definitions, completions, references, and rename functionalities.4 npm40MIT
- 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.4020 npm3MIT
- AlicenseNot gradedqualityBmaintenanceA 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.7 npm1MIT