server

package
v0.8.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2025 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

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 (s *McpServer) HandleMCPGetExternal() http.Handler

func (*McpServer) HandleMCPPostExternal added in v0.5.2

func (s *McpServer) HandleMCPPostExternal() http.Handler

func (*McpServer) HandleMessagePostExternal added in v0.5.2

func (s *McpServer) HandleMessagePostExternal() http.Handler

func (*McpServer) HandleSSEGetExternal added in v0.5.2

func (s *McpServer) HandleSSEGetExternal(basePath string) http.Handler

func (*McpServer) HandleSessionPreflightExternal added in v0.8.0

func (s *McpServer) HandleSessionPreflightExternal(tryIncludePrincipal bool) http.Handler

func (*McpServer) RegisterHandlers added in v0.2.0

func (s *McpServer) RegisterHandlers(mux *http.ServeMux)

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

func (*McpServer) Start

func (s *McpServer) Start(ctx context.Context) error

Start starts the MCP server

func (*McpServer) Stop

func (s *McpServer) Stop(ctx context.Context)

Stop stops the MCP server

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL