mcp

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 13 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 (
	TransportStdio = "stdio"
	TransportHTTP  = "http"
)

Variables

This section is empty.

Functions

func NewToolServer

func NewToolServer(runtime ToolRuntime) *sdk.Server

func ResultContent

func ResultContent(result *sdk.CallToolResult) string

func RunStdioServer

func RunStdioServer(ctx context.Context, runtime ToolRuntime) error

func SanitizeToolPart

func SanitizeToolPart(value string) string

func ToolID

func ToolID(prefix string, remoteName string) string

Types

type ClientModule

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

func NewClientModule

func NewClientModule(ctx context.Context, cfg Config) (*ClientModule, error)

func (*ClientModule) Close

func (m *ClientModule) Close() error

func (*ClientModule) Context

func (m *ClientModule) Context() string

func (*ClientModule) RegisterTools

func (m *ClientModule) RegisterTools(registry *tools.Registry) error

type Config

type Config struct {
	Enabled bool
	Servers []ServerConfig
}

func NormalizeConfig

func NormalizeConfig(cfg Config) Config

type ServerConfig

type ServerConfig struct {
	ID              string
	Name            string
	Enabled         bool
	Transport       string
	Command         string
	Args            []string
	Env             map[string]string
	Endpoint        string
	ToolPrefix      string
	ReadOnly        bool
	RequireApproval bool
	Timeout         time.Duration
}

type ToolRuntime

type ToolRuntime interface {
	List() []tools.Spec
	Execute(ctx context.Context, toolID string, call tools.Call) (tools.Result, error)
}

Jump to

Keyboard shortcuts

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