server

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 13 Imported by: 0

Documentation

Overview

Package server implements the local child-owned MCP 2026-07-28 stdio server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ProtocolVersion string
	Name            string
	Version         string
	Description     string
	Instructions    string
	Capabilities    map[string]any
	DiscoveryTTL    time.Duration
	MaxConcurrent   int
	Handler         Handler
}

type Handler

type Handler interface {
	Handle(context.Context, protocol.Request, Notifier) (map[string]any, *protocol.RPCError)
}

type HandlerFunc

type HandlerFunc func(context.Context, protocol.Request, Notifier) (map[string]any, *protocol.RPCError)

func (HandlerFunc) Handle

func (function HandlerFunc) Handle(ctx context.Context, request protocol.Request, notifier Notifier) (map[string]any, *protocol.RPCError)

type Notifier

type Notifier interface {
	Progress(progress float64, total *float64, message string) error
	Log(level, logger string, data any) error
}

type Server

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

func New

func New(config Config) (*Server, error)

func (*Server) Serve

func (server *Server) Serve(ctx context.Context, input io.Reader, output io.Writer) error

Jump to

Keyboard shortcuts

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