IM

indoorvivants/mcp

Developer tools

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

13 stars 2 forks 품질 67 트렌드 23Apache-2.0

indoorvivants/mcp는 MCP 서버 후보로 수입 https://github.com/indoorvivants/mcp.]

개요

indoorvivants/mcp는 MCP 서버 후보로 수입 https://github.com/indoorvivants/mcp.]

개요(AI 번역)

이 모델 Context 프로토콜을 구현하는 WIP 라이브러리입니다.

현재 라이브러리는 세 부분으로 구성됩니다.

  1. MCP의 JSON schema를 사용하여 프로토콜의 하위 집합을 구현하는 코드 생성기
  2. JSON의 직렬화 구조를 돕는 Minimal 런타임
  3. JSONRPC 2.0 프로토콜을 구현하는 Minimal jsonrpc 런타임

jsonrpc 구현은 제거를 지원하지 않으며 일반적으로 심각한 사용을 위해 설계되지 않습니다. 그러나 신속하게 땅에서 물건을 얻는 것이 좋습니다! 앞으로도 이 라이브러리는 Scala Native 0.5 (또는 그 통합에서 누군가가 작동하면 이전이 될 수 있음)에 대한 라이브러리가 게시되면 jsonrpclib와 통합 할 것입니다.

시작하기

** 라이브러리는 Scala 3.7을 사용하고 있습니다. 일반적으로 앱을 위해 벌금이 부과됩니다. 3.7 이상 Scala의 모든 버전을 사용할 수 있습니다 **

mcp.scala] 파일에서 저장하고 MCP Inspector로 실행하십시오.

더 많은 관련 예제, 도구 사용 및 양방향 통신을 포함, 샘플을 참조하십시오.

행동에서 본다

당신은 당신이 Scala CLI와 npx가 설치 한대로 MCP 검사기를 사용하여 제공 된 샘플을 실행할 수 있습니다 :

샘플로드 및 MCP 검사기에서 작동 :

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

README

Model Context Protocol for Scala 3

This is a WIP library implementing the Model Context Protocol.

At the moment the library consists of three parts:

  1. Code generator that uses JSON schema from MCP to implement a subset of the protocol
  2. Minimal runtime to help serialising structures in JSON
  3. Minimal jsonrpc runtime implementing JSONRPC 2.0 protocol

Note that the jsonrpc implementation does not support cancellation, and is generally not designed for serious usage – but it’s great to get things off the ground quickly! In the future, this library will provide an integration with jsonrpclib, once that library is published for Scala Native 0.5 (or may be earlier, if someone works on that integration).

Getting Started

Note that the library is using Scala 3.7 – which is generally fine for apps, as you can use any version of Scala above 3.7

//> using scala 3.7.0
//> using dep com.indoorvivants::mcp-quick::latest.release

import mcp.*

@main def hello =
  val mcp = MCPBuilder
    .create()
    .handle(initialize): req =>
      InitializeResult(
        capabilities =
          ServerCapabilities(tools = Some(ServerCapabilities.Tools())),
        protocolVersion = req.protocolVersion,
        serverInfo = Implementation("scala-mcp", "0.0.1")
      )
    .run(SyncTransport.default)
end hello

Save it in a mcp.scala file and run it with MCP Inspector:

npx @modelcontextprotocol/inspector scala-cli run mcp.scala

For a more involved example, containing tool usage and bi-directional communication, see the sample.

See it in action

You can run the provided sample using MCP inspector as long as you have Scala CLI and npx installed:

npx @modelcontextprotocol/inspector make run-sample

The sample loads and works in the MCP inspector:

And can be configured in Claude desktop:

GitHub에서 전체 README 보기

설치

npx @modelcontextprotocol/inspector scala-cli run mcp.scala
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →