server

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package server provides the core MCP (Model Control Protocol) server implementation.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidOAuthProvider = fmt.Errorf("unsupported OAuth provider")

ErrInvalidOAuthProvider indicates an unsupported OAuth provider was specified

View Source
var Module = fx.Module("mcp_server",
	fx.Provide(
		NewServer,
	),
)

Module provides the MCP server dependencies

Functions

This section is empty.

Types

type Server added in v0.2.0

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

Server represents the MCP server instance that handles tool management, authentication, and request processing. It supports multiple operation modes including SSE, HTTP, and STDIO.

func NewServer added in v0.2.0

func NewServer(cfg *config.Config, p parser.Parser, requester *requester.HTTPRequester) *Server

NewServer creates a new MCP server instance with the provided configuration. It initializes the server with the given parser and requester, and sets up authentication if enabled in the configuration.

func (*Server) ServeHTTP added in v0.2.0

func (s *Server) ServeHTTP(ctx context.Context) error

func (*Server) ServeSSE added in v0.2.0

func (s *Server) ServeSSE(ctx context.Context) error

func (*Server) ServeSTDIO added in v0.2.0

func (s *Server) ServeSTDIO(ctx context.Context) error

func (*Server) Start added in v0.2.0

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

Start starts the server in the configured mode (SSE, HTTP, or STDIO). It returns an error if the server fails to start or encounters an error during operation.

Directories

Path Synopsis
Package handler provides HTTP request handling for the MCP server.
Package handler provides HTTP request handling for the MCP server.
Package tool provides tool handling functionality for the MCP server.
Package tool provides tool handling functionality for the MCP server.

Jump to

Keyboard shortcuts

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