mcp

package
v0.9.20 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CORSConfig added in v0.0.11

type CORSConfig struct {
	AllowedOrigins []string
	AllowedMethods []string
	AllowedHeaders []string
	MaxAge         int
}

CORSConfig represents CORS configuration

func DefaultCORSConfig added in v0.0.11

func DefaultCORSConfig() *CORSConfig

DefaultCORSConfig returns a default CORS configuration

type MockServer

type MockServer struct {
	Tools map[string]Tool
	// contains filtered or unexported fields
}

MockServer represents a mock MCP server implementation for testing

func NewMockServer

func NewMockServer(cfg *config.Config, logger *zap.Logger) (*MockServer, error)

NewMockServer creates a new mock MCP server for testing

func (*MockServer) Cleanup

func (s *MockServer) Cleanup() error

Cleanup cleans up resources

type Server

type Server struct {
	Tools map[string]Tool
	// contains filtered or unexported fields
}

Server represents the MCP server implementation

func NewServer

func NewServer(cfg *config.Config, logger *zap.Logger) (*Server, error)

NewServer creates a new MCP server

func (*Server) Cleanup

func (s *Server) Cleanup() error

Cleanup cleans up resources

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the HTTP handler for the MCP server

func (*Server) MetricsHandler added in v0.9.15

func (s *Server) MetricsHandler() http.Handler

MetricsHandler returns a standalone metrics HTTP handler for :9091

func (*Server) SetCORSConfig added in v0.0.11

func (s *Server) SetCORSConfig(config *CORSConfig)

SetCORSConfig sets the CORS configuration for the server

type Tool

type Tool struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	InputSchema map[string]interface{} `json:"inputSchema"`
	Handler     func(ctx context.Context, args map[string]interface{}) (interface{}, error)
}

Tool represents an MCP tool

Jump to

Keyboard shortcuts

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