
redpanda-data/protoc-gen-go-mcp
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
redpanda-data/protoc-gen-go-mcp는 [[T0]에서 가져온 MCP 서버 후보입니다.
개요
redpanda-data/protoc-gen-go-mcp는 [[T0]에서 가져온 MCP 서버 후보입니다.
개요(AI 번역)
**protoc-gen-go-mcp**는 gRPC 또는 ConnectRPC API에 대해 모델 컨텍스트 프로토콜(MCP) 서버를 생성하는 프로토콜 버퍼 컴파일러 플러그인입니다.
각 protobuf 서비스에 대해 *.pb.mcp.go 파일을 생성하여 핸들러를 gRPC 서버나 클라이언트에 직접 위임할 수 있습니다. 내부적으로는 MCP가 도구 입력에 JSON 스키마를 사용합니다 – protoc-gen-go-mcp는 메서드 입력 디스크립터에서 이 스키마를 자동으로 생성합니다.
생성된 코드는 MCP-라이브러리에 구애받지 않아: 서버 생성 시 얇은 어댑터를 통해 modelcontextprotocol/go-sdk(공식 SDK) 또는 mark3labs/mcp-go를 선택하면 재생이 필요 없습니다.
특징
.proto서비스에서 MCP 핸들러를 자동으로 생성합니다- 메서드 입력을 위한 JSON 스키마 출력
- gRPC 또는 ConnectRPC 서버/클라이언트에 유선 연결
- [[T6]와의 용이한 통합
- 런타임 LLM 제공자 선택 – 표준 MCP 또는 OpenAI 호환 스키마
- MCP 라이브러리에 구애받지 않음 – 공식 go-SDK와 mark3labs/mcp-go 모두 지원
사용
코드 생성
buf.gen.yaml에 항목을 추가하세요:
표준 *.pb.go 파일도 생성해야 합니다. protoc-gen-go-mcp는 기본적으로 별도의 하위 폴더 {$servicename}mcp를 사용하며, '*pb를 불러옵니다.
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
protoc-gen-go-mcp
protoc-gen-go-mcp is a Protocol Buffers compiler plugin that generates Model Context Protocol (MCP) servers for your gRPC or ConnectRPC APIs.
It generates *.pb.mcp.go files for each protobuf service, enabling you to delegate handlers directly to gRPC servers or clients. Under the hood, MCP uses JSON Schema for tool inputs – protoc-gen-go-mcp auto-generates these schemas from your method input descriptors.
Generated code is MCP-library-agnostic: pick modelcontextprotocol/go-sdk (the official SDK) or mark3labs/mcp-go at server creation time through a thin adapter – no regeneration needed.
Features
- Auto-generates MCP handlers from your
.protoservices - Outputs JSON Schema for method inputs
- Wire up to gRPC or ConnectRPC servers/clients
- Easy integration with
buf - Runtime LLM provider selection – standard MCP or OpenAI-compatible schemas
- MCP library agnostic – official go-sdk and mark3labs/mcp-go both supported
Usage
Generate code
Add entry to your buf.gen.yaml:
...
plugins:
- local:
- go
- run
- github.com/redpanda-data/protoc-gen-go-mcp/cmd/protoc-gen-go-mcp@latest
out: ./gen/go
opt: paths=source_relative
You need to generate the standard *.pb.go files as well. protoc-gen-go-mcp by defaults uses a separate subfolder {$servicename}mcp, and imports the *pb.go files – similar to connectrpc-go.
After running buf generate, you will see a new folder for each package with protobuf Service definitions:
tree pkg/testdata/gen/
gen
go
testdata
test_service.pb.go
testdataconnect/
test_service.connect.go
testdatamcp/
test_service.pb.mcp.go
Setting up the MCP server
Generated code programs against the runtime.MCPServer interface. You choose the backing MCP library by importing the corresponding adapter package.
With the official go-sdk (recommended)
import (
"github.com/modelcontextprotocol/go-sdk/mcp"
"github.com/redpanda-data/protoc-gen-go-mcp/pkg/runtime/gosdk"
)
// Create server -- raw is *mcp.Server for transport, s is runtime.MCPServer for tools.
raw, s := gosdk.NewServer("my-server", "1.0.0")
testdatamcp.RegisterTestServiceHandler(s, &srv)
// Serve over stdio
raw.Run(ctx, &mcp.StdioTransport{})
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →