Documentation
¶
Overview ¶
Package mcpserver exposes OwlMail's mailbox through a read-only MCP server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
SessionTimeout time.Duration
ShutdownTimeout time.Duration
WebBaseURL string
MaxWaiters int
MaxWaitersPerSession int
MaxWaitTimeout time.Duration
}
Options configures the read-only MCP endpoint.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service owns the SDK server, dual-era Streamable HTTP handlers, and active legacy sessions.
func New ¶
func New(mailbox *mailserver.MailServer, options Options) (*Service, error)
New creates a read-only MCP service backed by the existing mailbox store.
func (*Service) Close ¶
Close rejects new work, terminates active sessions, and waits for in-flight requests up to the configured shutdown deadline.
func (*Service) RunStdio ¶
RunStdio serves the same read-only tools, resources, and prompts over the official MCP stdio transport until the context is canceled or stdin closes.
func (*Service) ServeHTTP ¶
func (service *Service) ServeHTTP(writer http.ResponseWriter, request *http.Request)
ServeHTTP serves both MCP eras on the same Streamable HTTP endpoint. Modern 2026-07-28 requests carry their version on every request and are stateless; legacy clients retain their initialize handshake and server-side session.