A compiler semantic model is the compiler-resolved view of symbols, types, references, dependencies, and language meaning. Through Language Server Protocol (LSP), this view becomes available to editors and AI agents rather than requiring raw-file scanning. section 3.3.4
Its practical value comes from build-time facts that ordinary text inspection can miss:
- Resolved types, such as the inferred type of avatarUrl: Option[String]. section 3.3.4
- Symbol definitions, autocomplete, type hover, refactorings, semantic tokens, and code actions. section 3.3.4
- Actual dependency versions, transitive libraries, classpaths, and source JAR information. section 3.3.4
Scala through Metals
A Scala project connected through Metals gives an agent compiler-level access to symbols, types, build configuration, and the full classpath. This is authoritative for type correctness and dependency resolution, but not for production runtime behavior. section 3.3.4
Figure 3.4 MCP ↔ LSP (Metals) with Claude Desktop as MCP Client.

Use the architecture diagram to trace Claude Desktop as the MCP client, Metals as the LSP server, and compiler-level project access between them. section 3.3.4
