Claude Code LSPs
This repository contains a Claude Code marketplace with plugins that offer LSP servers for TypeScript, Rust, X, Y, Z. LSP servers provide powerful and familiar code intelligence features to IDEs, and now Claude Code directly.
Claude Code is going to officially support LSP soon. In 2.0.30 (October 31st) they adding the working beginnings of a system to run LSP servers from plugins automatically on startup, and an LSP tool (enable via $ENABLE_LSP_TOOL=1) that Claude can use to
- Go to the definition for symbols (
goToDefinition)
- Hover over symbols (
hover)
- List all the symbols in a file (
documentSymbol)
- Find all references to a symbol (
findReferences)
- Search for symbols across the workspace (
workspaceSymbol)
[!warning]
Support for LSP in Claude Code is pretty raw still. There are bugs in the different LSP operations, no documention, and no UI indication that your LSP servers are started/running/have errors or even exist. But it's there, and with tweakcc you can make it work.
Patching Claude Code
You can manually patch it, but it's much easier to use tweakcc to automatically detect your Claude Code installation (npm or native) apply the necessary patches.
Run npx tweakcc --apply. It will automatically patch your Claude Code installation to make LSP support usable. (It also does a bunch of other things like let you customize all the system prompt parts, create new CC themes, change the thinking verbs, and a lot more.)
If you'd like to apply the patches yourself, go the bottom of this page.
Installing the plugins
Install them the usual way. First make CC aware of the marketplace:
- Run
claude
/plugin marketplace add Piebald-AI/claude-code-lsps
Then enable the plugins of your choice:
- Run
claude
- Type
/plugins
- Choose
Browse and install plugins
- Enter the
Claude Code Language Servers marketplace
- Select the plugins you'd like with the spacebar (e.g. TypeScript, Rust)
- Press "i" to install them
- Restart Claude Code
Here's a screenshot:
Language-specific setup instructions
You need to install various components in order for the plugins to use them:
Rust (rust-analyzer)
Uses rust-analyzer, the official modern Rust Language Server and the same one used by the official VS Code extension. If you have rustup, installing rust-analyzer is easy:
rustup component add rust-analyzer
The rust-analyzer executable needs to be in your PATH.
JavaScript/TypeScript (typescript-language-server)
Install the typescript-language-server and typescript packages globally:
# npm
npm install -g typescript-language-server typescript
# pnpm
pnpm install -g typescript-language-server typescript
# bun
bun install -g typescript-language-server typescript
Make sure the typescript-language-server executable is in your PATH.
Python (pyright)
Install pyright for its speed and excellent type checking:
# npm
npm install -g pyright
# pnpm
pnpm install -g pyright
# bun
bun install -g pyright
Go (gopls)
Install gopls, the official Go language server:
go install golang.org/x/tools/gopls@latest
Make sure your Go bin directory is in your PATH (usually ~/go/bin).
Java (jdtls)
Install Eclipse JDT Language Server (jdtls). Requires Java 21+ runtime:
# Download from official sources
# Latest snapshot:
curl -LO http://download.eclipse.org/jdtls/snapshots/jdt-language-server-latest.tar.gz
mkdir -p ~/jdtls
tar -xzf jdt-language-server-latest.tar.gz -C ~/jdtls
# Or install via package manager (varies by OS)
# macOS with Homebrew:
brew install jdtls
Set JAVA_HOME environment variable to Java 21+ installation.
C/C++ (clangd)
Install clangd, the official LLVM-based language server:
# macOS
brew install llvm
# Ubuntu/Debian
sudo apt-get install clangd
# Arch Linux
sudo pacman -S clang
# Or download from LLVM releases
# https://github.com/clangd/clangd/releases
PHP (phpactor)
Install Phpactor:
# Using composer (recommended)
composer global require phpactor/phpactor
# Or using package manager
# macOS with Homebrew:
brew install phpactor/tap/phpactor
Ensure ~/.composer/vendor/bin (or ~/.config/composer/vendor/bin on some systems) is in your PATH.
Ruby (ruby-lsp)