scala-cli icon indicating copy to clipboard operation
scala-cli copied to clipboard

Support Model Context Protocol

Open susliko opened this issue 8 months ago • 1 comments

Is your feature request related to a problem? Please describe.
Agentic workflows—where language models act as autonomous agents—are starting to use the Model Context Protocol to discover and interact with tools in the developer environment. Support of mcp mode in scala-cli might include features like:

  • using scala-cli compile/test/run/package/etc commands or even lsp-capabilities like "find references" as a tool
  • exposing build/lsp information as a resource

Describe the solution you'd like
Support for MCP in scala-cli, e.g. via a scala-cli mcp subcommand that starts a server conforming to the mcp spec.

Describe alternatives you've considered

Packing scala-cli documentation into a concise llm.txt document and adding it to the agent context might also work for the tool-scenario. But it's less powerfull, I guess

susliko avatar Apr 10 '25 10:04 susliko

Development for an MCP server via Metals is already underway, actually:

  • https://github.com/scalameta/metals-feature-requests/issues/430
  • https://github.com/scalameta/metals/pull/7390

That being said, we might still consider serving MCP with our BSP server in the future, since that's already in place... It would likely be more limited than what could be done with Metals, but perhaps it's not a bad idea.

Gedochao avatar Apr 10 '25 14:04 Gedochao