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
Available Tools
1 toollsp_statusA
Get LSP server status: initialization state, open documents, diagnostics cache.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
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.
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.
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.
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.
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.
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 tool update
v0.2.0- First observed
lsp_status
TDQS
With only one tool, there is no possibility of confusion between tools. The tool's purpose is clear and singular.
The single tool name 'lsp_status' follows a consistent verb_noun pattern, which is clear and predictable.
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.
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
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
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Lean 4 MCP server: compile, prove theorems, and formalize math with Mathlib.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server to expose VS Code editing features to an LLM for AI coding998391MIT
- AlicenseAqualityAmaintenanceA 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.6232MIT
- AlicenseAqualityBmaintenanceMCP server that lets AI agents (Claude, Cursor) debug your .NET / ASP.NET Core app2714MIT
- AlicenseNot gradedqualityAmaintenanceLocal-first MCP server for semantic C# analysis, navigation, validation, and refactoring using Roslyn on real .NET workspaces.1MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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