Help us shape the future of Go! Take the 2026 Go Developer Survey

mcp

package
v0.9.16 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultLoader = &Local{}
	DefaultRunner = DefaultLoader
)

Functions

This section is empty.

Types

type Config

type Config struct {
	MCPServers map[string]ServerConfig `json:"mcpServers"`
}

type Local

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

func (*Local) Close

func (l *Local) Close() error

func (*Local) Load

func (l *Local) Load(ctx context.Context, tool types.Tool) (result []types.Tool, _ error)

func (*Local) LoadTools

func (l *Local) LoadTools(ctx context.Context, server ServerConfig, serverName, toolName string) ([]types.Tool, error)

func (*Local) Run

func (l *Local) Run(ctx engine.Context, _ chan<- types.CompletionStatus, tool types.Tool, input string) (string, error)

func (*Local) ShutdownServer

func (l *Local) ShutdownServer(server ServerConfig) error

type ServerConfig

type ServerConfig struct {
	DisableInstruction bool     `json:"disableInstruction"`
	Command            string   `json:"command"`
	Args               []string `json:"args"`
	Env                []string `json:"env"`
	Server             string   `json:"server"`
	URL                string   `json:"url"`
	BaseURL            string   `json:"baseURL,omitempty"`
	Headers            []string `json:"headers"`
	Scope              string   `json:"scope"`
	AllowedTools       []string `json:"allowedTools"`
}

ServerConfig represents an MCP server configuration for tools calls. It is important that this type doesn't have any maps.

func (*ServerConfig) GetBaseURL

func (s *ServerConfig) GetBaseURL() string

type Session

type Session struct {
	ID      string
	Session *mcpsdk.ClientSession
	Config  ServerConfig
}

Jump to

Keyboard shortcuts

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