Transport configuration — discriminated union by mode.
mode
TypeScript narrows the available options based on the selected mode:
{ mode: 'stdio' }
{ mode: 'http', port: 8000, ... }
{ mode: 'https', port: 8443, tls: { ... }, ... }
// Stdiotransport: { mode: 'stdio' }// HTTPtransport: { mode: 'http', port: 8000, host: '0.0.0.0' }// HTTPStransport: { mode: 'https', port: 8443, tls: { certPath: '/certs/cert.pem', keyPath: '/certs/key.pem' } } Copy
// Stdiotransport: { mode: 'stdio' }// HTTPtransport: { mode: 'http', port: 8000, host: '0.0.0.0' }// HTTPStransport: { mode: 'https', port: 8443, tls: { certPath: '/certs/cert.pem', keyPath: '/certs/key.pem' } }
Transport configuration — discriminated union by
mode.TypeScript narrows the available options based on the selected mode:
{ mode: 'stdio' }— no additional options{ mode: 'http', port: 8000, ... }— flat HTTP options{ mode: 'https', port: 8443, tls: { ... }, ... }— flat HTTPS options with required TLS