Documentation
¶
Index ¶
- type McpServer
- func (s *McpServer) GetActorSystem() actor.ActorSystem
- func (s *McpServer) GetAuthHandler() config.AuthHandler
- func (s *McpServer) GetExecutors() config.MethodHandler
- func (s *McpServer) GetFeatureRegistry() resources.FeatureRegistry
- func (s *McpServer) GetServerCapabilities() protocol.ServerCapabilities
- func (s *McpServer) GetServerConfig() *config.ServerConfig
- func (s *McpServer) GetSessionManager() session.SessionManager
- func (s *McpServer) GetTraceHandler() config.TraceHandler
- func (s *McpServer) HandleMCPGetExternal() http.Handler
- func (s *McpServer) HandleMCPPostExternal() http.Handler
- func (s *McpServer) HandleMessagePostExternal() http.Handler
- func (s *McpServer) HandleSSEGetExternal(basePath string) http.Handler
- func (s *McpServer) HandleSessionPreflightExternal(tryIncludePrincipal bool) http.Handler
- func (s *McpServer) RegisterHandlers(mux *http.ServeMux)
- func (s *McpServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *McpServer) Start(ctx context.Context) error
- func (s *McpServer) Stop(ctx context.Context)
- type McpServerOption
- func WithAuthHandler(ah config.AuthHandler) McpServerOption
- func WithExecutors(executors *executors.Executors) McpServerOption
- func WithPromptRegistry(registry resources.PromptRegistry) McpServerOption
- func WithResourceRegistry(registry resources.ResourceRegistry) McpServerOption
- func WithRouter(router chi.Router) McpServerOption
- func WithServerInfo(name, version string) McpServerOption
- func WithToolRegistry(registry resources.ToolRegistry) McpServerOption
- func WithTraceHandler(th config.TraceHandler) McpServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type McpServer ¶
type McpServer struct {
Handlers *httphandlers.MCPHandler
// contains filtered or unexported fields
}
McpServer represents an MCP server
func NewMcpServer ¶
func NewMcpServer(cfg *config.ServerConfig, options ...McpServerOption) (*McpServer, error)
NewMcpServer creates a new MCP server
func (*McpServer) GetActorSystem ¶ added in v0.2.1
func (s *McpServer) GetActorSystem() actor.ActorSystem
GetActorSystem returns the actor system used by the server
func (*McpServer) GetAuthHandler ¶ added in v0.2.2
func (s *McpServer) GetAuthHandler() config.AuthHandler
func (*McpServer) GetExecutors ¶
func (s *McpServer) GetExecutors() config.MethodHandler
func (*McpServer) GetFeatureRegistry ¶
func (s *McpServer) GetFeatureRegistry() resources.FeatureRegistry
func (*McpServer) GetServerCapabilities ¶
func (s *McpServer) GetServerCapabilities() protocol.ServerCapabilities
func (*McpServer) GetServerConfig ¶
func (s *McpServer) GetServerConfig() *config.ServerConfig
func (*McpServer) GetSessionManager ¶ added in v0.8.0
func (s *McpServer) GetSessionManager() session.SessionManager
func (*McpServer) GetTraceHandler ¶ added in v0.2.2
func (s *McpServer) GetTraceHandler() config.TraceHandler
func (*McpServer) HandleMCPGetExternal ¶ added in v0.5.2
func (*McpServer) HandleMCPPostExternal ¶ added in v0.5.2
func (*McpServer) HandleMessagePostExternal ¶ added in v0.5.2
func (*McpServer) HandleSSEGetExternal ¶ added in v0.5.2
func (*McpServer) HandleSessionPreflightExternal ¶ added in v0.8.0
func (*McpServer) RegisterHandlers ¶ added in v0.2.0
RegisterHandlers registers MCP Handlers on the provided ServeMux This should be called before applying any middleware to the mux
func (*McpServer) ServeHTTP ¶ added in v0.2.0
func (s *McpServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements http.Handler, allowing the MCP server to be used directly as a handler This gives users complete control over middleware and server configuration
type McpServerOption ¶
type McpServerOption func(*McpServer)
McpServerOption represents an option for the MCP server
func WithAuthHandler ¶ added in v0.2.2
func WithAuthHandler(ah config.AuthHandler) McpServerOption
func WithExecutors ¶
func WithExecutors(executors *executors.Executors) McpServerOption
func WithPromptRegistry ¶
func WithPromptRegistry(registry resources.PromptRegistry) McpServerOption
WithPromptRegistry sets the prompt registry for the server
func WithResourceRegistry ¶
func WithResourceRegistry(registry resources.ResourceRegistry) McpServerOption
WithResourceRegistry sets the resource registry for the server
func WithRouter ¶ added in v0.2.0
func WithRouter(router chi.Router) McpServerOption
WithRouter allows the user to provide a chi router for handler registration When a router is provided, the MCP server will mount its routes on the provided router This is useful when integrating the MCP server into an existing application
func WithServerInfo ¶
func WithServerInfo(name, version string) McpServerOption
WithServerInfo sets the server info
func WithToolRegistry ¶
func WithToolRegistry(registry resources.ToolRegistry) McpServerOption
WithToolRegistry sets the tool registry for the server
func WithTraceHandler ¶ added in v0.2.2
func WithTraceHandler(th config.TraceHandler) McpServerOption