zio-ella

by otobrglez

3 stars
187 downloads
Not rated
GitHub

About

zio-ella is a framework for writing MCP (Model Context Protocol) servers for modern AI platforms using Scala 3 and ZIO with zio-http. It is designed for developers who want to expose ZIO-based services as MCP tools.

Details

Author
otobrglez
GitHub stars
3
Downloads
187
Categories
Other

- Write MCP servers in Scala 3 with ZIO and zio-http
- Define tools using Tool and ArgDef with ZIO effects
- Run via MCPServer and standard ZIOAppDefault pattern
- Port configuration through ZIO config layers
- Lightweight, early-phase framework open to rapid change

Define server capabilities by mapping Tool instances to ZIO effects, then run the server with MCPServer(capabilities).run. The server port can be configured via a ZIO config layer using Config.int("port"). The entry point is a standard ZIOAppDefault that provides the configured server layer.

zio-ella

[zio-ella] is a framework for writing [MCP (Model Context Protocol)][mcp] servers for modern AI platforms with Scala 3
and [ZIO] with zio-http.

> ⚠️ The project is in its early phase and is bound to rapid change. Please feel free to reach-out with ideas and use-cases.

Example capabilities and tools definition within a service might look like:

``scala 3
import zio.ZIO
import zio.dev.ella.*

object MyService:
val capabilities = Capabilities(
// Tool that only returns current server time
Tool("get-time") -> { _ =>
zio.Clock.instant.map(_.toString)
},

// Exemple tool to get where we accept city as an argument.
Tool("get-weather", ArgDef.string("city")) -> {
_.string("city").flatMap(city => ZIO.succeed(s"Weather in $city is sunny!"))
}
)

def run = MCPServer(capabilities).run


Integration with the ZIO Stack as follows:

scala 3
object Main extends ZIOAppDefault:
def program = for
_ <- logInfo("Booting...")
_ <- MyService.run
yield ()

def configuredServer: TaskLayer[Server] =
ZLayer
.fromZIO(ZIO.config(Config.int("port")).tap(port => logInfo(s"Starting server on port $port")))
.flatMap(portEnv => Server.defaultWithPort(portEnv.get))

def run = program.provide(configuredServer)
``

Resources

- MCP Protocol Tutorial
- Anthropic / Model Context Protocol (MCP)
- MCP Inspector

[ZIO]: https://zio.dev

[zio-ella]: https://github.com/otobrglez/zio-ella

[mcp]: https://modelcontextprotocol.io/introduction

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.