client

package
v0.0.0-...-099e000 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallToolLocal

func CallToolLocal(ctx context.Context, cmd string, cmdArgs []string, tool string,
	toolArgs map[string]any) (*mcp.CallToolResult, *mcp.CreateMessageRequest,
	*mcp.ElicitRequest, error)

func CallToolRemote

func CallToolRemote(ctx context.Context, url, apiKey, header string, sse bool, tool string,
	toolArgs map[string]any) (*mcp.CallToolResult, *mcp.CreateMessageRequest,
	*mcp.ElicitRequest, error)

func GetPromptLocal

func GetPromptLocal(ctx context.Context, cmd string, cmdArgs []string, prompt string,
	promptArgs map[string]string) (*mcp.GetPromptResult, error)

func GetPromptRemote

func GetPromptRemote(ctx context.Context, url, apiKey, header string, sse bool, prompt string,
	promptArgs map[string]string) (*mcp.GetPromptResult, error)

func ReadResourceLocal

func ReadResourceLocal(ctx context.Context, cmd string, cmdArgs []string,
	uri string) (*mcp.ReadResourceResult, error)

func ReadResourceRemote

func ReadResourceRemote(ctx context.Context, url, apiKey, header string, sse bool,
	uri string) (*mcp.ReadResourceResult, error)

Types

type ListOptions

type ListOptions uint
const (
	ListPrompts ListOptions = 1 << iota
	ListResources
	ListTools
)

type ListOutput

type ListOutput struct {
	Prompts             []*mcp.Prompt   `json:"prompts,omitempty"`
	Resources           []*mcp.Resource `json:"resources,omitempty"`
	Tools               []*mcp.Tool     `json:"tools,omitempty"`
	ToolListChanged     bool            `json:"tool_list_changed,omitempty"`
	PromptListChanged   bool            `json:"prompt_list_changed,omitempty"`
	ResourceListChanged bool            `json:"resource_list_changed,omitempty"`
	ResourceSubscribe   bool            `json:"resource_subscribe,omitempty"`
	Logging             bool            `json:"logging,omitempty"`
	Completions         bool            `json:"completions,omitempty"`
}

func ListLocal

func ListLocal(ctx context.Context, cmd string, args []string, lstOpts ListOptions) (*ListOutput,
	error)

func ListRemote

func ListRemote(ctx context.Context, url, apiKey, header string, sse bool,
	lstOpts ListOptions) (*ListOutput, error)

type SessionManager

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

func NewSessionManager

func NewSessionManager(url, apiKey, header string, sse bool) SessionManager

func (*SessionManager) Close

func (sm *SessionManager) Close()

func (*SessionManager) RoundTrip

func (sm *SessionManager) RoundTrip(req *http.Request) (*http.Response, error)

func (*SessionManager) WithSession

func (sm *SessionManager) WithSession(ctx context.Context, clnt *mcp.Client,
	with func(ctx context.Context, sess *mcp.ClientSession) error) error

Jump to

Keyboard shortcuts

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