mcpserver

package
v0.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 19 Imported by: 0

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

func (service *Service) Close() error

Close rejects new work, terminates active sessions, and waits for in-flight requests up to the configured shutdown deadline.

func (*Service) RunStdio

func (service *Service) RunStdio(ctx context.Context) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL