Documentation
¶
Index ¶
- func NewSSEFactory(name string, version string, addr string, sseOptions []SSEOption, ...) scene.SceneDefinition
- func NewStreamableHTTPFactory(name string, version string, addr string, httpOptions []StreamableHTTPOption, ...) scene.SceneDefinition
- func WithResourceHandlerMiddleware(mw server.ResourceHandlerMiddleware) server.ServerOption
- func WithToolFilter(filter server.ToolFilterFunc) server.ServerOption
- func WithToolHandlerMiddleware(mw server.ToolHandlerMiddleware) server.ServerOption
- type HTTPServerBuilder
- type McpApp
- type SSEFactory
- type SSEOption
- type SSEScene
- type ServerOption
- type StreamableHTTPFactory
- type StreamableHTTPOption
- func WithStreamableHTTPContextFunc(fn server.HTTPContextFunc) StreamableHTTPOption
- func WithStreamableHTTPDisableStreaming(disable bool) StreamableHTTPOption
- func WithStreamableHTTPEndpointPath(endpointPath string) StreamableHTTPOption
- func WithStreamableHTTPHandlerOption(option server.StreamableHTTPOption) StreamableHTTPOption
- func WithStreamableHTTPServer(builder HTTPServerBuilder) StreamableHTTPOption
- func WithStreamableHTTPStateful(stateful bool) StreamableHTTPOption
- func WithStreamableHTTPStateless(stateless bool) StreamableHTTPOption
- func WithStreamableHTTPTLS(certFile, keyFile string) StreamableHTTPOption
- type StreamableHTTPScene
- type StructureArray
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 WithResourceHandlerMiddleware ¶
func WithResourceHandlerMiddleware(mw server.ResourceHandlerMiddleware) server.ServerOption
func WithToolFilter ¶
func WithToolFilter(filter server.ToolFilterFunc) server.ServerOption
func WithToolHandlerMiddleware ¶
func WithToolHandlerMiddleware(mw server.ToolHandlerMiddleware) server.ServerOption
Types ¶
type HTTPServerBuilder ¶ added in v0.4.0
HTTPServerBuilder creates the HTTP server that owns handler.
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.
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
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) ListAppNames ¶
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.
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
type StructureArray ¶
func WrapArray ¶
func WrapArray[T any](array []T) StructureArray[T]