Help us improve
Share bugs, ideas, or general feedback.
From lsp-setup
Set up Language Server Protocol (LSP) support in Claude Code. Use when the user asks to "set up LSP", "add language server", "enable LSP", "configure LSP for [language]", "add code intelligence for [language]", or mentions wanting go-to-definition, find-references, or hover in Claude Code.
npx claudepluginhub jucor/claude-code-lsp-skillHow this skill is triggered — by the user, by Claude, or both
Slash command
/lsp-setup:lsp-setupThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Set up Language Server Protocol (LSP) support in Claude Code for any programming language. Handles binary installation, plugin configuration, and building custom plugins for languages not yet in the official marketplace.
Guides integration of LSP servers into Claude Code plugins via plugin.json or .lsp.json for code intelligence like go-to-definition, references, hovers, and completions.
Installs and configures LSP servers for Claude Code to enable go-to-definition, find-references, rename-symbol, and real-time diagnostics in Python, TypeScript/JS, Go, Rust, Java, C#, PHP, Kotlin, Ruby, and more.
Recommends LSP servers by language, configures .lsp.json files, provides installation guides, and troubleshoots issues in Claude Code.
Share bugs, ideas, or general feedback.
Set up Language Server Protocol (LSP) support in Claude Code for any programming language. Handles binary installation, plugin configuration, and building custom plugins for languages not yet in the official marketplace.
Read ~/.claude/settings.json to check:
enabledPlugins — which LSP plugins are already enabledenv.ENABLE_LSP_TOOL — whether the LSP tool is activatedList installed plugins:
claude plugin list
Check which LSP binaries are already on PATH:
which pyright-langserver typescript-language-server clojure-lsp gopls rust-analyzer lua-language-server 2>/dev/null
Identify the target language from $ARGUMENTS. If none specified, ask the user.
Search the official marketplace:
claude plugin search [language]-lsp
If a plugin exists, skip to Phase 4 (install and enable).
Each language server has a preferred installation method. Use the best tool for the platform:
| Language | Binary | Install command (macOS) | Install command (Linux) |
|---|---|---|---|
| Python | pyright-langserver | uv tool install pyright (preferred) or npm i -g pyright | same |
| TypeScript/JS | typescript-language-server | npm i -g typescript-language-server typescript | same |
| Clojure | clojure-lsp | brew install clojure-lsp/brew/clojure-lsp-native | download from GitHub releases |
| Go | gopls | go install golang.org/x/tools/gopls@latest | same |
| Rust | rust-analyzer | brew install rust-analyzer or rustup component add rust-analyzer | same |
| Lua | lua-language-server | brew install lua-language-server | download from GitHub releases |
| C/C++ | clangd | brew install llvm | apt install clangd |
| C# | OmniSharp | dotnet tool install -g csharp-ls | same |
| Java | jdtls | brew install jdtls | download from eclipse.org |
| PHP | phpactor | composer global require phpactor/phpactor | same |
| Kotlin | kotlin-language-server | brew install kotlin-language-server | download from GitHub releases |
| Swift | sourcekit-lsp | Included with Xcode | N/A |
Important notes:
uv tool install pyright over npm i -g pyright — it installs in an isolated venv and symlinks to ~/.local/bin/, avoiding npm permission issues.which <binary-name># Install the plugin
claude plugin install <language>-lsp
# If not in official marketplace, install from a custom marketplace or repo:
# claude plugin marketplace add https://github.com/<user>/<marketplace-repo>.git
# claude plugin install <language>-lsp
Then update ~/.claude/settings.json:
Ensure ENABLE_LSP_TOOL is set:
{
"env": {
"ENABLE_LSP_TOOL": "1"
}
}
Enable the plugin:
{
"enabledPlugins": {
"<language>-lsp@claude-plugins-official": true
}
}
If no official plugin exists for the target language, build one.
<language>-lsp-plugin/
├── .claude-plugin/
│ └── plugin.json
└── README.md
The key is the lspServers field in plugin.json:
{
"name": "<language>-lsp",
"version": "1.0.0",
"description": "<Language> language server for code intelligence in Claude Code",
"author": {
"name": "<author>"
},
"license": "MIT",
"lspServers": {
"<server-name>": {
"command": "<binary-name>",
"args": ["--stdio"],
"extensionToLanguage": {
".<ext1>": "<language-id>",
".<ext2>": "<language-id>"
},
"startupTimeout": 120000
}
}
}
Reference — official plugins use these language IDs:
"python" (extensions: .py, .pyi)"typescript" / "typescriptreact" (extensions: .ts, .tsx)"javascript" / "javascriptreact" (extensions: .js, .jsx)"clojure" / "clojurescript" (extensions: .clj, .cljs, .cljc, .edn)"go" (extensions: .go)"rust" (extensions: .rs)"lua" (extensions: .lua)Use the language identifiers from the LSP specification: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentItem
To make the plugin installable via claude plugin install:
anthropics/claude-plugins-official if not already doneplugins/<language>-lsp/.claude-plugin/marketplace.json:{
"name": "<language>-lsp",
"description": "<Language> language server for code intelligence",
"version": "1.0.0",
"author": { "name": "<author>" },
"source": "./plugins/<language>-lsp",
"category": "development",
"strict": false,
"lspServers": {
"<server-name>": {
"command": "<binary>",
"args": ["--stdio"],
"extensionToLanguage": {
".<ext>": "<language-id>"
}
}
}
}
claude plugin marketplace add https://github.com/<user>/claude-plugins-official.git#<branch>
claude plugin install <language>-lsp
Submit standalone plugin repo at:
Note: PRs to anthropics/claude-plugins-official are NOT the right way to publish — use the submission form.
# In Claude Code, use the LSP tool:
LSP goToDefinition <file>:<line>:<col>
LSP hover <file>:<line>:<col>
LSP findReferences <file>:<line>:<col>
ENABLE_LSP_TOOL=1 is in settings.json under envwhich <binary> — the binary must be on PATH in Claude Code's shell"startupTimeout": 120000 or higherclaude plugin marketplace add <url>#<branch>