Track MCP LogoTrack MCP
Track MCP LogoTrack MCP

The world's largest repository of Model Context Protocol servers. Discover, explore, and submit MCP tools.

Product

  • Categories
  • Top MCP
  • New & Updated
  • Submit MCP

Company

  • About

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

© 2026 TrackMCP. All rights reserved.

Built with ❤️ by Krishna Goyal

    Fast Mcp Scala

    A quick and easy way to deploy MCP servers using Scala

    15 stars
    Scala
    Updated Sep 26, 2025

    Table of Contents

    • Installation
    • Quickstart
    • Running Examples
    • HTTP Transport (Recommended for Remote)
    • Stateless HTTP Transport
    • Integration with Claude Desktop
    • License
    • Development Documentation
    • Developing Locally
    • 🔨 Build Commands (Mill)
    • 🔨 Publish to the Local Ivy Repository
    • 📦 Use the JAR Directly (Unmanaged Dependencies)
    • 🚀 Using with scala‑cli

    Table of Contents

    • Installation
    • Quickstart
    • Running Examples
    • HTTP Transport (Recommended for Remote)
    • Stateless HTTP Transport
    • Integration with Claude Desktop
    • License
    • Development Documentation
    • Developing Locally
    • 🔨 Build Commands (Mill)
    • 🔨 Publish to the Local Ivy Repository
    • 📦 Use the JAR Directly (Unmanaged Dependencies)
    • 🚀 Using with scala‑cli

    Documentation

    FastMCP-Scala

    A high‑level, developer‑friendly Scala 3 library for building Model Context Protocol (MCP) servers.

    Features

    • ZIO‑based effect handling and async support
    • Annotation‑driven API (@Tool, @Resource, @Prompt)
    • Automatic JSON Schema & handler generation via Scala 3 macros
    • Two transports — runStdio() or runHttp() (streamable by default, stateless = true for lightweight mode)
    • Seamless integration with the Java MCP SDK 1.0.0

    Installation

    Add to your **build.sbt (defaulting to Scala 3.7.2**):

    scala 3 ignore
    libraryDependencies += "com.tjclp" %% "fast-mcp-scala" % "0.2.3"

    Quickstart

    scala 3 raw
    //> using scala 3.7.2
    //> using dep com.tjclp::fast-mcp-scala:0.2.3
    //> using options "-Xcheck-macros" "-experimental"
    
    import com.tjclp.fastmcp.core.{Tool, Param, Prompt, Resource}
    import com.tjclp.fastmcp.server.FastMcpServer
    import com.tjclp.fastmcp.macros.RegistrationMacro.*
    import zio.*
    
    // Define annotated tools, prompts, and resources
    object Example:
        @Tool(name = Some("add"), description = Some("Add two numbers"))
        def add(
                 @Param("First operand") a: Double,
                 @Param("Second operand") b: Double
               ): Double = a + b
        
        @Prompt(name = Some("greet"), description = Some("Generate a greeting message"))
        def greet(@Param("Name to greet") name: String): String =
          s"Hello, $name!"
        
        @Resource(uri = "file://test", description = Some("Test resource"))
        def test(): String = "This is a test"
        
        @Resource(uri = "user://{userId}", description = Some("Test resource"))
        def getUser(@Param("The user id") userId: String): String = s"User ID: $userId"
    
    object ExampleServer extends ZIOAppDefault:
        override def run =
          for
            server  using dep com.tjclp::fast-mcp-scala:0.2.3' \
        --main-class com.tjclp.fastmcp.examples.AnnotatedServer

    HTTP Transport (Recommended for Remote)

    FastMCP-Scala supports the full MCP Streamable HTTP spec with session management and SSE streaming. Just call runHttp():

    scala 3 raw
    //> using scala 3.7.2
    //> using dep com.tjclp::fast-mcp-scala:0.2.3
    //> using options "-Xcheck-macros" "-experimental"
    
    import com.tjclp.fastmcp.core.{Tool, Param}
    import com.tjclp.fastmcp.server.{FastMcpServer, FastMcpServerSettings}
    import com.tjclp.fastmcp.macros.RegistrationMacro.*
    import zio.*
    
    object StreamableExample:
      @Tool(name = Some("greet"), description = Some("Greet someone by name"))
      def greet(@Param("Name to greet") name: String): String =
        s"Hello, $name!"
    
    object StreamableServer extends ZIOAppDefault:
      override def run =
        val server = FastMcpServer(
          name = "StreamableExample",
          version = "0.1.0",
          settings = FastMcpServerSettings(port = 8090)
        )
        for
          _ " \
      -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"greet","arguments":{"name":"World"}}}'
    
    # Delete session
    curl -X DELETE http://localhost:8090/mcp -H "mcp-session-id: "

    Stateless HTTP Transport

    For lightweight servers that don't need sessions or SSE, set stateless = true:

    scala 3 raw
    //> using scala 3.7.2
    //> using dep com.tjclp::fast-mcp-scala:0.2.3
    //> using options "-Xcheck-macros" "-experimental"
    
    import com.tjclp.fastmcp.core.{Tool, Param, Resource, Prompt, Message, Role, TextContent}
    import com.tjclp.fastmcp.server.{FastMcpServer, FastMcpServerSettings}
    import com.tjclp.fastmcp.macros.RegistrationMacro.*
    import zio.*
    
    object HttpExample:
      @Tool(name = Some("greet"), description = Some("Greet someone by name"))
      def greet(@Param("Name to greet") name: String): String =
        s"Hello, $name!"
    
    object HttpServer extends ZIOAppDefault:
      override def run =
        val server = FastMcpServer(
          name = "HttpExample",
          version = "0.1.0",
          settings = FastMcpServerSettings(port = 8090, stateless = true)
        )
        for
          _  using dep com.tjclp::fast-mcp-scala:0.2.3",
            "--main-class",
            "com.tjclp.fastmcp.examples.AnnotatedServer"
          ]
        }
      }
    }

    Note: FastMCP-Scala example servers are for demo purposes only and don't do anything useful

    For additional examples and in‑depth docs, see **docs/guide.md**.

    License

    MIT

    ---

    Development Documentation

    Developing Locally

    When hacking on *FastMCP‑Scala* itself, you can consume a local build in any project.

    🔨 Build Commands (Mill)

    FastMCP-Scala uses Mill as its build tool.

    bash
    # Compile the library
    ./mill fast-mcp-scala.compile
    
    # Run tests
    ./mill fast-mcp-scala.test
    
    # Check code formatting
    ./mill fast-mcp-scala.checkFormat
    
    # Auto-format code
    ./mill fast-mcp-scala.reformat
    
    # Generate test coverage report
    ./mill fast-mcp-scala.scoverage.htmlReport

    🔨 Publish to the Local Ivy Repository

    bash
    # From the fast-mcp-scala root
    ./mill fast-mcp-scala.publishLocal

    Then, in your consuming sbt project:

    scala 3 ignore
    libraryDependencies += "com.tjclp" %% "fast-mcp-scala" % "0.2.4-SNAPSHOT"

    Or in Mill:

    scala 3 ignore
    def ivyDeps = Agg(
      ivy"com.tjclp::fast-mcp-scala:0.2.4-SNAPSHOT"
    )

    publishLocal installs the artifact under ~/.ivy2/local.

    📦 Use the JAR Directly (Unmanaged Dependencies)

    bash
    # Build the JAR
    ./mill fast-mcp-scala.jar
    
    # The JAR is located at:
    # out/fast-mcp-scala/jar.dest/out.jar

    🚀 Using with scala‑cli

    You can use fast-mcp-scala in another scala‑cli project:

    scala 3 ignore
    //> using scala 3.7.2
    //> using dep com.tjclp::fast-mcp-scala:0.2.3
    //> using options "-Xcheck-macros" "-experimental"

    You can also point directly at the local JAR:

    scala 3 ignore
    //> using scala 3.7.2
    //> using jar "/absolute/path/to/out/fast-mcp-scala/jar.dest/out.jar"
    //> using options "-Xcheck-macros" "-experimental"

    Similar MCP

    Based on tags & features

    • MC

      Mcpmcp Server

      21
    • ES

      Esp Rainmaker Mcp

      Python·
      9
    • PE

      Personalizationmcp

      Python·
      12
    • FA

      Fal Mcp Server

      Python·
      8

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k
    View All MCP Servers

    Similar MCP

    Based on tags & features

    • MC

      Mcpmcp Server

      21
    • ES

      Esp Rainmaker Mcp

      Python·
      9
    • PE

      Personalizationmcp

      Python·
      12
    • FA

      Fal Mcp Server

      Python·
      8

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k