Transport Security·gRPC·mTLS

MCP server gRPC transport security: mTLS, interceptors, protobuf validation, and streaming auth

gRPC is increasingly used as the transport layer for high-performance MCP servers — especially in service mesh environments where HTTP/1.1 overhead is unacceptable. The binary protocol, bidirectional streaming, and protobuf schema enforcement offer performance and type safety advantages, but they also introduce a distinct security surface that differs from REST/HTTP MCP transports.

gRPC transport vs. HTTP transport: the security differences

HTTP-transport MCP servers are protected by the same tooling developers use for web APIs: TLS termination at a load balancer, JSON schema validation, HTTP middleware for auth. gRPC transports use HTTP/2 framing, binary protobuf encoding, and persistent connections — which changes the security picture in several ways:

Mutual TLS for MCP gRPC servers

Standard TLS authenticates the server to the client. Mutual TLS (mTLS) also authenticates the client to the server — the client presents a certificate, and the server validates it against a trusted CA. For MCP servers in service mesh environments, mTLS provides workload identity: the certificate's Subject Alternative Name (SAN) identifies which service is calling, removing the need for a separate application-layer auth token for service-to-service calls.

In a service mesh like Istio or Linkerd, mTLS is enforced at the sidecar proxy level without changes to the MCP server code. For self-managed gRPC servers, configure TLS credentials with a client certificate requirement in your gRPC server options. Certificate rotation is critical: don't issue server certificates with lifetimes longer than 90 days. For workload certificates in a mesh, use short-lived certificates (24 hours or less) issued by SPIFFE/SPIRE.

Auth interceptors: validate on every RPC, not just connection

gRPC interceptors (the equivalent of HTTP middleware) run before or after each RPC method. A server-side unary interceptor validates the auth token on every unary RPC call. A streaming interceptor validates on stream establishment. The common mistake: auth is validated only at connection establishment, so a token that's revoked mid-connection continues to work until the connection is closed.

Correct pattern: validate the token on every RPC call in the unary interceptor. For streaming RPCs, validate at stream open and periodically re-check on each received message. For performance-sensitive servers, cache validation results keyed by token hash with a TTL equal to the token's remaining validity — this avoids a round-trip to the auth server on every call while still catching revocations on the next cache miss.

Protobuf deserialization security

Protobuf is generally safer than JSON deserialization — there's no dynamic type coercion, and the schema defines which fields exist. But protobuf has its own attack surface:

Disable gRPC reflection in production

gRPC reflection (grpc.reflection.v1alpha.ServerReflection) is invaluable during development — tools like grpcurl use it to enumerate your service schema without a proto file. In production, it's an intelligence-gathering tool for attackers: they can list every method, every field name, and every service without any prior knowledge of your API.

Register the reflection service only when an environment variable or build tag indicates development mode. Never register it in production images. Verify with: grpcurl -plaintext localhost:50051 list — if that returns your service list without auth, reflection is enabled.

TLS certificate validation in gRPC clients

When an MCP server acts as a gRPC client (proxying to an upstream gRPC service), TLS certificate validation must be enabled. The common mistake is using grpc.credentials.createInsecure() for internal services because "they're on the same network." For internal services using a private CA, pass the CA certificate to grpc.credentials.createSsl(caCert) — never disable certificate validation with checkServerIdentity: () => undefined.

Disabling certificate validation defeats the entire purpose of TLS. It means any network-path attacker between your MCP server and the upstream gRPC service can perform a MITM without detection — intercepting tool results and injecting prompt injection payloads into the response stream.

What SkillAudit flags for gRPC MCP servers

When SkillAudit analyzes a gRPC-transport MCP server, it checks for:

These findings appear under the Security axis in the SkillAudit report. A gRPC MCP server that passes all these checks is significantly harder to exploit than one that relies on connection-level auth alone.

Audit your gRPC MCP server → Paste your GitHub URL for a free security audit including transport-layer and auth interceptor analysis