gRPC service to MCP server with a single proto annotation, autogen for slackers
The article introduces a tool called protomcp that enables developers to convert any gRPC service into an MCP server using a single proto annotation without modifying the existing gRPC server code. The solution integrates with standard protobuf tooling and leverages the official MCP Go SDK to handle protocol details. It supports common development workflows through buf, protoc, and various Go web frameworks.
- ▪protoc-gen-mcp is a protoc plugin that works alongside tools like protoc-gen-go and buf generate.
- ▪A single proto annotation can turn a gRPC method into an MCP tool with metadata like title, description, and read-only status.
- ▪The runtime library pkg/protomcp is a thin layer over the MCP Go SDK and supports middleware, error handling, and pagination.
- ▪The tool uses a default-deny approach, exposing only RPCs that are explicitly annotated.
- ▪Authentication, resource subscriptions, and custom extensions are supported through the MCP Go SDK and user-defined wiring.
Opening excerpt (first ~120 words) tap to expand
Turn any gRPC service into an MCP server with a single proto annotation. Zero changes to your gRPC server. service Greeter { rpc SayHello(HelloRequest) returns (HelloReply) { + option (protomcp.v1.tool) = { // ← annotate + title: "Say Hello" // and you're + description: "Greets a caller by name." // done + read_only: true + }; } } That's it. protoc-gen-mcp reads the annotation, emits an MCP tool handler bound to your existing gRPC client, and the official Go MCP SDK handles the protocol. Table of contents Why protomcp Install Quickstart Annotation reference Examples Authentication Runtime extension points, middleware, error handling, result processors, pagination Scope & limitations Repository layout Development Comparison with other projects License Why protomcp Protoc plugin.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at GitHub.