Skip to content

oloveluck/mcp4s

Repository files navigation

MCP4S

A Scala implementation of the Model Context Protocol (MCP) for the Typelevel ecosystem.

Docs Maven Central

Overview

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).

Installation

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"
)

Quick Start

See the documentation site for server and client examples.

Modules

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

Development

mill __.compile          # Compile all modules
mill __.test             # Run all tests
mill conformance         # Run MCP conformance tests (requires Node.js 18+)
mill __.publishLocal     # Publish locally

See the documentation site for guides on tools, resources, prompts, transports, and testing.

License

Apache 2.0 - see LICENSE for details.

Links

About

A library for creating Model Context Protocol (MCP) servers and clients for Scala 3

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors