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: ASPNET Core Debugging MCP Server

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

Install Server
F
license - not found
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    A Model Context Protocol (MCP) server providing 62 AI-optimized tools for .NET/C# semantic code analysis, navigation, refactoring, and code generation using Microsoft Roslyn. Built for AI coding agents - provides compiler-accurate code understanding that AI cannot infer from reading source files alone.
    62
    31
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to interact with VS Code's language server protocol features (definitions, references, diagnostics) and debugger (breakpoints, stepping, variable inspection) via an MCP server.
    20
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

  • MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

View all MCP Connectors

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