mcp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeStdio

func ServeStdio(ctx context.Context) error

Types

type ClientFactory

type ClientFactory func(clicore.Credential) Client

type CredentialLoader

type CredentialLoader func() (clicore.Credential, error)

type HTTPCredentialResolver

type HTTPCredentialResolver func(*http.Request) (clicore.Credential, error)

type Option

type Option func(*Server)

func WithClientFactory

func WithClientFactory(factory ClientFactory) Option

func WithCredentialLoader

func WithCredentialLoader(loader CredentialLoader) Option

func WithDisabledTools

func WithDisabledTools(names ...string) Option

func WithHTTPCredentialResolver

func WithHTTPCredentialResolver(resolver HTTPCredentialResolver) Option

func WithPreviewBuilder

func WithPreviewBuilder(builder PreviewBuilder) Option

type PreviewBuilder

type PreviewBuilder func(string) (preflight.Result, error)

type Server

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

func NewServer

func NewServer(options ...Option) *Server

func (*Server) Serve

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

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Tool

type Tool struct {
	Descriptor ToolDescriptor
	Handler    func(context.Context, json.RawMessage) (any, error)
}

type ToolDescriptor

type ToolDescriptor struct {
	Name        string         `json:"name"`
	Description string         `json:"description"`
	InputSchema map[string]any `json:"inputSchema"`
}

Jump to

Keyboard shortcuts

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