Protoc Gen Go Mcp

Author:@redpanda-data
View on GitHub

Overview

Protoc Gen Go Mcp is a compiler plugin for Protocol Buffers. It automatically creates Model Context Protocol (MCP) servers from your .proto service definitions, enabling gRPC or ConnectRPC APIs to integrate with MCP.

To use it, configure the plugin in your buf.gen.yaml file. Running buf generate will then produce both the standard *.pb.go files and the new MCP server files.

Its key features include generating MCP handlers directly from .proto services and producing JSON Schema for method inputs. It integrates easily with gRPC or ConnectRPC servers and works seamlessly with buf for a streamlined workflow.

This tool is ideal for creating MCP servers from existing gRPC services, simplifying how gRPC APIs work with JSON Schema, and building tools that use gRPC services as MCP tools.

MCP, or Model Context Protocol, is a structured protocol for defining tools and services. The plugin is compatible with any gRPC service that uses Protocol Buffers. Current limitations include a lack of support for interceptors and some constraints with tool name mangling for very long RPC names.