mcp

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPHandler added in v0.2.6

func NewHTTPHandler(options HTTPOptions) (http.Handler, error)

NewHTTPHandler is the embeddable form used by tests and custom servers.

func Serve

func Serve(ctx context.Context, in io.Reader, out io.Writer, options Options) error

Serve runs until stdin reaches EOF, the context is cancelled between messages, or a fatal framing/write error occurs. It never writes diagnostics or logs to the protocol output.

func ServeStreamableHTTP added in v0.2.6

func ServeStreamableHTTP(ctx context.Context, options HTTPOptions) error

ServeStreamableHTTP exposes the read-only MCP tools over JSON responses on MCP's Streamable HTTP transport. It intentionally does not offer browser CORS or legacy SSE GET streams; clients use POST plus Mcp-Session-Id.

Types

type HTTPOptions added in v0.2.6

type HTTPOptions struct {
	OutDir          string
	Version         string
	Address         string
	Path            string
	APIKey          string
	MaxMessageBytes int
}

type Options

type Options struct {
	OutDir          string
	Version         string
	MaxMessageBytes int
}

Options configures the dependency-free stdio MCP server.

Jump to

Keyboard shortcuts

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