Production
Build the binary
Section titled “Build the binary”go build -ldflags "-w -s" -o mcp-go-mssqlThe -w -s flags strip debug information and reduce binary size.
Environment variables
Section titled “Environment variables”MSSQL_SERVER=prod-server.database.windows.netMSSQL_DATABASE=ProductionDBMSSQL_USER=prod_userMSSQL_PASSWORD=strong_passwordDEVELOPER_MODE=falseMSSQL_READ_ONLY=trueMSSQL_WHITELIST_TABLES=temp_ai,v_temp_iaProduction checklist
Section titled “Production checklist”-
DEVELOPER_MODE=false -
MSSQL_READ_ONLY=true(recommended for AI) - Valid TLS certificates on SQL Server
- Database user with minimal permissions
- Restrictive permissions on
.envfiles (600) -
.envexcluded from version control - Binary compiled with stripping flags
- Security log monitoring configured
- Firewall configured to restrict SQL port access
Production security
Section titled “Production security”- TLS encryption is mandatory and cannot be disabled
- Self-signed certificates are rejected (
trustservercertificate=false) - Errors show generic messages to the client
- Technical details only appear in internal logs