Skip to main content
Glama

LSP-MCP

Minimal MCP server that bridges any Language Server Protocol (LSP) server to AI agents (e.g. GitHub Copilot CLI). Exposes diagnostics (errors, warnings, info) as lightweight tool calls.

Tools

Tools are generated per server entry, prefixed by the config key:

Tool pattern

Description

{prefix}_get_errors

Compilation errors for a file (or all open files)

{prefix}_get_warnings

Warnings for a file

{prefix}_get_info

Info/hint diagnostics (style rules, analyzers)

lsp_status

All LSP servers' state for debugging

Example with "cs" prefix: cs_get_errors, cs_get_warnings, cs_get_info

Related MCP server: sharplens-mcp

Setup

pip install -e .

Configuration

Create .github/lsp.json in your workspace root. Each key is the tool prefix — keep it short:

{
  "lspServers": {
    "cs": {
      "command": "path/to/Microsoft.CodeAnalysis.LanguageServer.exe",
      "args": ["--stdio", "--autoLoadProjects"],
      "fileExtensions": {".cs": "csharp"}
    }
  }
}

Multiple servers generate prefixed tools automatically:

{
  "lspServers": {
    "cs": { "command": "...", "args": [...], "fileExtensions": {".cs": "csharp"} },
    "py": { "command": "pyright-langserver", "args": ["--stdio"], "fileExtensions": {".py": "python"} }
  }
}

This exposes: cs_get_errors, cs_get_warnings, py_get_errors, py_get_warnings, etc.

The fileExtensions map tells the server which languageId to send in textDocument/didOpen. Common extensions (.py, .ts, .go, .rs, etc.) are detected automatically if omitted.

Usage with Copilot CLI

Add to ~/.copilot/mcp-config.json:

{
  "mcpServers": {
    "lsp": {
      "type": "stdio",
      "command": "python",
      "args": ["-m", "lsp_mcp", "--workspace", "/path/to/your/project"]
    }
  }
}

CLI Options

lsp-mcp [--workspace PATH]
  • --workspace, -w: Workspace root containing .github/lsp.json (defaults to cwd)

How It Works

  1. Reads .github/lsp.json to find the LSP server command

  2. Spawns the language server with --stdio and performs the LSP initialize handshake

  3. On tool call: opens the file, pulls diagnostics via textDocument/diagnostic, filters by severity

  4. Falls back to push diagnostics (publishDiagnostics) if pull returns empty

  5. Returns concise JSON with line, column, severity, message, and diagnostic code

Available Tools

1 tool
lsp_statusA

Get LSP server status: initialization state, open documents, diagnostics cache.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden. It discloses the returned data (initialization state, open documents, diagnostics cache) but does not mention side effects, permissions, or whether it requires an active connection. The read-only nature is implied but not explicit.

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 sentence with no filler words. It front-loads the purpose and lists key outputs efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity (no parameters, no output schema, no sibling tools), the description is mostly complete. It could optionally mention that the tool is read-only or requires a server connection, but it covers the essentials.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are no parameters, so the baseline is 4. The description does not need to add parameter meaning. It appropriately focuses on the tool's action and output.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/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 the resource 'LSP server status', listing specific components: initialization state, open documents, diagnostics cache. With no sibling tools, differentiation is not needed.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for checking status, but provides no explicit guidance on when to use it versus alternatives. Since there are no sibling tools, the lack of exclusions is acceptable but still leaves room for improvement.

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. Dates show when Glama detected each change.

  1. 1 tool updatev0.2.0
    • First observedlsp_status

TDQS

A3.8/5.0
Disambiguation5/5

With only one tool, there is no possibility of confusion between tools. The tool's purpose is clear and singular.

Naming Consistency5/5

The single tool name 'lsp_status' follows a consistent verb_noun pattern, which is clear and predictable.

Tool Count2/5

The server's name suggests broader LSP interaction capabilities, but it exposes only a single tool for status. This is too few tools for the implied scope, limiting its usefulness.

Completeness1/5

The server only provides a status check, lacking essential LSP operations like initialization, document management, or diagnostics retrieval. The tool surface is severely incomplete for any real LSP interaction.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/morrow-addref/LSP-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server