Documentation
¶
Overview ¶
Package chassis provides a unified server exposing HTTP and MCP on the same port.
Two listeners on the same port:
- TCP → HTTP/1.1 + HTTP/2 (TLS) — curl-friendly REST API + static files
- UDP → QUIC with ALPN demux: "h3" → HTTP/3 (same handler as TCP) "mcp-quic-v1" → MCP JSON-RPC over QUIC stream
The HTTP responses include an Alt-Svc header advertising HTTP/3, so HTTP/2 clients that support it can upgrade transparently.
In development mode, a self-signed ECDSA P-256 cert is generated automatically. In production, supply cert/key files via config.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DevelopmentTLSConfig ¶
DevelopmentTLSConfig generates a self-signed TLS config with dual ALPN: "h3" for HTTP/3 and the MCP protocol for MCP over QUIC.
func GenerateSelfSignedCert ¶
func GenerateSelfSignedCert() (tls.Certificate, error)
GenerateSelfSignedCert generates an ECDSA P-256 self-signed cert for development. NOT for production — use Let's Encrypt or a real CA.
Types ¶
type Config ¶
type Config struct {
Addr string // Listen address (e.g. ":8080") — TCP + UDP same port
TLS *tls.Config // nil = auto-generate self-signed
CertFile string // production cert path
KeyFile string // production key path
Handler http.Handler // HTTP handler (mux with API + static)
MCPServer *mcp.Server // MCP server (nil = MCP disabled)
Logger *slog.Logger
// MCPHandlerOpts are passed to mcpquic.NewHandler.
MCPHandlerOpts []mcpquic.HandlerOption
}
Config holds configuration for the chassis server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the unified chassis. It runs: - HTTP/1.1+HTTP/2 on TCP (curl-friendly, API first) - HTTP/3 + MCP-over-QUIC on UDP (same port, ALPN demux)