Update on gRPC Protobuf MVP Implementation for Effect Ecosystem

Hey 👋

Just a quick update on the effect-🚀Inquiry About gRPC Protobuf Support in Effect Library:

I had some spare time to work on this and came up with an MVP: effect-grpc on GitHub

It's a minimal runnable implementation for both client & server (unary calls only for now, but more coming soon)

By design, it's a thin wrapper around connect-es (gRPC implementation) and protobuf-es
(protobuf codegen) - well-known, battle-tested tools. It provides a nice DX for the Effect ecosystem.

It follows a protobuf-first approach: you define your API in .proto files, then generate Effect services from them. This is the only practical way to use gRPC when you have different services written in different languages — everyone shares the same protocol definition.

// Implement the service
const HelloServiceLive: effectProto.HelloService<HandlerContext> = {
  sayHello(request: proto.HelloRequest, ctx: HandlerContext) {
    return Effect.succeed({
      message: `Hello, ${request.name}!`
    });
  }
};

// Create the service layer
const helloServiceLayer = effectProto.HelloService.liveLayer(HelloServiceLive)(HelloServiceTag);

// Build and run the gRPC server
const program = Effect.gen(function* () {
  const helloService = yield* HelloServiceTag;

  const server: EffectGrpcServer.GrpcServer<"HelloService"> = 
    EffectGrpcServer.GrpcServerBuilder()
      .withService(helloService)
      .build();

  return yield* server.run();
});


Would love to hear your feedback! The PR is here. Consider inspecting example package.

You can also install it using mvp tag
pnpm add @dr_nikson/effect-grpc@mvp
Was this page helpful?