The `lsp-mcp-server` package acts as a crucial intermediary, bridging the gap between AI models like Claude Code (using the Model Context Protocol, MCP) and existing Language Server Protocol (LSP) servers. This enables powerful semantic code intelligence features within AI-powered development environments, including go-to-definition, find references, code completion, diagnostics, and safe renames across 10 different programming languages such as TypeScript/JavaScript, Python, Rust, Go, and Java. It supports multi-root workspaces for monorepos, provides push-based diagnostics, and features automatic language server management. The current stable version is 1.1.15, indicating active development and maintenance. Its key differentiator is providing a robust, configurable, and secure integration layer for AI agents to leverage the rich capabilities of established LSP ecosystems without directly reimplementing language-specific intelligence.
npm install lsp-mcp-serverVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to programmatically import and conceptually interact with `lsp-mcp-server` functions, although its primary usage is as a CLI tool. It highlights the `startServer` function and explains that the server is typically launched as a separate process configured by an MCP client like Claude Code.
Ensure your Node.js environment is updated to version 18.0.0 or later. Use `node -v` to check your current version and `nvm install 18 && nvm use 18` or similar tools to upgrade.
Refer to the 'Prerequisites' section in the `lsp-mcp-server` README for specific installation instructions for each language server you intend to use. Verify their presence by running their respective command (e.g., `tsserver --version`, `pylsp --help`).
Update your `.mcp.json` configuration (e.g., `~/.mcp.json`) to use absolute paths for the `command` and the `lsp-mcp-server` script argument. For example: `"command": "/usr/bin/node", "args": ["/absolute/path/to/lsp-mcp-server/dist/index.js", "--stdio"]`.
Review the `languageServers` section of your `lsp-mcp-server` configuration. Ensure the `command` and `args` for each language are correct and match the installed language server. Check the `lsp-mcp-server` logs for specific errors when a language server fails to start.
If encountering issues with large files or files outside the expected workspace, consider adjusting the `fileSizeLimit` and `validateWorkspaceBoundaries` settings in your `lsp-mcp-server` configuration, or ensure files are properly within the project's defined workspace root. Exercise caution when modifying security settings.
Install the `typescript-language-server` globally: `npm install -g typescript-language-server typescript`. For other languages, install their respective language servers as per the `lsp-mcp-server` documentation.
Ensure the directory where the server tries to create its socket (often `/tmp` or a configured `socketDir`) has appropriate write permissions for the user running `lsp-mcp-server`. Alternatively, configure a `socketDir` in a user-writable location in your `lsp-mcp-server` configuration.
Add the configuration for 'mylang' to your `lsp-mcp-server` configuration, specifying the command and arguments for its corresponding language server. Ensure the language server itself is installed and functional.
Update the `command` property in your `~/.mcp.json` or project-level `.mcp.json` to use an absolute path, e.g., `"command": "/usr/bin/node"` or `"command": "/home/user/.nvm/versions/node/v18.17.1/bin/node"`.
No dependency data recorded yet.