grpc-gateway

Go plugin for protoc that generates a reverse-proxy server translating RESTful JSON API calls into gRPC calls. Add HTTP annotations to .proto files and grpc-gateway generates a REST endpoint that proxies to the gRPC service. Also generates OpenAPI 2.0/3.0 docs. Used when you need both gRPC (for microservice-to-microservice) and REST (for public APIs, browsers) from the same service definition.

Evaluated Mar 06, 2026 (0d ago) v2.x
Homepage ↗ Repo ↗ Developer Tools go grpc rest http gateway protobuf openapi reverse-proxy transcoding
⚙ Agent Friendliness
62
/ 100
Can an agent use this?
🔒 Security
86
/ 100
Is it safe for agents?
⚡ Reliability
83
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
80
Error Messages
78
Auth Simplicity
85
Rate Limits
90

🔒 Security

TLS Enforcement
90
Auth Strength
85
Scope Granularity
82
Dep. Hygiene
85
Secret Handling
88

TLS configuration inherited from gRPC server. Authentication interceptors apply to both gRPC and REST via the proxy. CORS must be configured separately on the HTTP server.

⚡ Reliability

Uptime/SLA
88
Version Stability
82
Breaking Changes
80
Error Recovery
82
AF Security Reliability

Best When

You have existing gRPC services that need to be exposed as REST APIs for external clients or browsers without maintaining a separate REST implementation.

Avoid When

You don't use gRPC, or your REST API has semantics that can't be expressed with protobuf HTTP annotations.

Use Cases

  • Expose gRPC services as REST APIs for browser clients and external consumers without writing two separate service implementations
  • Generate OpenAPI documentation automatically from protobuf service definitions with grpc-gateway's swagger plugin
  • Support both gRPC and REST protocols from the same Go service by running grpc-gateway alongside the gRPC server
  • Enable agent systems to call internal gRPC microservices via REST without requiring gRPC client setup
  • Implement HTTP/JSON → gRPC transcoding for mobile and web clients that can't use gRPC directly

Not For

  • Services that only need REST — plain HTTP frameworks (gin, chi, echo) are simpler without gRPC overhead
  • Teams not using protobuf/gRPC — grpc-gateway requires proto definitions as the source of truth
  • Complex REST APIs with fine-grained HTTP semantics — protobuf HTTP annotations can't express all REST patterns

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Code generation plugin. Authentication is implemented in the gRPC service's interceptors or grpc-gateway's middleware.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

BSD license. Part of the grpc-ecosystem organization.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Documented

Known Gotchas

  • Proto HTTP annotations (option google.api.http = {get: "/v1/{name=...}"}) require importing google/api/annotations.proto — missing import causes protoc compilation errors
  • grpc-gateway runs as a separate HTTP server alongside the gRPC server — requires managing two server ports and startup ordering
  • gRPC metadata is not automatically forwarded as HTTP headers — configure IncomingHeaderMatcher and OutgoingHeaderMatcher for header passthrough
  • Streaming RPCs (server-streaming, client-streaming) have limited REST support — grpc-gateway can handle server streaming as chunked HTTP but bidirectional streaming is not supported
  • OpenAPI generation requires protoc-gen-openapiv2 plugin separately from grpc-gateway — version pinning between plugins is important for consistent output
  • URL path parameters in HTTP annotations must match proto field names — mismatches cause runtime routing failures that are hard to debug

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for grpc-gateway.

$99

Scores are editorial opinions as of 2026-03-06.

5220
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered