mcpserver

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExposureProfile = "profile"
	ExposureCompact = "compact"
	ExposureFull    = "full"
)
View Source
const (
	DefaultMaxInlineBytes = 32 * 1024
)
View Source
const TransportStdio = "stdio"

Variables

View Source
var (
	ErrDisabled             = errors.New("MCP server is disabled")
	ErrUnsupportedTransport = errors.New("unsupported MCP transport")
)
View Source
var ErrArbitraryCodePermissionRequired = errors.New("arbitrary-code permission is required")

Functions

func Run

func Run(ctx context.Context, config Config, transport mcp.Transport) error

func RunStdio

func RunStdio(ctx context.Context, config Config) error

Types

type Config

type Config struct {
	Enabled            bool
	Transport          string
	Profile            string
	Exposure           string
	AllowArbitraryCode bool
	MRTR               bool
	Version            string
	Project            string
	Port               int
	TimeoutMS          int
	MaxInlineBytes     int
	Diagnostics        io.Writer
}

func (Config) Validate

func (config Config) Validate() error

type ToolDefinitionPayload added in v0.2.13

type ToolDefinitionPayload struct {
	ToolCount int
	Bytes     int
}

ToolDefinitionPayload is the serialized MCP tools/list definition footprint.

func MeasureCompactToolDefinitions added in v0.2.13

func MeasureCompactToolDefinitions() (ToolDefinitionPayload, error)

MeasureCompactToolDefinitions measures the fixed Compact discovery surface.

func MeasureProfileToolDefinitions added in v0.2.13

func MeasureProfileToolDefinitions(catalog *toolregistry.Catalog, profile string) (ToolDefinitionPayload, error)

MeasureProfileToolDefinitions measures one catalog-owned native profile.

Jump to

Keyboard shortcuts

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