A Scala implementation of the Model Context Protocol (MCP) for the Typelevel ecosystem.
MCP4S provides a type-safe, functional implementation of MCP for Scala 3 using cats-effect, fs2, http4s, and circe. It enables Scala applications to act as MCP servers (providing tools, resources, and prompts) or clients (consuming MCP servers).
Add to your build.mill:
def ivyDeps = Agg(
ivy"io.github.oloveluck::mcp4s-core::0.1.8",
ivy"io.github.oloveluck::mcp4s-server::0.1.8", // for servers
ivy"io.github.oloveluck::mcp4s-client::0.1.8" // for clients
)Or in sbt:
libraryDependencies ++= Seq(
"io.github.oloveluck" %% "mcp4s-core" % "0.1.8",
"io.github.oloveluck" %% "mcp4s-server" % "0.1.8",
"io.github.oloveluck" %% "mcp4s-client" % "0.1.8"
)See the documentation site for server and client examples.
| Module | Description |
|---|---|
| core | Protocol types, JSON-RPC messages, codec definitions |
| server | MCP server with Streamable HTTP, WebSocket, and stdio transports |
| client | MCP client for connecting to servers |
mill __.compile # Compile all modules
mill __.test # Run all tests
mill conformance # Run MCP conformance tests (requires Node.js 18+)
mill __.publishLocal # Publish locallySee the documentation site for guides on tools, resources, prompts, transports, and testing.
Apache 2.0 - see LICENSE for details.