WM

windymelt/mcp-scala

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

37 stars 4 forks 품질 66 트렌드 20MIT

Model Context Protocol 서버가 Scala에서 작성했습니다

개요

Model Context Protocol 서버가 Scala 3에 작성되었습니다. - [x] JSON Schema의 자동 파생 - [x] 도구 정의 - [x] 텍스트 내용 부분 - [ ] 다른 내용 부품 - [ ] 알림 처리 - [ ] 기능 처리 - [x] stdio 수송 - [ ] HTTP 운송 - [ ] 인증 기능 이 구현은 관심과 기여를 필요로 합니다. 이 프로젝트에 기여하기 위해 Issue / PR을 무료로 유지하십시오. 그런 다음 MCP 클라이언트에서 서버를 활용하십시오. - randomNumber - 최소 ~ 최대의 임의 번호를 생성합니다. - iota - 최소에서 최대의 숫자를 생성합니다. - sum - 숫자의 순서의 합계를 계산합니다.

개요(AI 번역)

Model Context Protocol 서버가 Scala 3에 작성되었습니다.

개발 단계

이 소프트웨어는 현재 ALPHA 상태입니다.

  • [x] JSON Schema의 자동 파생
  • [x] 도구 정의
  • [x] 본문내용 바로가기
  • [ ] 다른 내용 부품
  • [ ] 알림 처리
  • [ ] 기능 취급
  • [x] stdio 수송
  • [ ] HTTP 수송
  • [ ] 인증 기능

이 구현은 관심과 기여를 필요로 합니다.

이 프로젝트에 기여하기 위해 Issue / PR을 무료로 유지하십시오.

데모

첫째, JS로 서버를 구축:

그런 다음 MCP 클라이언트에서 서버를 활용하십시오.

당신은 일부 도구를 실행할 수 있습니다:

  • [T0]]
  • min에서 max]의 임의 번호를 생성합니다.
  • [T3]
  • min]에서 max]로 숫자의 순서를 생성합니다.
  • [T6]]
  • 숫자의 순서의 합계를 계산합니다.

도구 구현

Main.scala] 를 참조하십시오.

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

MCP-scala

Model Context Protocol server written in Scala 3

Development stage

This software is currently ALPHA state.

  • [x] Automatic derivation of JSON Schema
  • [x] Define your tool
  • [x] Text content part
  • [ ] Other content parts
  • [ ] Notification handling
  • [ ] Capability handling
  • [x] stdio transport
  • [ ] HTTP transport
  • [ ] Authorization feature

This implementation needs your attention and contribution.

Feel free to open Issue / PR to contribute this project.

Demo

First, build server into JS:

sbt example/fastLinkJS

Then, utilize server in your MCP client:

// Example for Cline
{
  "mcpServers": {
    "mcpscala": {
      "disabled": false,
      "timeout": 30,
      "command": "sh",
      "args": ["/path/to/run.sh"],
      "transportType": "stdio"
    }
  }
}

You can run some tool:

  • randomNumber
    • generate random number between min to max.
  • iota
    • generate a sequence of numbers from min to max.
  • sum
    • calculate the sum of a sequence of numbers.

Implement your tool

See Main.scala for details.

//> using scala 3
//> using toolkit typelevel:default
//> using dep dev.capslock::mcpscala:0.1.0

package dev.capslock.mcpscala

import cats.effect.IO
import cats.effect.IOApp
import dev.capslock.mcpscala.transport.StdioServer
import dev.capslock.mcpscala.mcp.ContentPart
import sttp.tapir.Schema.annotations.description

case class RandomNumberInput(
    @description("Minimum value (inclusive)") min: Int,
    @description("Maximum value (exclusive)") max: Int
) derives io.circe.Decoder,
      sttp.tapir.Schema

def randomNumber(input: RandomNumberInput): IO[Seq[ContentPart]] = IO {
  val random = scala.util.Random.between(input.min, input.max)
  Seq(ContentPart.TextContentPart(random.toString))
}

/** Entry point for the Stdio server.
  */
object StdioMain extends McpIOApp(
    name = "random-number",
    header = "Generate a random number",
  ):
    
  val handlers = Handler.methodHandlers(
    Map(
      "randomNumber" -> server.Tool(randomNumber),
    )
  )

GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

// Example for Cline { "mcpServers": { "mcpscala": { "disabled": false, "timeout": 30, "command": "sh", "args": ["/path/to/run.sh"], "transportType": "stdio" } } }