Enable LSP tool to connect to installed language servers
Open 💬 17 comments Opened Dec 28, 2025 by cosmicflow-space
Feature Request
The Claude Code CLI has an LSP tool (LSP with operations like goToDefinition, findReferences, hover, etc.), but it currently returns "No LSP server available for file type" even when language servers are installed globally.
Current Behavior
LSP tool call: goToDefinition on .ts file
Result: "No LSP server available for file type: .ts"
This occurs even with typescript-language-server and pyright installed globally via npm.
Requested Behavior
The LSP tool should:
- Auto-discover installed language servers (typescript-language-server, pyright, gopls, etc.)
- Or allow configuration in ~/.claude/settings.json to specify server paths
- Enable faster, type-aware code navigation vs. grep-based searches
Use Case
When working on large codebases, LSP provides:
- Precise "Go to Definition" (not just text matching)
- Type-aware "Find References"
- Hover documentation
- Call hierarchy analysis
This would significantly speed up code exploration tasks.
Environment
- Claude Code CLI (latest)
- macOS with globally installed: typescript-language-server, pyright
- Projects: TypeScript/Next.js, Python
17 Comments
Same with languages like
elm-langThis isn't working either: https://github.com/thqby/vscode-autohotkey2-lsp
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
The issue is still there!
I tried installing the Java LSP, which is not working because of an error in the marketplace configuration. Which is unfixed for weeks and has never worked, so nobody did ever test this officially announced feature. anthropics/claude-plugins-official#245
Once this is worked around, still none of the tools is available. A workaround is to set the
ENABLE_LSP_TOOL=1env variable, soENABLE_LSP_TOOL=1 claudewill run it with LSP tools enabled. But this is not mentioned anywhere in the documentation.Thank you! Couldn't get it to work either but then Claude Code picked up this thread and suggested you fix.
@wh-zfy , your workaround didn't work for me. Does it work for everyone else?
<img width="614" height="981" alt="Image" src="https://github.com/user-attachments/assets/e70cb94f-316c-42eb-a14b-c21efa1e27d5" />
I debugged further and ran this command on terminal -
claude plugin listThen I reinstalled the plugins and it worked. Along with the environment variable recommended by @wh-zfy of course!
<img width="455" height="522" alt="Image" src="https://github.com/user-attachments/assets/0d04f55e-6cc9-4351-869f-9e92b0630b44" />
<img width="466" height="538" alt="Image" src="https://github.com/user-attachments/assets/17b1d190-b31d-4ace-9e30-7887fe8ff73b" />
@claude wtf is going on with the LSP server plugins in the marketplace? All of them have only 2 files: license and readme. The Claude Code documents indicate that LSP server plugins are available (https://code.claude.com/docs/en/plugins-reference#lsp-servers) but they aren't. People are trying hacks to get these LSP server plugins available, there are at least a dozen issues open regarding LSP plugins ... in short, a lot of wasted time and no official acknowledgement of this problem or how to solve/workaround. What is going on? What should we do?
https://www.reddit.com/r/ClaudeCode/s/tHaHcFPdvY
TLDR
Add this to your ~/.claude/settings.json:
"env": { "ENABLE_LSP_TOOL": "1" }
holy shit, that did the trick! Thank you @mrclrchtr
Workaround: Using ty (Astral's new type checker) as the LSP backend
For anyone wanting to use ty (Astral's Rust-based Python type checker, now in beta) instead of pyright, here's what worked:
1. Set the env var in
~/.claude/settings.json2. Fix the pyright-lsp plugin manifest
The installed plugin at
~/.claude/plugins/cache/claude-plugins-official/pyright-lsp/1.0.0/.claude-plugin/plugin.jsonhas unrecognized keys that cause validation errors (source,category,strict). Remove them so it looks like:3. Install ty and create a shim
Install ty globally:
Create a shim at
/usr/local/bin/pyright-langserverthat redirects to ty's LSP:The plugin calls
pyright-langserver --stdio, the shim intercepts and runsty serverinstead. ty's LSP speaks the same protocol over stdio. The--stdioarg is silently ignored by ty which is fine.4. Restart Claude Code
After restart, the LSP tool becomes available with full support for
goToDefinition,findReferences,hover,documentSymbol,workspaceSymbol, etc. — all powered by ty.You can verify with
ps aux | grep "ty server"to confirm it's actually ty running.I applied the same fix @dbtreasure suggests (adding env var, reconstructing the plugin manifest - in my case the manifest was completely absent like @730alchemy mentions, installing plugin, restart Claude) and it worked also for
typescript-language-server. For anyone needing this, this is the manifest Claude itself suggested. Also, I added a line in my CLAUDE.md to make Claude always try using the LSP tool, and warn the user if its not available (helps ensuring every dev has this configured properly):Claude says:
status?
Given the age of this issue, can anyone from Anthropic comment on why LSPs are not better-supported? Do LSPs not work as well in practice as hoped? It seems odd.
Same fix works for Python (
pylsp/python-lsp-server). Sharing in case anyone needs it:pyright-lspplugin directory exists but has noplugin.json):~/.claude/settings.json:Verified working —
documentSymbol,hover,goToDefinitionetc. all operational. Same pattern as my TypeScript fix above.This https://github.com/anthropics/claude-plugins-official/pull/378 fixed it for me, LSP plugins now working.
I prodded Claude about why it used grep instead of LSP when searching for certain information. Here is its answer:
<img width="1656" height="128" alt="Image" src="https://github.com/user-attachments/assets/d2f90f17-da6b-47e9-9b2d-3e7ecb45ec52" />