downstreammcp

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 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 (
	TransportCommand = "command"
	TransportSSE     = "sse"
	DefaultTimeoutMS = 30000
	DefaultMaxBytes  = 20000
)

Variables

This section is empty.

Functions

func ParseArguments

func ParseArguments(raw string) (map[string]any, error)

func Save

func Save(path string, state State) error

Types

type CallResult

type CallResult struct {
	Server            string `json:"server"`
	Tool              string `json:"tool"`
	IsError           bool   `json:"is_error,omitempty"`
	Content           string `json:"content,omitempty"`
	StructuredContent any    `json:"structured_content,omitempty"`
	Truncated         bool   `json:"truncated,omitempty"`
}

type Client

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

func New

func New(state State) *Client

func (*Client) CallTool

func (c *Client) CallTool(ctx context.Context, serverName, toolName string, args map[string]any) (CallResult, error)

func (*Client) ListTools

func (c *Client) ListTools(ctx context.Context, serverName string, opts ListToolsOptions) (ListToolsResult, error)

func (*Client) Servers

func (c *Client) Servers() []Server

type ListToolsOptions

type ListToolsOptions struct {
	IncludeSchema bool
	MaxTools      int
}

type ListToolsResult added in v0.1.19

type ListToolsResult struct {
	Tools     []ToolSummary `json:"tools"`
	Total     int           `json:"total"`
	Truncated bool          `json:"truncated,omitempty"`
}

ListToolsResult reports the bounded tool inventory plus the true total so callers (and the models reading their output) can tell when the list was cut by MaxTools.

type Server

type Server struct {
	Name        string   `yaml:"name" json:"name"`
	Transport   string   `yaml:"transport" json:"transport"`
	Command     string   `yaml:"command,omitempty" json:"command,omitempty"`
	Args        []string `yaml:"args,omitempty" json:"args,omitempty"`
	URL         string   `yaml:"url,omitempty" json:"url,omitempty"`
	TimeoutMS   int      `yaml:"timeout_ms,omitempty" json:"timeout_ms,omitempty"`
	MaxBytes    int      `yaml:"max_bytes,omitempty" json:"max_bytes,omitempty"`
	Description string   `yaml:"description,omitempty" json:"description,omitempty"`
}

func (Server) Validate

func (s Server) Validate() error

type State

type State struct {
	Servers []Server `yaml:"servers" json:"servers"`
}

func Load

func Load(path string) (State, error)

func (State) Get

func (s State) Get(name string) (Server, bool)

func (State) PublicServers

func (s State) PublicServers() []Server

func (*State) Upsert

func (s *State) Upsert(server Server)

type ToolSummary

type ToolSummary struct {
	Name        string `json:"name"`
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	InputSchema any    `json:"input_schema,omitempty"`
}

Jump to

Keyboard shortcuts

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