mcp

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 14 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 Client

type Client struct {
	*nmcp.Client
	ID string
}

func (*Client) Capabilities

func (c *Client) Capabilities() nmcp.ServerCapabilities

type Config

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

type Local

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

func (*Local) Client

func (l *Local) Client(server ServerConfig, clientOpts ...nmcp.ClientOption) (*Client, error)

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
	Client *nmcp.Client
	Config ServerConfig
}

Jump to

Keyboard shortcuts

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