mcpserver

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 37 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultHTTPAddr = "127.0.0.1:8743"
	DefaultHTTPPath = "/mcp"
)

Variables

This section is empty.

Functions

func ApplyRuntimeAuthOptions added in v0.2.5

func ApplyRuntimeAuthOptions(cfg config.Config, st *store.Store, opts *HTTPOptions) error

func AuthEnabled added in v0.2.5

func AuthEnabled(cfg config.Config) bool

func Serve

func Serve(ctx context.Context, cfg config.Config, in io.Reader, out io.Writer, dependencies ...ServerDependencies) error

func ServeHTTP

func ServeHTTP(ctx context.Context, cfg config.Config, opts HTTPOptions, dependencies ...ServerDependencies) error

func WriteOpenAuthWarning added in v0.2.5

func WriteOpenAuthWarning(out io.Writer, surface string)

Types

type AuditDependencies added in v0.7.0

type AuditDependencies struct {
	RunFast          func(context.Context) (audit.Report, error)
	Reports          AuditReportReader
	SyncInterval     time.Duration
	StandardInterval time.Duration
	Now              func() time.Time
}

type AuditReportReader added in v0.7.0

type AuditReportReader interface {
	Latest(audit.Profile) (*audit.Report, error)
}

type BearerTokenAuthenticator added in v0.2.5

type BearerTokenAuthenticator func(context.Context, string) (BearerTokenIdentity, bool, error)

type BearerTokenIdentity added in v0.2.5

type BearerTokenIdentity struct {
	Name        string
	Fingerprint string
}

type BearerTokenValidator added in v0.2.5

type BearerTokenValidator func(context.Context, string) (bool, error)

type HTTPOptions

type HTTPOptions struct {
	Addr                     string
	Path                     string
	AllowedOrigins           []string
	MaxBodyBytes             int64
	RequireBearerAuth        bool
	BearerTokenValidator     BearerTokenValidator
	BearerTokenAuthenticator BearerTokenAuthenticator
	LogOutput                io.Writer
}

type ResearchPack

type ResearchPack = brainresearch.Pack

type ResearchPackOptions

type ResearchPackOptions = brainresearch.Options

type Server

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

func New

func New(cfg config.Config, st *store.Store) *Server

func NewWithDependencies added in v0.7.0

func NewWithDependencies(cfg config.Config, st *store.Store, deps ServerDependencies) *Server

func (*Server) BuildResearchPack

func (s *Server) BuildResearchPack(ctx context.Context, opts ResearchPackOptions) (ResearchPack, error)

func (*Server) HTTPHandler

func (s *Server) HTTPHandler(opts HTTPOptions) http.Handler

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, in io.Reader, out io.Writer) error

type ServerDependencies added in v0.7.0

type ServerDependencies struct {
	Audit AuditDependencies
}

Jump to

Keyboard shortcuts

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