rest

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package rest provides the HTTP interface for the MCP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MCPServer

type MCPServer struct {
	// contains filtered or unexported fields
}

MCPServer represents the HTTP server for the MCP protocol.

func NewMCPServer

func NewMCPServer(service *usecases.ServerService, addr string, opts ...MCPServerOption) *MCPServer

NewMCPServer creates a new MCP server.

func (*MCPServer) GetAddress

func (s *MCPServer) GetAddress() string

GetAddress returns the server's address

func (*MCPServer) GetServerInfo

func (s *MCPServer) GetServerInfo() (name string, version string, instructions string)

GetServerInfo returns information about the server. This is useful for external components that need access to the server information.

func (*MCPServer) GetService

func (s *MCPServer) GetService() *usecases.ServerService

GetService returns the server service. This is useful for external components that need access to the service.

func (*MCPServer) Start

func (s *MCPServer) Start() error

Start starts the MCP server.

func (*MCPServer) Stop

func (s *MCPServer) Stop(ctx context.Context) error

Stop stops the MCP server.

type MCPServerOption

type MCPServerOption func(*MCPServer)

MCPServerOption is a function option for MCPServer

func WithLogger

func WithLogger(logger *logging.Logger) MCPServerOption

WithLogger sets the logger for the MCPServer

Jump to

Keyboard shortcuts

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