Language Server Protocol (LSP) is a JSON-RPC standard connecting editors or development tools with language servers. A language server exposes a compiler’s semantic model uniformly, enabling autocomplete, go-to-definition, type hovers, refactorings, semantic tokens, and code actions without binding those capabilities to one IDE. section 3.3.4
LSP provides compiler-level build-time truth, including:
- Resolved types, such as the inferred type of a field. section 3.3.4
- Dependency versions, transitive libraries, class paths, symbols, and source JAR information. section 3.3.4
- A boundary between compiler knowledge and operational behavior: deployment JVMs, containers, and Kubernetes targets remain outside LSP’s view. section 3.3.4
MCP integration with Metals
An AI agent can query the Scala LSP server Metals through MCP, with Claude Desktop acting as the MCP client. Metals understands the build, indexes symbols and types, and exposes the project’s class path. section 3.3.4
Figure 3.4 MCP ↔ LSP (Metals) with Claude Desktop as MCP Client.

Shows the MCP-to-LSP arrangement connecting Claude Desktop with Metals. section 3.3.4
