ScriptsMay 23, 2026·3 min read

ConnectRPC — Simple Browser-Compatible RPC over HTTP

ConnectRPC is a slim RPC framework that generates type-safe clients and servers from Protobuf definitions, speaking gRPC, gRPC-Web, and its own HTTP-friendly Connect protocol through a single codebase.

Agent ready

This asset can be read and installed directly by agents

TokRepo exposes a universal CLI command, install contract, metadata JSON, adapter-aware plan, and raw content links so agents can judge fit, risk, and next actions.

Needs Confirmation · 64/100Policy: confirm
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
ConnectRPC Overview
Universal CLI install command
npx tokrepo install 2d7ac20c-5661-11f1-9bc6-00163e2b0d79

Introduction

ConnectRPC simplifies RPC by building on standard HTTP. It generates type-safe clients and handlers from Protobuf schemas, and each server simultaneously speaks three protocols—Connect (simple HTTP), gRPC, and gRPC-Web—so browsers, mobile apps, and backend services all hit the same endpoint.

What ConnectRPC Does

  • Generates type-safe client and server code from Protobuf service definitions
  • Serves the Connect, gRPC, and gRPC-Web protocols on a single port and handler
  • Works with net/http in Go, requiring no special HTTP server or mux
  • Supports unary, server-streaming, client-streaming, and bidirectional streaming RPCs
  • Provides interceptors for authentication, logging, and observability middleware

Architecture Overview

ConnectRPC generates handler and client code via protoc-gen-connect-go (Go), @connectrpc/connect (TypeScript), or plugins for other languages. Handlers register as standard HTTP handlers, detecting the protocol from each request's Content-Type header. The Connect protocol uses simple HTTP POST with JSON or Protobuf bodies—curl-friendly without special tooling. gRPC and gRPC-Web requests on the same endpoint are handled transparently.

Installation & Configuration

  • Install the Buf CLI and protoc-gen-connect-go for Go code generation
  • Use @connectrpc/connect and @connectrpc/connect-web for TypeScript clients
  • Register handlers on any http.ServeMux or router—no proprietary server needed
  • Configure TLS and HTTP/2 via standard Go net/http or your preferred reverse proxy
  • Add interceptors in the handler or client constructor for cross-cutting concerns

Key Features

  • Three protocols (Connect, gRPC, gRPC-Web) from a single handler implementation
  • Browser-native: the Connect protocol works with fetch() without a proxy
  • curl-friendly: curl -X POST --json works against Connect endpoints
  • Standard HTTP middleware compatibility (no gRPC-specific interceptor chains)
  • Streaming support across all three protocols including bidirectional

Comparison with Similar Tools

  • gRPC-Go — requires grpc.NewServer() and HTTP/2; ConnectRPC uses net/http and adds browser support
  • Twirp — Protobuf-based RPC by Twitch; unary only, no streaming or gRPC compatibility
  • gRPC-Web — requires an Envoy or grpc-web proxy for browsers; ConnectRPC serves browsers directly
  • tRPC — TypeScript-native RPC without Protobuf; ConnectRPC provides cross-language schemas
  • REST/OpenAPI — manual endpoint design; ConnectRPC auto-generates clients and servers from a schema

FAQ

Q: Can I call ConnectRPC services from a browser? A: Yes. The Connect protocol uses standard HTTP and works natively with fetch(). The TypeScript client library handles serialization.

Q: Do I need Envoy or a special proxy? A: No. ConnectRPC handlers serve gRPC, gRPC-Web, and Connect directly on standard HTTP, eliminating the need for a translation proxy.

Q: Which languages does ConnectRPC support? A: Go, TypeScript/JavaScript, Swift, and Kotlin have official client and server libraries. The Connect protocol is simple enough for any HTTP client.

Q: Is ConnectRPC compatible with existing gRPC services? A: Yes. ConnectRPC clients can call standard gRPC servers, and ConnectRPC servers accept standard gRPC clients.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets