Documentation
¶
Index ¶
- func RunSSEServer(mcpSrv *mcpserver.MCPServer, addr, sseEndpoint, messageEndpoint string, ...) error
- func RunStdioServer(mcpSrv *mcpserver.MCPServer, stdin io.Reader, stdout io.Writer) error
- func RunStreamableHTTPServer(mcpSrv *mcpserver.MCPServer, addr, endpoint string, ctx context.Context) error
- type Server
- type ServerOptions
- type TransportType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunSSEServer ¶
func RunSSEServer(mcpSrv *mcpserver.MCPServer, addr, sseEndpoint, messageEndpoint string, ctx context.Context) error
RunSSEServer runs the server with SSE transport
func RunStdioServer ¶
RunStdioServer runs the server with STDIO transport
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents an MCP CAPI server instance
func NewServer ¶
func NewServer(opts ServerOptions) (*Server, error)
NewServer creates a new MCP CAPI server with the given options
func (*Server) RegisterTools ¶
func (s *Server) RegisterTools(registerFunc func(*handlers.ServerContext) ([]handlers.ToolRegistration, error)) error
RegisterTools registers MCP tools using the provided registration function
type ServerOptions ¶
type ServerOptions struct {
// KubeconfigPath is the path to the kubeconfig file
KubeconfigPath string
// Transport is the type of transport to use
Transport TransportType
// HTTPAddr is the HTTP server address (for SSE and Streamable HTTP transports)
HTTPAddr string
// SSEEndpoint is the SSE endpoint path (for SSE transport)
SSEEndpoint string
// MessageEndpoint is the message endpoint path (for SSE transport)
MessageEndpoint string
// HTTPEndpoint is the HTTP endpoint path (for Streamable HTTP transport)
HTTPEndpoint string
// ServerName is the name of the MCP server
ServerName string
// ServerVersion is the version of the MCP server
ServerVersion string
// StdioInput is the input stream for stdio transport (default: os.Stdin)
StdioInput io.Reader
// StdioOutput is the output stream for stdio transport (default: os.Stdout)
StdioOutput io.Writer
}
ServerOptions holds configuration options for the MCP server
func DefaultServerOptions ¶
func DefaultServerOptions() ServerOptions
DefaultServerOptions returns ServerOptions with default values
type TransportType ¶
type TransportType string
TransportType represents the type of transport for the MCP server
const ( // TransportStdio uses standard input/output TransportStdio TransportType = "stdio" // TransportSSE uses Server-Sent Events over HTTP TransportSSE TransportType = "sse" // TransportStreamableHTTP uses streamable HTTP transport TransportStreamableHTTP TransportType = "streamable-http" )
Click to show internal directories.
Click to hide internal directories.