Skip to content

Commit f2d2009

Browse files
Loschcodeclaude
andcommitted
docs: add complete production-ready MCP server example
Added a comprehensive example in examples/complete-server/ that demonstrates all production patterns for building secure, observable MCP servers. Features demonstrated: - Bearer token authentication with middleware - JSON-RPC 2.0 compliant error handling - Request logging for all MCP protocol messages - Health check endpoints for Kubernetes - CORS configuration - Proper notifications/initialized handling - Response recording for debugging auth failures - Dual gRPC/HTTP server architecture - Production deployment patterns The example is fully documented with: - Comprehensive README with testing instructions - Common issues and solutions section - Kubernetes deployment manifests - Architecture diagrams - Step-by-step testing guide This provides teams with a complete reference implementation for building production MCP servers. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent fddf7df commit f2d2009

6 files changed

Lines changed: 774 additions & 0 deletions

File tree

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,24 @@ curl -s http://localhost:8090/ \
151151
- Set timeouts on the HTTP server and gRPC client to avoid hanging tool calls.
152152
- Use structured logging by passing `WithRequestLogger` in your MCP mux.
153153

154+
## Complete Production Example
155+
156+
For a comprehensive, production-ready implementation showing all the best practices, see:
157+
158+
**[examples/complete-server](./examples/complete-server/README.md)**
159+
160+
This example demonstrates:
161+
- Bearer token authentication with JSON-RPC error handling
162+
- Request logging for all MCP protocol messages
163+
- Health check endpoints for Kubernetes
164+
- CORS configuration
165+
- Proper handling of `notifications/initialized`
166+
- Response recording for auth failure debugging
167+
- gRPC ↔ HTTP dual server architecture
168+
- Kubernetes deployment patterns
169+
170+
Perfect for teams building production MCP servers.
171+
154172
## Example client (end-to-end)
155173

156174
This repo includes a tiny MCP client that spawns the example server and calls the `echo` tool:
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Binaries
2+
complete-server
3+
*.exe
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Generated code
9+
*.pb.go
10+
*_mcp.pb.go
11+
12+
# Go build artifacts
13+
go.sum

0 commit comments

Comments
 (0)