Protocol Library
We handle JSON-RPC and MCP protocol details. You bring your own HTTP server, logging, and configuration.
Typelevel Ecosystem
Built on Cats Effect 3, fs2, http4s, and Circe. Pure functional, composable, and type-safe.
Full MCP Support
Tools, resources, prompts, sampling, elicitation, and both stdio and HTTP transports.
Quick Example
import cats.effect.*
import mcp.protocol.*
import mcp.server.*
type GreetInput = (name: String, formal: Option[Boolean])
given InputDef[GreetInput] = InputDef[GreetInput](
name = InputField[String]("Name to greet"),
formal = InputField[Option[Boolean]]("Use formal greeting")
)
object MyServer extends IOApp.Simple:
val greetTool = ToolDef.unstructured[IO, GreetInput](
name = "greet",
description = Some("Greet someone")
) { (input, ctx) =>
IO.pure(List(Content.Text(s"Hello, ${input.name}!")))
}
def run: IO[Unit] =
(for
server <- McpServer[IO](
info = Implementation("my-server", "1.0.0"),
tools = List(greetTool)
)
transport <- StdioTransport[IO]()
_ <- server.serve(transport)
yield ()).useForever