Documentation
¶
Index ¶
- type SSEConfig
- type Server
- func (s *Server) GetMCPServer() *server.MCPServer
- func (s *Server) RegisterResource(resource mcp.Resource, handler server.ResourceHandlerFunc) error
- func (s *Server) RegisterTool(tool mcp.Tool, handler server.ToolHandlerFunc) error
- func (s *Server) Start(ctx context.Context) error
- func (s *Server) WithSSEConfig(config *SSEConfig) *Server
- func (s *Server) WithStreamableHTTPConfig(config *StreamableHTTPConfig) *Server
- func (s *Server) WithTransport(transport TransportType) *Server
- type StreamableHTTPConfig
- type TransportType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SSEConfig ¶
type SSEConfig struct {
Addr string
BaseURL string
StaticBasePath string
KeepAliveInterval time.Duration
}
SSEConfig contains configuration for SSE transport.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the MCP server instance.
func (*Server) GetMCPServer ¶
GetMCPServer returns the underlying MCP server instance.
func (*Server) RegisterResource ¶
RegisterResource registers a resource with the MCP server.
func (*Server) RegisterTool ¶
RegisterTool registers a tool with the MCP server.
func (*Server) WithSSEConfig ¶
WithSSEConfig sets the SSE configuration for the server.
func (*Server) WithStreamableHTTPConfig ¶
func (s *Server) WithStreamableHTTPConfig(config *StreamableHTTPConfig) *Server
WithStreamableHTTPConfig sets the Streamable HTTP configuration for the server.
func (*Server) WithTransport ¶
func (s *Server) WithTransport(transport TransportType) *Server
WithTransport sets the transport type for the server.
type StreamableHTTPConfig ¶
type StreamableHTTPConfig struct {
Addr string
EndpointPath string
HeartbeatInterval time.Duration
Stateless bool
}
StreamableHTTPConfig contains configuration for Streamable HTTP transport.
type TransportType ¶
type TransportType string
TransportType represents the type of transport to use.
const ( // TransportStdio uses standard input/output. TransportStdio TransportType = "stdio" // TransportSSE uses Server-Sent Events over HTTP. TransportSSE TransportType = "sse" // TransportStreamableHTTP uses Streamable HTTP protocol. TransportStreamableHTTP TransportType = "streamable" )
Click to show internal directories.
Click to hide internal directories.