Building an MCP Server in Go with Code Mode: From 1.17M Tokens to 1,000
Cloudflare put its 2,500+ API endpoints behind one MCP server with two tools, search + execute, and cut input tokens by 99.9%. The pattern in Go.
REST, gRPC, and GraphQL API design patterns, contracts, and best practices.
Cloudflare put its 2,500+ API endpoints behind one MCP server with two tools, search + execute, and cut input tokens by 99.9%. The pattern in Go.
AI agents calling tools via MCP create new attack surfaces: prompt injection through tool responses, credential leakage, and unauthorized execution.
Handle unpredictable JSON in Go: map[string]any, json.RawMessage, type switches, and defensive patterns for shifting schemas.
Production LLM API patterns: streaming, function calling, retries, token budgets, cost optimization, and observability for backend engineers.
Production REST APIs with Spring Boot: JPA, Bean Validation, global exception handling, MockMvc testing, and scalable patterns.
Handler, service, and repository layers. Custom error types. Middleware chains. Health probes. The patterns for Go APIs handling millions of requests.
Five rate limiting algorithms, their trade-offs, how to distribute them across a fleet, and client-side backoff that works.
REST, gRPC, and GraphQL solve different client problems. A decision guide for when each one wins, and what running all three side by side costs.
gRPC and Protobuf: binary serialization, unary and streaming RPCs, Go implementation, and when to choose gRPC over REST.