ScalaSemantic
Deep semantic analysis of Scala projects over MCP. It reads compiler-emitted SemanticDB, so answers reflect what the compiler resolved — not text matching.
The Scala fences below are compiled + executed by mdoc at site-build time, so their output is real. They model the data shapes rather than call the analyzer in-process: the analyzer is built on a newer Scala than mdoc's snippet compiler supports (see Development).
SemanticDB symbol grammar
Every tool takes a SemanticDB symbol string, whose terminator encodes the kind:
enum Descriptor(val terminator: String):
case Package extends Descriptor("/") // com/example/
case Type extends Descriptor("#") // Animal#
case Term extends Descriptor(".") // Sample.
case Method extends Descriptor(").") // render(). , render(+1). for an overload
Descriptor.values.map(d => s"${d}${d.terminator}").toList
// res0: List[String] = List("Package/", "Type#", "Term.", "Method).")
So com/example/Animal# is the type Animal in package com.example, and
com/example/Sample.render(). is a method.
Talking to the server (stdio JSON-RPC)
find_symbol turns a plain name into a symbol; feed that symbol into the richer tools:
{"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"find_symbol","arguments":{"query":"Animal"}}}
{"jsonrpc":"2.0","id":2,"method":"tools/call",
"params":{"name":"class_hierarchy","arguments":{"symbol":"com/example/Animal#"}}}
Pages
- Integration — register the server with an MCP client
- Comparison — vs
grep(pros & cons), plus a note on Metals/LSP - Development — modules, build, cross-version testing, this site
- Design decisions — upickle, extensibility, docs tooling
- Releasing — Sonatype Central release process
- Plan — design rationale & tracker