MCP ExplorerExplorer

Mcp Scala

@takapi327on a year ago
1 MIT
FreeCommunity
AI Systems
MCP for Scala 3 is an actively developed server framework for building tools.

Overview

What is Mcp Scala

mcp-scala is a Model Context Protocol implementation for Scala 3, designed to facilitate communication between tools and applications using a structured protocol.

Use cases

Use cases for mcp-scala include building command-line tools, creating APIs that respond to structured requests, and developing applications that require interaction with multiple services.

How to use

To use mcp-scala, import the necessary libraries and define your tools and input types. You can create a server instance and add tools to it, then start the server to handle requests.

Key features

Key features of mcp-scala include support for Scala 3, integration with Circe for JSON handling, and a simple API for defining tools and their behaviors.

Where to use

mcp-scala can be used in various fields such as software development, data processing, and any application requiring structured communication between components.

Content

MCP (Model Context Protocol) for Scala 3

[!CAUTION]
mcp-scala is currently under active development. Please note that current functionality may therefore be deprecated or changed in the future.

Usage

import io.circe.*
import mcp.schema.*

object StdioServer extends IOApp.Simple:
  
  case class Input(
    @Description("description for argument") argument: String
  ) derives JsonSchema, Decoder

  private val tool = Tool[IO, Input](https://raw.githubusercontent.com/takapi327/mcp-scala/master/
    "Tool Name",
    "Tool Description",
    request => IO(
      CallToolResult.success(
        Content.text(s"Hello ${request.argument}") :: Nil
      )
    )
  )

  override def run: IO[Unit] =
    McpServer
      .FastMcp[IO](https://raw.githubusercontent.com/takapi327/mcp-scala/master/"MCP Server Name", "0.1.0")
      .addTool(tool)
      .start("stdio")

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers