A Claude Code plugin that integrates Metals, the Scala language server, for code intelligence, refactoring, and analysis.
Install the Metals LSP binary:
# Via Coursier (recommended)
cs install metals
# Or via Homebrew
brew install scalameta/tap/metalsLoad the plugin when starting Claude Code:
claude --plugin-dir /path/to/metals-lspOr add it as a local marketplace for permanent installation:
# Inside Claude Code:
/plugin marketplace add /path/to/metals-lsp
/plugin install metals-lsp| Extension | Language |
|---|---|
.scala |
Scala |
.sc |
Scala |
.sbt |
sbt |
If Metals isn't responding or indexing fails, try resetting the workspace:
- Delete caches:
rm -rf .metals/ .bloop/ .bsp/metals.json
- Regenerate Bloop project files:
sbt bloopInstall
- Trigger compilation by issuing any LSP request (e.g. hover or documentSymbol) — Metals then connects to Bloop, indexes the workspace (~22s), and compiles all sources (~71s total).
Once installed, Claude Code gains LSP-powered capabilities for Scala projects:
- Diagnostics (compiler errors and warnings)
- Hover information (types, documentation)
- Go-to-definition
- Find references
- Code completions