Skip to main content
Glama

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 document

    • Takes languageId, filePath, content, line, and character as required parameters

  • get_completions: Get completion suggestions for a position in a document

    • Takes languageId, filePath, content, line, and character as required parameters

  • get_diagnostics: Get diagnostic information for a document

    • Takes languageId, filePath, and content as required parameters

Related MCP server: VSCode LSP MCP Server

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Installation

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 inspector

The Inspector will provide a URL to access debugging tools in your browser.

Available Tools

3 tools
get_completionsC

Get completion suggestions for a position in a document

ParametersJSON Schema
NameRequiredDescriptionDefault
characterYesZero-based character offset for completion position
contentYesThe current content of the file
filePathYesAbsolute or relative path to the source file
languageIdYesThe language identifier (e.g., "typescript", "javascript")
lineYesZero-based line number for completion position
projectRootYesImportant: Root directory of the project for resolving imports and node_modules where the tsconfig.json or jsconfig.json is located

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
contentYesThe current content of the file
filePathYesAbsolute or relative path to the source file
languageIdYesThe language identifier (e.g., "typescript", "javascript")
projectRootYesImportant: Root directory of the project for resolving imports and node_modules where the tsconfig.json or jsconfig.json is located

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
characterYesZero-based character offset for hover position
contentYesThe current content of the file
filePathYesAbsolute or relative path to the source file
languageIdYesThe language identifier (e.g., "typescript", "javascript")
lineYesZero-based line number for hover position
projectRootYesImportant: Root directory of the project for resolving imports and node_modules where the tsconfig.json or jsconfig.json is located

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

  1. 3 tool updatesv1.0.0
    • First observedget_completions
    • First observedget_diagnostics
    • First observedget_hover

TDQS

B3.2/5.0

Scored across 3 tools

Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count3/5

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.

Completeness2/5

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

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An 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 npm
    46
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    A 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.
    40
    20 npm
    3
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    A 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 npm
    1
    MIT