mcp

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSSEFactory added in v0.4.0

func NewSSEFactory(
	name string,
	version string,
	addr string,
	sseOptions []SSEOption,
	serverOptions []ServerOption,
) scene.SceneDefinition

NewSSEFactory declares an MCP SSE scene.

func NewStreamableHTTPFactory added in v0.4.0

func NewStreamableHTTPFactory(
	name string,
	version string,
	addr string,
	httpOptions []StreamableHTTPOption,
	serverOptions []ServerOption,
) scene.SceneDefinition

NewStreamableHTTPFactory declares an MCP Streamable HTTP scene.

func WithToolFilter

func WithToolFilter(filter server.ToolFilterFunc) server.ServerOption

Types

type HTTPServerBuilder added in v0.4.0

type HTTPServerBuilder func(handler http.Handler) *http.Server

HTTPServerBuilder creates the HTTP server that owns handler.

type McpApp

type McpApp interface {
	scene.Application
	Register(server *server.MCPServer) error
}

type SSEFactory added in v0.4.0

type SSEFactory struct {
	Name          string
	Version       string
	Addr          string
	SSEOptions    []SSEOption
	ServerOptions []ServerOption
}

SSEFactory builds an MCP SSE scene from MCP applications.

func (SSEFactory) Build added in v0.4.0

func (f SSEFactory) Build(scope *registry.Scope, apps []McpApp) (scene.Scene, error)

type SSEOption

type SSEOption func(*sseOptions)

SSEOption configures an SSE handler or its Scene-owned HTTP server.

func WithSSEContextFunc

func WithSSEContextFunc(fn server.SSEContextFunc) SSEOption

func WithSSEHTTPServer added in v0.4.0

func WithSSEHTTPServer(builder HTTPServerBuilder) SSEOption

WithSSEHTTPServer configures the HTTP server around the SSE handler.

func WithSSEHandlerOption added in v0.4.0

func WithSSEHandlerOption(option server.SSEOption) SSEOption

WithSSEHandlerOption applies an mcp-go option to the SSE handler. HTTP server ownership remains with the Scene.

type SSEScene

type SSEScene struct {
	// contains filtered or unexported fields
}

func (*SSEScene) ImplName

func (m *SSEScene) ImplName() scene.ImplName

func (*SSEScene) ListAppNames

func (m *SSEScene) ListAppNames() []string

func (*SSEScene) Start

func (m *SSEScene) Start() error

func (*SSEScene) Stop

func (m *SSEScene) Stop(ctx context.Context) error

type ServerOption

type ServerOption = server.ServerOption

type StreamableHTTPFactory added in v0.4.0

type StreamableHTTPFactory struct {
	Name          string
	Version       string
	Addr          string
	HTTPOptions   []StreamableHTTPOption
	ServerOptions []ServerOption
}

StreamableHTTPFactory builds an MCP Streamable HTTP scene from MCP applications.

func (StreamableHTTPFactory) Build added in v0.4.0

func (f StreamableHTTPFactory) Build(scope *registry.Scope, apps []McpApp) (scene.Scene, error)

type StreamableHTTPOption added in v0.3.7

type StreamableHTTPOption func(*streamableHTTPOptions)

StreamableHTTPOption configures a Streamable HTTP handler or transport.

func WithStreamableHTTPContextFunc added in v0.3.7

func WithStreamableHTTPContextFunc(fn server.HTTPContextFunc) StreamableHTTPOption

func WithStreamableHTTPDisableStreaming added in v0.3.7

func WithStreamableHTTPDisableStreaming(disable bool) StreamableHTTPOption

func WithStreamableHTTPEndpointPath added in v0.3.7

func WithStreamableHTTPEndpointPath(endpointPath string) StreamableHTTPOption

func WithStreamableHTTPHandlerOption added in v0.4.0

func WithStreamableHTTPHandlerOption(option server.StreamableHTTPOption) StreamableHTTPOption

WithStreamableHTTPHandlerOption applies an mcp-go option to the Streamable HTTP handler. Server, TLS, and endpoint options must use the Scene options.

func WithStreamableHTTPServer added in v0.4.0

func WithStreamableHTTPServer(builder HTTPServerBuilder) StreamableHTTPOption

WithStreamableHTTPServer configures the HTTP server around the routed MCP handler.

func WithStreamableHTTPStateful added in v0.3.7

func WithStreamableHTTPStateful(stateful bool) StreamableHTTPOption

func WithStreamableHTTPStateless added in v0.3.7

func WithStreamableHTTPStateless(stateless bool) StreamableHTTPOption

func WithStreamableHTTPTLS added in v0.4.0

func WithStreamableHTTPTLS(certFile, keyFile string) StreamableHTTPOption

WithStreamableHTTPTLS configures the certificate used by the Scene listener.

type StreamableHTTPScene added in v0.3.7

type StreamableHTTPScene struct {
	// contains filtered or unexported fields
}

func (*StreamableHTTPScene) ImplName added in v0.3.7

func (m *StreamableHTTPScene) ImplName() scene.ImplName

func (*StreamableHTTPScene) ListAppNames added in v0.3.7

func (m *StreamableHTTPScene) ListAppNames() []string

func (*StreamableHTTPScene) Start added in v0.3.7

func (m *StreamableHTTPScene) Start() error

func (*StreamableHTTPScene) Stop added in v0.3.7

type StructureArray

type StructureArray[T any] struct {
	Result []T `json:"result"`
	Length int `json:"length"`
}

func WrapArray

func WrapArray[T any](array []T) StructureArray[T]

Jump to

Keyboard shortcuts

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