GM

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

50 stars 4 forks 품질 59 트렌드 33Apache-2.0

모델 Context Protocol (MCP)의 XGo 구현으로 LLM 애플리케이션과 외부 데이터 소스 및 도구 간의 원활한 통합을 가능하게 합니다.

개요

모델 Context Protocol (MCP)의 XGo 구현으로 LLM 애플리케이션과 외부 데이터 소스 및 도구 간의 원활한 통합을 가능하게 합니다. 이 repo는 두 개의 XGo classfiles를 포함합니다. mcp (MCP Server Framework) 및 mcptest (MCP Server Test Framework)입니다. classfile mcp에는 파일 suffix mcp.gox (MCP Server), res.gox (MCP Resource 또는 ResourceTemplate), tool.gox (MCP Tool) 및 prompt.gox (MCP Prompt)가 있습니다. classfile mcptest에는 파일 suffix mtest.gox가 있습니다. 여기에 MCP Server 예제 (소스 코드)입니다. 그것은 두 개의 파일이 있습니다 : main mcp.gox (MCP 서버) 및 hello tool.gox (MCP 도구). 먼저 hello 프로젝트를 초기화하십시오. 그런 다음 mcp classfile을 참조해야합니다. main mcp.gox (MCP Server)의 내용은 다음과 같습니다. hello tool.gox (MCP Tool)의 내용은 다음과 같습니다

개요(AI 번역)

₢ 킹 = = =

모델 Context Protocol (MCP)의 XGo 구현으로 LLM 애플리케이션과 외부 데이터 소스 및 도구 간의 원활한 통합을 가능하게 합니다.

이 repo는 두 개의 XGo classfiles를 포함합니다. mcp (MCP Server Framework) 및 mcptest (MCP Server Test Framework)입니다.

classfile mcp에는 파일 suffix _mcp.gox(MCP Server), _res.gox](MCP Resource 또는 ResourceTemplate), _tool.gox(MCP Tool) 및 _prompt.gox(MCP Prompt)가 있습니다. classfile mcptest에는 파일 스프록이 있습니다 _mtest.gox].

mcp: MCP 서버 프레임 워크

여기에 MCP Server 예제 (소스 코드)입니다. 그것은 두 개의 파일이 있습니다 : main_mcp.gox (MCP 서버) 및 hello_tool.gox] (MCP 도구).

MCP 서버 예: 안녕하세요

먼저 hello 프로젝트를 초기화하십시오.

그런 다음 mcp classfile을 참조해야합니다.

main_mcp.gox의 내용 (MCP Server)는 다음과 같습니다.

hello_tool.gox]의 내용 (MCP Tool)은 다음과 같습니다.

다음 명령을 실행:

가장 간단한 MCP 서버가 지금 실행됩니다.

mcptest: MCP 서버 테스트 기구

hello MCP Server (source code)를 테스트하려면 hello_mtest.gox] 파일을 구현해야 합니다

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

README

MCP XGo 🚀

A XGo implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and external data sources and tools.

This repo contains two XGo classfiles. They are mcp (MCP Server Framework) and mcptest (MCP Server Test Framework).

The classfile mcp has the file suffix _mcp.gox (the MCP Server), _res.gox (a MCP Resource or ResourceTemplate), _tool.gox (a MCP Tool) and _prompt.gox (a MCP Prompt). The classfile mcptest has the file suffix _mtest.gox.

mcp: MCP Server Framework

Here is a MCP Server example (source code). It has two files: main_mcp.gox (the MCP Server) and hello_tool.gox (a MCP Tool).

A MCP Server Example: hello

First let us initialize a hello project:

xgo mod init hello

Then we have it reference the mcp classfile:

xgo get github.com/goplus/mcp@latest

The content of main_mcp.gox (the MCP Server) is as follows

server "Tool Demo 🚀", "1.0.0"

The content of hello_tool.gox (a MCP Tool) is as follows

tool "helloWorld", => {
	description "Say hello to someone"
	string "name", => {
		required
		description "Name of the person to greet"
	}
}

name, ok := ${name}.(string)
if !ok {
	return newError("name must be a string")
}

return text("Hello, ${name}!")

Execute the following commands:

xgo mod tidy
xgo run .

A simplest MCP Server is running now.

mcptest: MCP Server Test Framework

To test the above hello MCP Server (source code), you only need to implement a hello_mtest.gox file:

mock new(MCPApp)

initialize nil
ret {}

call "helloWorld", {"name": "Ken"}
ret {
	"content": [{"type": "text", "text": "Hello, Ken!"}],
}

Then run xgo test or xgo test -v to execute the unit test.

GitHub에서 전체 README 보기

설치

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

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