Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemStore ¶
type MemStore struct {
// contains filtered or unexported fields
}
MemStore implements the SessionManager interface
type SSEOption ¶
type SSEOption func(*SSEServer)
SSEOption defines a function type for configuring SSEServer
func WithKeepAlive ¶
func WithKeepAliveInterval ¶
func WithMessageEndpoint ¶
WithMessageEndpoint sets the message endpoint path
type SSEServer ¶
type SSEServer struct {
// contains filtered or unexported fields
}
SSEServer implements a Server-Sent Events (SSE) based MCP server. It provides real-time communication capabilities over HTTP using the SSE protocol.
func NewSSEServer ¶
func NewSSEServer(server mcpservers.Server, opts ...SSEOption) *SSEServer
NewSSEServer creates a new SSE server instance with the given MCP server and options.
func (*SSEServer) HandleMessage ¶
handleMessage processes incoming JSON-RPC messages from clients and sends responses back through both the SSE connection and HTTP response.
type SessionManager ¶
type SessionManager interface {
New() (sessionID string)
// Set stores a sessionID and its corresponding backend endpoint
Set(sessionID, endpoint string)
// Get retrieves the backend endpoint for a sessionID
Get(sessionID string) (string, bool)
// Delete removes a sessionID from the store
Delete(sessionID string)
}
SessionManager defines the interface for managing session information
type StreamableHTTPOption ¶
type StreamableHTTPOption func(*StreamableHTTPServer)
type StreamableHTTPServer ¶
type StreamableHTTPServer struct {
// contains filtered or unexported fields
}
func NewStatelessStreamableHTTPServer ¶
func NewStatelessStreamableHTTPServer( server mcpservers.Server, opts ...StreamableHTTPOption, ) *StreamableHTTPServer
NewStatelessStreamableHTTPServer creates a new streamable-http server instance
func (*StreamableHTTPServer) ServeHTTP ¶
func (s *StreamableHTTPServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements the http.Handler interface.
type StreamableProxy ¶
type StreamableProxy struct {
// contains filtered or unexported fields
}
StreamableProxy represents a proxy for the MCP Streamable HTTP transport
func NewStreamableProxy ¶
func NewStreamableProxy( backend string, headers map[string]string, store SessionManager, ) *StreamableProxy
NewStreamableProxy creates a new proxy for the Streamable HTTP transport
func (*StreamableProxy) ServeHTTP ¶
func (p *StreamableProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP handles both GET and POST requests for the Streamable HTTP transport