{"modulePath":"github.com/gkdis6/opsgate","version":"v0.8.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpserver\n\nPackage httpserver serves authenticated MCP over Streamable HTTP.\n\n## Functions\n\n```go\nfunc Handler(cfg config.Config, o Options) http.Handler\n```\nHandler returns the root handler for cfg.\n\n```go\nfunc Serve(ctx context.Context, cfg config.Config, h http.Handler) error\n```\nServe listens on cfg.HTTP.Listen until ctx is done, then shuts down gracefully.\n\n```go\nfunc ServeMetrics(ctx context.Context, addr string) (func(), error)\n```\nServeMetrics serves only /metrics on addr until ctx is done or the returned function is called. It is a separate listener so the metrics never share the public origin, its Host check or its authentication.\n\n## Types\n\n```go\ntype Options struct {\n\tServer   *mcp.Server\n\tVerifier auth.TokenVerifier\n\t// AuthorizationServers are advertised in protected resource metadata.\n\tAuthorizationServers []string\n\t// Routes registers extra handlers (authorization server, approvals).\n\tRoutes []func(*http.ServeMux)\n}\n```\nOptions are the parts assembled by main.\n\n","path":"github.com/gkdis6/opsgate/internal/httpserver","name":"httpserver","synopsis":"Package httpserver serves authenticated MCP over Streamable HTTP.","isRedistributable":true}
