A simple MCP server that will proxy to a grpc backend based on a provided descriptors file or using reflection.
-
Install the binary:
go install .orgo install github.com/adiom-data/grpcmcpEnsure the go bin directory is in your PATH. -
In a terminal, run the example grpc server
go run example/main.go. This will start a grpc health service on port 8090 with server reflection enabled. Note that this runs on the default port that grpcmcp will connect to. -
SSE Transport In another terminal, run
grpcmcp --hostport=localhost:3000 --reflect. Specifyinghostportwill use SSE. The SSE endpoint will be served athttp://localhost:3000/sse. -
STDIN Transport Set up the MCP config. e.g.
"grpcmcp": {
"command": "grpcmcp",
"args": ["--reflect"]
}
grpcmcp --help for a full list of options.
-
hostportstring - When set, use SSE, and this serves as the server host:port. -
descriptorsstring - Specify file location of the protobuf definitions generated frombuf build -o protos.pborprotoc --descriptor_set_out=protos.pbinstead of using gRPC reflection. -
reflect- If set, use reflection to retrieve gRPC endpoints instead of descriptor file. -
urlstring - Specify the url of the backend server. -
servicesstring - Comma separated list of fully qualified gRPC service names to filter. -
bearerstring - Token to attach in anAuthorization: Bearerheader. -
bearer-envstring - Environment variable for token to attach in anAuthorization: Bearerheader. Overridesbearer. -
headerstring (repeatable) - Headers to add inKey: Valueformat. -
short-names- Use short tool names (ServiceName__MethodNameinstead of full package path). Falls back to the full path if two services share the same simple name. -
very-short-names- Use very short tool names (MethodNameonly, no service prefix). Falls back toServiceName__MethodNameif method names collide across services, and to the full path if service names also collide. -
require-method-optionstring - Only expose methods where a specific proto method option matches a given value. Format:fieldNumber:value(e.g.50003:1). This filters gRPC methods by checking the raw proto extension field on the method descriptor, so no generated code for the option is needed.
Join our Discord at https://discord.gg/hDjx3DehwG