Documentation
¶
Index ¶
- type ListPromptsResult
- type ListResourcesResult
- type ListToolsResult
- type Server
- type ServerOption
- func WithInitializeService(is services.InitializeService) ServerOption
- func WithPromptService(ps services.PromptService) ServerOption
- func WithResourceService(rs services.ResourceService) ServerOption
- func WithServerName(name string) ServerOption
- func WithServerVersion(version string) ServerOption
- func WithToolService(ts services.ToolService) ServerOption
- type StdioServer
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ListPromptsResult ¶
type ListPromptsResult struct { Prompts []protocol.Prompt `json:"prompts"` NextCursor string `json:"nextCursor"` }
ListPromptsResult is the response type for prompts/list method
type ListResourcesResult ¶
type ListResourcesResult struct { Resources []protocol.Resource `json:"resources"` NextCursor string `json:"nextCursor"` }
ListResourcesResult is the response type for resources/list method
type ListToolsResult ¶
type ListToolsResult struct { Tools []protocol.Tool `json:"tools"` NextCursor string `json:"nextCursor"` }
ListToolsResult is the response type for tools/list method
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents an MCP server that can use different transports
func NewServer ¶
func NewServer(logger zerolog.Logger, options ...ServerOption) *Server
NewServer creates a new server instance
func (*Server) GetRegistry ¶
func (s *Server) GetRegistry() *pkg.ProviderRegistry
GetRegistry returns the server's provider registry
func (*Server) StartStdio ¶
StartStdio starts the server with stdio transport
type ServerOption ¶
type ServerOption func(*Server)
func WithInitializeService ¶
func WithInitializeService(is services.InitializeService) ServerOption
func WithPromptService ¶
func WithPromptService(ps services.PromptService) ServerOption
func WithResourceService ¶
func WithResourceService(rs services.ResourceService) ServerOption
func WithServerName ¶
func WithServerName(name string) ServerOption
func WithServerVersion ¶
func WithServerVersion(version string) ServerOption
func WithToolService ¶
func WithToolService(ts services.ToolService) ServerOption
type StdioServer ¶
type StdioServer struct {
// contains filtered or unexported fields
}
StdioServer handles stdio transport for MCP protocol
func NewStdioServer ¶
func NewStdioServer(logger zerolog.Logger, ps services.PromptService, rs services.ResourceService, ts services.ToolService, is services.InitializeService) *StdioServer
NewStdioServer creates a new stdio server instance
func (*StdioServer) Start ¶
func (s *StdioServer) Start() error
Start begins listening for and handling messages on stdio
Click to show internal directories.
Click to hide internal directories.