Metals v1.6.6 - Osmium
We're happy to announce the release of Metals v1.6.6, which brings a standalone MCP server for AI-powered workflows, support for Play's Twirl templates, easier access to compiler explain output, and an option to shut down the build server when closing your editor.
| Commits since last release | 72 |
| Merged PRs | 72 |
| Contributors | 8 |
| Closed issues | 14 |
| New features | 5 |
For full details: https://github.com/scalameta/metals/milestone/85?closed=1
Metals is a language server for Scala that works with VS Code, Cursor, Vim, Emacs, Zed, Helix and Sublime Text. Metals is developed at the Scala Center and VirtusLab with the help from contributors from the community.
TL;DR
Check out https://scalameta.org/metals/, and give Metals a try!
- Allow users to get the output of -explain
- Standalone MCP server
- Add an option to shutdown Bloop build server
- Support for Play's Twirl templates
- New File Improvements
Allow users to get the output of -explain
When the Scala compiler suggests using the -explain option to get more
detailed error messages, it isn't exactly easy to do so. You would have to change
your build configuration, which might require rebuilding the entire project.
Metals now offers two ways to access explain output:
- With virtual documents support: When your editor supports virtual
documents, Metals replaces the code description with a link that invokes a
command to get diagnostics from the presentation compiler with
-explainenabled.

- Without virtual documents: If your editor doesn't support virtual
documents, Metals shows a code action that, when invoked, creates a new
document in the
.metals/explained-diagnosticsdirectory with the full diagnostic output from-explain. Some editors might not open the new file automatically.

Standalone MCP server
Metals now includes a standalone MCP (Model Context Protocol) server that can run independently of your editor. This allows AI-powered tools like Cursor, Claude Code, or other MCP clients to interact with your Scala project without needing the full Metals language server running inside an IDE.
The standalone server runs over HTTP and automatically imports the workspace when a project is detected. Several improvements make it easier to configure:
A standalone MCP (Model Context Protocol) server for Scala projects.
Usage:
metals-mcp --workspace <path> [options]
Options:
--workspace <path> Path to the Scala project (required)
--port <number> HTTP port to listen on (default: auto-assign)
--transport <type> Transport type: http (default) or stdio (reserved for future use)
--client <name> Client to generate config for: Visual Studio Code, Visual Studio Code - Insiders, VSCodium, vscode, VSCodium - Insiders, Kilo, kilo, Cursor, cursor, claude, Claude Code, claude-code
--<key> [value] UserConfiguration override. Use kebab-case (e.g. --java-home /path, --bloop-version 1.4.0).
For boolean options, value is optional: omit for true, or use --key true/false.
--help, -h Show this help message
--version, -v Show version information
Examples:
# Start MCP server for a project
metals-mcp --workspace /path/to/project
# Start with specific port
metals-mcp --workspace /path/to/project --port 8080
# Override Java home and enable default BSP to build tool (boolean, omit = true)
metals-mcp --workspace /path/to/project --java-home /path/to/jdk --default-bsp-to-build-tool
# Generate config for Cursor editor
metals-mcp --workspace /path/to/project --client Cursor
- Client configuration: When you specify
--client(e.g.--client cursor), Metals generates the appropriate MCP configuration for supported clients, making setup straightforward for command-line tools. - User configuration in CLI: You can pass Metals configuration options
directly via the command line using
--<key> <value>syntax, including nested keys and boolean flags. This lets you customize the MCP server behavior independently of your editor.
You should be able to install the standalone MCP server using Coursier:
cs install metals-mcp
or Homebrew:
brew install metals
Add an option to shutdown Bloop build server
A long-standing request was to terminate the Bloop process when closing the editor, so you don't end up with leftover build server processes running in the background if you didn't need it anymore.
Metals now provides the build-disconnect-and-shutdown LSP command. When
invoked, it disconnects from the build server and shuts it down so the process
exits. Visual Studio Code will use this command if you set the
metals.shutdownBloopOnEditorClose configuration option to true. It will try
to track the number of open VS Code instances and only exit if there are no more
open instances.
It's important to note that this doesn't work with any other BSP server other than Bloop.
Thanks to thomasGuerin3 for implementing this feature!
Support for Play's Twirl templates
Metals now has LSP support for Play Framework's Twirl template files
(.scala.html, .scala.txt, .scala.xml, .scala.js). This work was done as
part of Google Summer of Code 2025.
The IDE features for Twirl templates include:
- Hover: See documentation and type information when hovering over symbols
- Completions: Get code completions for Scala expressions within templates
- Go to definition: Navigate from template code to Scala definitions
- Auto-import: Automatically add imports when using completions
- Rename: Rename symbols with proper updates across the template
- Document highlighting: See all occurrences of the symbol currently under the cursor in a single file

Metals compiles Twirl templates in-memory and maps positions between the template source and the generated Scala code, so all these features should work correctly within the template syntax.
Thanks to ajafri2001 for implementing this feature and to zielinsky for finishing the work!
New File Improvements
When using "New Scala File" or "New Java File" commands, Metals will now automatically strip extensions from the file name if they are provided. Additionally, there is a new type of new file which will take the current copied snippet and insert it into the new file with the suggested name.

As this requires access to the clipboard, it's only available in the Visual Studio Code extension, which implements the new clipboard API.
Miscellaneous
- fix: reduce presentation compiler memory usage (#6967) krrish175-byte
- improvement: Properly set minimum Bloop version instead of using newest to avoid unnecessary bloop server restart messages tgodzik
- feat(mcp): Add smart fallback and module parameter for inspect, get-docs, get-usages li-nkSN
- fix: Recompile worksheet on changes even if didFocus is not supported krrish175-byte
- improvement: Add message on timeouts to simplify debugging for users tgodzik
- bugfix: Make sure that cs or coursier is a coursier binary tgodzik
- improvement: Add KiloCodeEditor client configuration cheleb
Contributors
Big thanks to everybody who contributed to this release or reported an issue!
$ git shortlog -sn --no-merges v1.6.5..v1.6.6
28 scalameta-bot
23 Tomasz Godzik
7 dependabot[bot]
2 Krrish Biswas
1 Olivier NOUGUIER
1 Prince
1 li-nkSN
1 thomasGuerin3
Merged PRs
v1.6.6 (2026-02-27)
Merged pull requests:
- build(deps): Update mcp, mcp-json-jackson2 from 0.18.1 to 1.0.0 #8215 (scalameta-bot)
- build(deps): bump actions/upload-artifact from 6 to 7 in the github-actions #8219 (dependabot[bot])
- build(deps): bump the npm-dependencies group in /website with 2 updates #8220 (dependabot[bot])
- build(deps): Update flyway-core from 12.0.2 to 12.0.3 #8221 (scalameta-bot)
- build(deps): Update sbt, scripted-plugin from 1.12.3 to 1.12.5 #8222 (scalameta-bot)
- build(deps): Update munit from 1.2.2 to 1.2.3 #8223 (scalameta-bot)
- build(deps): Update cli_3, scala-cli-bsp from 1.12.2 to 1.12.3 commit-count:1 #8224 (scalameta-bot)
- improvement: Improve the UX of new file provider #8209 (tgodzik)
- build(deps): Update sbt-scalafix, scalafix-interfaces from 0.14.5 to 0.14.6 #8212 (scalameta-bot)
- build(deps): Update protobuf-java from 4.33.5 to 4.34.0 #8214 (scalameta-bot)
- build(deps): Update jackson-databind from 2.21.0 to 2.21.1 #8213 (scalameta-bot)
- chore: Test Scala 3.8.2 #8208 (tgodzik)
- build(deps): Update flyway-core from 12.0.1 to 12.0.2 #8207 (scalameta-bot)
- improvement: Allow specifying UserConfiguration in CLI #8206 (tgodzik)
- build(deps): Update sbt-mima-plugin from 1.1.4 to 1.1.5 #8204 (scalameta-bot)
- build(deps): Update mcp, mcp-json-jackson2 from 0.17.2 to 0.18.1 #8205 (scalameta-bot)
- improvement: Add KiloCodeEditor client configuration #8196 (cheleb)
- Twirl support in metals #7751 (ajafri2001)
- build(deps): Update scalameta, semanticdb-metap, ... from 4.14.7 to 4.15.2 #8202 (scalameta-bot)
- chore: Bump Scala to 3.8.2-RC3 #8203 (tgodzik)
- build(deps): Update org.eclipse.lsp4j, ... from 0.24.0 to 1.0.0 #8192 (scalameta-bot)
- build(deps): Update ujson from 4.4.2 to 4.4.3 #8200 (scalameta-bot)
- build(deps): Update sbt, scripted-plugin from 1.12.2 to 1.12.3 #8201 (scalameta-bot)
- feat(server): add build-disconnect-and-shutdown command #8162 (thomasGuerin3)
- build(deps): bump qs from 6.14.1 to 6.14.2 in /website #8190 (dependabot[bot])
- bugfix: Make sure that cs or coursier is a coursier binary #8191 (tgodzik)
- build(deps): Update scalafmt-core, scalafmt-dynamic from 3.10.6 to 3.10.7 #8194 (scalameta-bot)
- build(deps): Update flyway-core from 12.0.0 to 12.0.1 #8193 (scalameta-bot)
- improvement: Log normally when started as http mcp server #8197 (tgodzik)
- improvement: Generate configuration for client when --client is supplied #8184 (tgodzik)
- ci: Use coursier cache and make it reuse between jobs #8189 (tgodzik)
- chore: Test Metals on 3.8.2-RC2 #8188 (tgodzik)
- improvement: Reduce the number of tests and split sbt tests into two groups #8186 (tgodzik)
- improvement: Add more shards and drop running macOS tests #8185 (tgodzik)
- build(deps): bump the npm-dependencies group in /website with 2 updates #8182 (dependabot[bot])
- chore: Group dependabot PRs #8180 (tgodzik)
- build(deps): Update cli_3, scala-cli-bsp from 1.12.1 to 1.12.2 #8178 (scalameta-bot)
- build(deps): Update mill-contrib-testng from 1.1.1 to 1.1.2 #8177 (scalameta-bot)
- improvement: Adjust messages about mcp server #8175 (tgodzik)
- improvement: Add message on timeout and remove warnings #8176 (tgodzik)
- build(deps): Update cli_3, scala-cli-bsp from 1.12.0 to 1.12.1 #8173 (scalameta-bot)
- build(deps): Update sbt, scripted-plugin from 1.12.1 to 1.12.2 #8171 (scalameta-bot)
- build(deps): bump webpack from 5.96.1 to 5.105.0 in /website in the npm_and_yarn group across 1 directory #8174 (dependabot[bot])
- build(deps): Update scalameta, semanticdb-metap, ... from 4.14.5 to 4.14.7 #8172 (scalameta-bot)
- chore: Add standalone metal MCP server #8156 (tgodzik)
- chore: Update mill and mill scripts #8170 (tgodzik)
- chore: Bump Bloop and Bazel BSP #8169 (tgodzik)
- build(deps): bump react from 19.2.3 to 19.2.4 in /website #8159 (dependabot[bot])
- build(deps): Update munit from 1.2.0 to 1.2.2 #8166 (scalameta-bot)
- build(deps): Update requests from 0.9.2 to 0.9.3 #8164 (scalameta-bot)
- chore: Use Scala 2.13 in test in unit module #8168 (tgodzik)
- build(deps): Update os-lib from 0.11.7 to 0.11.8 #8163 (scalameta-bot)
- build(deps): Update flyway-core from 11.20.3 to 12.0.0 #8165 (scalameta-bot)
- build(deps): Update scalafmt-core, scalafmt-dynamic from 3.10.4 to 3.10.6 #8167 (scalameta-bot)
- build(deps-dev): bump @types/node from 25.0.3 to 25.1.0 in /website #8160 (dependabot[bot])
- build(deps): bump @easyops-cn/docusaurus-search-local from 0.52.2 to 0.52.3 in /website #8161 (dependabot[bot])
- build(deps): Update mill-contrib-testng from 1.0.6 to 1.1.0 #8148 (scalameta-bot)
- build(deps): Update protobuf-java from 4.33.4 to 4.33.5 #8147 (scalameta-bot)
- build(deps): Update os-lib from 0.11.6 to 0.11.7 #8149 (scalameta-bot)
- build(deps): Update flyway-core from 11.20.2 to 11.20.3 #8150 (scalameta-bot)
- build(deps): Update sbt, scripted-plugin from 1.12.0 to 1.12.1 #8151 (scalameta-bot)
- fix: Recompile worksheet on changes even if didFocus is not supported #8141 (krrish175-byte)
- feat(mcp): Add smart fallback and module parameter for inspect, get-d… #8125 (li-nkSN)
- bugfix: Fix test failure on Windows #8143 (tgodzik)
- test: Add mcp test for running testng suites #8140 (tgodzik)
- feature: Allow users to get the output of -explain #8088 (tgodzik)
- improvement: Properly set minimum Bloop version instead of using current #8137 (tgodzik)
- build(deps): Update mcp, mcp-json-jackson2 from 0.17.1 to 0.17.2 #8135 (scalameta-bot)
- chore: Test newest Next 3.8.1 #8134 (tgodzik)
- build(deps): bump lodash from 4.17.21 to 4.17.23 in /website in the npm_and_yarn group across 1 directory #8133 (dependabot[bot])
- fix: reduce presentation compiler memory usage (#6967) #8124 (krrish175-byte)
- docs: Add release notes for Metals 1.6.5 #8129 (tgodzik)
