Help users configure and verify LSP (Language Server Protocol) setup for Python and JavaScript/TypeScript in Claude Code...
Guide for configuring and verifying Language Server Protocol (LSP) servers for Python and JavaScript/TypeScript in Claude Code projects.
Use this skill when:
# Check if pylsp is installed
which pylsp || which python-lsp-server
# Check Python version
python --version
# Test pylsp directly
pylsp --help 2>&1 | head -5
# Check if typescript-language-server is installed
which typescript-language-server
# Check Node.js version
node --version
# Test typescript-language-server directly
typescript-language-server --version
Using pip:
pip install python-lsp-server[all]
Using uv (recommended for this project):
uv pip install python-lsp-server[all]
Verify installation:
pylsp --help
Using npm:
npm install -g typescript-language-server typescript
Using npx (no global install):
npx typescript-language-server --version
Verify installation:
typescript-language-server --version
The project should have .claude/lsp.json with the following structure:
{
"lspServers": {
"python": {
"command": "pylsp",
...
},
"javascript": {
"command": "typescript-language-server",
...
}
}
}
Verify configuration:
# Check if lsp.json exists
test -f .claude/lsp.json && echo "✓ lsp.json exists" || echo "✗ lsp.json missing"
# Validate JSON syntax
python3 -m json.tool .claude/lsp.json > /dev/null && echo "✓ Valid JSON" || echo "✗ Invalid JSON"
For this project (Python 3.12):
# Check Python version matches .python-version
python --version
cat .python-version
# Check if virtual environment is active
echo $VIRTUAL_ENV
# Check PYTHONPATH
echo $PYTHONPATH
# Check Node.js version
node --version
# Check if package.json exists (for project-specific config)
test -f package.json && echo "✓ package.json exists" || echo "✗ package.json missing"
Solution:
pip install python-lsp-server[all]Solution:
npm install -g typescript-language-server typescriptnode --versionPossible causes:
.claude/lsp.jsonSolution:
.claude/lsp.json syntax is validextensionToLanguage mappings match your file typesworkspaceFolder uses ${CLAUDE_PROJECT_DIR}Solution:
PYTHONPATH includes project rootuv pip install -e . or pip install -r requirements.txtenv.PYTHONPATH in .claude/lsp.json is set correctlySolution:
tsconfig.json exists in project root (if using TypeScript)jsconfig.jsonBefore starting development, verify:
pylsp) is installed and accessible.claude/lsp.json exists and has valid JSON syntax.python-version).py file.js, .jsx, .ts, or .tsx fileThis project uses:
.python-version)package.json)Ensure LSP servers are configured to work with these technologies.