Skip to content

Add grpc transport #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rustycl0ck
Copy link

@rustycl0ck rustycl0ck commented Jun 1, 2025

As the title says, this PR adds support for providing gRPC as a transport. This can help in offloading the authentication and authorization parts to the transport, and thus should allow a wider range of options when considering remote hosting of MCP servers.
It also provides streaming support by default (because gRPC supports bidirectional streaming natively).

@rustycl0ck rustycl0ck force-pushed the feature/add-grpc-transport branch from c39fb57 to 257d413 Compare June 1, 2025 11:42
@rustycl0ck rustycl0ck marked this pull request as ready for review June 1, 2025 11:43
@Copilot Copilot AI review requested due to automatic review settings June 1, 2025 11:43
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for gRPC as a transport for MCP servers, enabling offloading of authentication and authorization while providing extensive examples and tests.

  • Adds generated proto files and updated gRPC service definitions
  • Implements and tests the gRPC transport in server and client examples
  • Updates module dependencies and documentation to support gRPC usage

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
transport/grpc/protogen/jsonrpc/jsonrpc_grpc.pb.go Generated gRPC client/server code for JSONRPCService
transport/grpc/protogen/jsonrpc/jsonrpc.pb.go Generated protocol buffer code for JSONRPC messages
transport/grpc/jsonrpc.proto Defines the JSONRPCService and message schema
transport/grpc/grpc_test.go Introduces tests for various gRPC server transport behaviors
transport/grpc/grpc.go Implements gRPC transport including message conversions and stream handling
go.mod Updates dependencies and Go version/toolchain requirements
examples/grpc_example/server/main.go Example server configuration using the gRPC transport
examples/grpc_example/client/main.go Example client demonstrating how to send and receive gRPC messages
examples/grpc_example/README.md Updated documentation and usage instructions for the gRPC transport

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant