LspSAFE
An MCP server that lets you interact with LSP servers
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
An MCP (Model Context Protocol) server for interacting with LSP (Language Server Protocol) interface. This server acts as a bridge that allows LLMs to query LSP Hover and Completion providers.
Overview
The MCP Server works by:
- Starting an LSP client that connects to a LSP server
- Exposing MCP tools that send requests to the LSP server
- Returning the results in a format that LLMs can understand and use
This enables LLMs to utilize LSPs for more accurate code suggestions.
Configuration:
{
"mcpServers": {
"lsp-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"tritlo/lsp-mcp",
"",
"",
""
]
}
}
}Features
MCP Tools
get_info_on_location: Get hover information at a specific location in a fileget_completions: Get completion suggestions at a specific location in a fileget_code_actions: Get code actions for a specific range in a fileopen_document: Open a file in the LSP server for analysisclose_document: Close a file in the LSP serverget_diagnostics: Get diagnostic messages (errors, warnings) for open filesstart_lsp: Start the LSP server with a specified root directoryrestart_lsp_server: Restart the LSP server without restarting the MCP serverset_log_level: Change the server's logging verbosity level at runtime
MCP Resources
lsp-diagnostics://resources for accessing diagnostic messages with real-time updates via subscriptionslsp-hover://resources for retrieving hover information at specific file locationslsp-completions://resources for getting code completion suggestions at specific positions
Additional Features
- Comprehensive logging system with multiple severity levels
- Colorized console output for better readability
- Runtime-configurable log level
- Detailed error handling and reporting
- Simple command-line interface
Prerequisites
03d146c16c7cOBSERVED · 2026-10-07Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add lsp-mcp-server -- npx -y [email protected]
{
"mcpServers": {
"lsp-mcp-server": {
"command": "npx",
"args": [
"-y",
"[email protected]"
]
}
}
}Exposed tools (6)
4 read · 1 write · 1 destructive. Blast radius: 1 tool can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.
| Tool | Risk | Description |
|---|---|---|
close_document | read | Close a file in the LSP server. Use this tool when you |
get_code_actions | read | Get code actions for a specific range in a file. Use this tool to obtain available refactorings, quick fixes, and other code modifications that can be applied to a selected code range. Examples include adding imports, fixing errors, or implementing interfaces. Requires the file to be opened first. |
get_diagnostics | read | Get diagnostic messages (errors, warnings) for files. Use this tool to identify problems in code files such as syntax errors, type mismatches, or other issues detected by the language server. When used without a file_path, returns diagnostics for all open files. Requires files to be opened first. |
restart_lsp_server | destructive | Restart the LSP server process. Use this tool to reset the LSP server if it becomes unresponsive, has stale data, or when you need to apply configuration changes. Can optionally reinitialize with a new root directory. Useful for troubleshooting language server issues or when switching projects. |
start_lsp | write | Start the LSP server with a specified root directory. IMPORTANT: This tool must be called before using any other LSP functionality. The root directory should point to the project |
typed-hole-use | read | Guide on using typed-holes in Haskell to explore type information and function possibilities |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | WARN |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (1 observation(s))
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (2)
restart_lsp_server
@modelcontextprotocol/sdk, zod, zod-to-json-schema, @types/node, typescript, typescript-language-server
Gates applied: no_behavioural_pass.
03d146c16c7cfull audit observations/trust-audit/mcp-server/tritlo__lsp.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-07 | 03d146c16c7c | SAFE | B | 89 | first audit |
Questions
What is the Lsp MCP server?
An MCP server that lets you interact with LSP servers
What tools does Lsp expose?
6 in total: 4 read-only, 1 that write, and 1 that can delete or overwrite (restart_lsp_server). Every one is listed on this page with its risk.
Is Lsp safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B. Separately from the audit: 1 of its tools can destroy data, so scope the token you give it to what you actually need.
What credentials does Lsp need?
No credential environment variables were found in its source, so it appears to need none.
How does Lsp run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as lsp-mcp-server at 0.2.0.
How current is this page?
The grade is for one exact copy of the source (03d146c16c7c), read on 2026-10-07. The repository is watched and re-audited when it changes.