Skip to content

LSP plugins for Claude Code — Go, TypeScript, Python, Java, C/C++, C#, PHP, Kotlin, Rust, Ruby, HTML/CSS

License

Notifications You must be signed in to change notification settings

boostvolt/claude-code-lsps

Repository files navigation

Claude Code LSPs

A collection of Language Server Protocol (LSP) plugins for Claude Code.

LSP Demo

What is LSP Integration?

The Language Server Protocol provides IDE-like intelligence to Claude Code. On startup, Claude Code automatically starts LSP servers from installed plugins and exposes them to Claude in two ways:

LSP Tool - A builtin tool with 5 operations mapping directly to LSP commands:

  • goToDefinition - Jump to where a symbol is defined
  • findReferences - Find all usages of a symbol
  • hover - Get documentation and type info
  • documentSymbol - List all symbols in a file
  • workspaceSymbol - Search symbols across the project

Automatic Diagnostics - Real-time error and warning detection similar to the VS Code integration, but operating independently. These diagnostics tend to be faster and more comprehensive than the VS Code equivalent.

Available Plugins

Plugin Language LSP
gopls Go gopls
vtsls TypeScript/JavaScript vtsls
pyright Python pyright
jdtls Java jdtls
clangd C/C++ clangd
omnisharp C# OmniSharp
intelephense PHP Intelephense
kotlin-language-server Kotlin kotlin-language-server
rust-analyzer Rust rust-analyzer
solargraph Ruby Solargraph
vscode-html-css HTML/CSS vscode-langservers

Getting Started

1. Enable the LSP Tool

The LSP tool is not yet enabled by default. Add to your shell profile (.bashrc, .zshrc, etc.):

export ENABLE_LSP_TOOL=1

Or run with the environment variable:

ENABLE_LSP_TOOL=1 claude

2. Add the Marketplace

claude
/plugin marketplace add boostvolt/claude-code-lsps

3. Install Plugins

Install individual plugins:

/plugin install gopls@claude-code-lsps
/plugin install vtsls@claude-code-lsps
/plugin install pyright@claude-code-lsps
/plugin install jdtls@claude-code-lsps
/plugin install clangd@claude-code-lsps
/plugin install omnisharp@claude-code-lsps
/plugin install intelephense@claude-code-lsps
/plugin install kotlin-language-server@claude-code-lsps
/plugin install rust-analyzer@claude-code-lsps
/plugin install solargraph@claude-code-lsps
/plugin install vscode-html-css@claude-code-lsps

Or browse and install interactively:

/plugin

Manual LSP Installation

Each plugin will attempt to auto-install its LSP server on first use. If auto-install fails, use the manual instructions below.

Go (gopls)
go install golang.org/x/tools/gopls@latest

Ensure ~/go/bin is in your PATH.

TypeScript/JavaScript (vtsls)
npm install -g @vtsls/language-server typescript
Python (pyright)
pip install pyright
Java (jdtls)
brew install jdtls

Or download manually from Eclipse JDT Language Server.

Requires Java 21+ runtime.

C/C++ (clangd)
brew install llvm

Or via Xcode Command Line Tools:

xcode-select --install
C# (omnisharp)
brew install omnisharp/omnisharp-roslyn/omnisharp-mono

Or via dotnet:

dotnet tool install -g csharp-ls
PHP (intelephense)
npm install -g intelephense
Kotlin (kotlin-language-server)
brew install kotlin-language-server
Rust (rust-analyzer)
brew install rust-analyzer

Or via rustup:

rustup component add rust-analyzer
Ruby (solargraph)
gem install solargraph
HTML/CSS (vscode-html-css)
npm install -g vscode-langservers-extracted

Creating Your Own Plugin

Plugin Structure
my-lsp/
├── .claude-plugin/
│   └── plugin.json
├── .lsp.json
└── hooks/
    ├── hooks.json
    └── check-my-lsp.sh
.lsp.json Schema

The .lsp.json file configures the language server:

{
  "language-id": {
    "command": "lsp-server-command",
    "args": ["--stdio"],
    "extensionToLanguage": {
      ".ext": "language-id"
    },
    "transport": "stdio",
    "initializationOptions": {},
    "settings": {},
    "maxRestarts": 3
  }
}
Field Type Required Description
command string Yes Command to start the LSP server
args string[] No Arguments passed to the command
extensionToLanguage object Yes Maps file extensions to language IDs
transport string No Communication method: "stdio" (default) or "socket"
initializationOptions object No Options passed during LSP initialization
settings object No Server-specific settings
maxRestarts number No Max restart attempts on crash (default: 3)
Example: gopls

.lsp.json:

{
  "go": {
    "command": "gopls",
    "args": [],
    "extensionToLanguage": {
      ".go": "go"
    },
    "transport": "stdio",
    "initializationOptions": {},
    "settings": {},
    "maxRestarts": 3
  }
}

.claude-plugin/plugin.json:

{
  "name": "gopls",
  "description": "Go language server",
  "version": "1.0.0",
  "author": {
    "name": "Your Name"
  }
}

hooks/hooks.json (optional auto-install):

{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/check-gopls.sh",
            "timeout": 30
          }
        ]
      }
    ]
  }
}

License

MIT

Languages