grpcmcp
grpcmcp is a Model Context Protocol server that acts as a proxy to a gRPC backend, supporting features like service reflection and secure connection options. It is designed for ease of use with customizable options for backend communication.
grpcmcp
A simple MCP server that will proxy to a grpc backend based on a provided descriptors file or using reflection.
Quick Start
-
Install the binary:
go install .
orgo install github.com/adiom-data/grpcmcp
Ensure 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
. Specifyinghostport
will 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"]
}
Options / Features
grpcmcp --help
for a full list of options.
-
hostport
string - When set, use SSE, and this serves as the server host:port. -
descriptors
string - Specify file location of the protobuf definitions generated frombuf build -o protos.pb
orprotoc --descriptor_set_out=protos.pb
instead of using gRPC reflection. -
reflect
- If set, use reflection to retrieve gRPC endpoints instead of descriptor file. -
url
string - Specify the url of the backend server. -
services
string - Comma separated list of fully qualified gRPC service names to filter. -
bearer
string - Token to attach in anAuthorization: Bearer
header. -
bearer-env
string - Environment variable for token to attach in anAuthorization: Bearer
header. Overridesbearer
. -
header
string (repeatable) - Headers to add inKey: Value
format.
Help
Join our Discord at https://discord.gg/hDjx3DehwG