LSP-MCP
Bridges a Roslyn C# language server to AI agents via the GitHub Copilot CLI, enabling code intelligence tools such as diagnostics, call hierarchy, and type hierarchy queries.
Click on "Install 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., "@LSP-MCPfind callers of the Main method in Program.cs"
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.
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 |
| Compilation errors for a file (or all open files) |
| Warnings for a file |
| Info/hint diagnostics (style rules, analyzers) |
| 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
Reads
.github/lsp.jsonto find the LSP server commandSpawns the language server with
--stdioand performs the LSP initialize handshakeOn tool call: opens the file, pulls diagnostics via
textDocument/diagnostic, filters by severityFalls back to push diagnostics (
publishDiagnostics) if pull returns emptyReturns concise JSON with line, column, severity, message, and diagnostic code
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
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