Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

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?

Important

Requires Claude Code 2.0.74+

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
dart-analyzer Dart/Flutter Dart SDK

Getting Started

1. Add the Marketplace

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

2. 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
/plugin install dart-analyzer@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
Dart/Flutter (dart-analyzer)

Install Dart SDK:

brew tap dart-lang/dart
brew install dart

Or install Flutter (includes Dart):

# See https://docs.flutter.dev/get-started/install

Ensure dart is in your PATH.


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",
    "extensionToLanguage": {
      ".ext": "language-id"
    }
  }
}

Required Fields

Field Type Description
command string Command to start the LSP server
extensionToLanguage object Maps file extensions to language IDs

Optional Fields

Field Type Description
args string[] Arguments passed to the command
transport string Communication method: "stdio" (default) or "socket"
env object Environment variables to set when starting the server
initializationOptions object Options passed during LSP initialization
settings object Server-specific settings via workspace/didChangeConfiguration
workspaceFolder string Workspace folder path for the server
startupTimeout number Max time to wait for server startup (milliseconds)
shutdownTimeout number Max time to wait for graceful shutdown (milliseconds)
restartOnCrash boolean Whether to automatically restart the server if it crashes
maxRestarts number Max restart attempts before giving up (default: 3)
loggingConfig object Debug logging configuration (see Debug Logging)
Example: gopls

.lsp.json:

{
  "go": {
    "command": "gopls",
    "extensionToLanguage": {
      ".go": "go"
    }
  }
}

.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
          }
        ]
      }
    ]
  }
}

Debug Logging

Enable verbose LSP logging by running Claude Code with --enable-lsp-logging:

claude --enable-lsp-logging

Logs are written to ~/.claude/debug/.

Plugins with logging pre-configured:

Plugin Method
gopls -rpc.trace + logfile
clangd --log=verbose
omnisharp -v verbose flag
rust-analyzer RA_LOG + RA_LOG_FILE env
solargraph SOLARGRAPH_LOG env
dart-analyzer --instrumentation-log-file

Not supported (use LSP trace settings instead): vtsls, pyright, jdtls, intelephense, kotlin-language-server, vscode-html-css

License

MIT

Contributors 2

  •  
  •  

Languages