mcp

package
v0.0.0-...-03a4827 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrServerNotCompiled = errors.New("MCP server is nil")

ErrServerNotCompiled is returned when attempting to create an MCP app with a configuration that doesn't have a compiled MCP server. This typically happens when the config validation step was skipped.

Functions

This section is empty.

Types

type App

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

App is an MCP (Model Context Protocol) application that serves MCP endpoints

func New

func New(cfg *Config) (*App, error)

New creates a new MCP App from a Config DTO.

func (*App) HandleHTTP

func (a *App) HandleHTTP(
	ctx context.Context,
	w http.ResponseWriter,
	r *http.Request,
) error

HandleHTTP processes HTTP requests by delegating to the MCP SDK's HTTP handler.

func (*App) String

func (a *App) String() string

String returns the unique identifier of the application.

type Config

type Config struct {
	// ID is the unique identifier for this app instance
	ID string

	// CompiledServer is the pre-compiled MCP server from domain validation.
	// This server contains all registered tools and is ready to handle MCP requests.
	CompiledServer *mcpsdk.Server
}

Config contains everything needed to instantiate an MCP app. This is a Data Transfer Object (DTO) with no dependencies on domain packages. All validation and server compilation happens at the domain layer before creating this config.

Jump to

Keyboard shortcuts

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