Documentation
¶
Overview ¶
Package server provides MCP transport serving (stdio/http/both) and the Transport type shared across acidsailor MCP servers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNilServer = errors.New("nil mcp server") ErrInvalidTransport = errors.New("invalid transport") ErrInvalidAddr = errors.New("invalid server address") ErrServe = errors.New("serve") ErrShutdown = errors.New("shutdown") )
Sentinels for server failures, wrapped with detail at the entry point.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Server)
Option configures a Server.
func WithAddr ¶
WithAddr sets the HTTP listen address (default ":8080"). Ignored for the stdio transport.
func WithReadHeaderTimeout ¶
WithReadHeaderTimeout sets the HTTP server's read-header timeout (default 30s).
func WithShutdownTimeout ¶
WithShutdownTimeout sets the HTTP graceful-shutdown timeout (default 30s).
func WithTransport ¶
WithTransport sets the transport (default Stdio).
type Server ¶
type Server struct {
MCP *mcp.Server // escape hatch to the underlying server
// contains filtered or unexported fields
}
Server serves an mcp.Server over the configured transport(s).
type Transport ¶
type Transport string
Transport selects the MCP transport mechanism.
const ( Stdio Transport = "stdio" // stdin/stdout HTTP Transport = "http" // streamable HTTP Both Transport = "both" // stdio + HTTP concurrently )
Supported transports.
func ParseTransport ¶
ParseTransport parses s into a Transport, wrapping ErrInvalidTransport for an unsupported value.
func (*Transport) UnmarshalText ¶
UnmarshalText lets text-based config loaders (env, flag, json) parse a Transport.