cmd

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithClient

func WithClient(ctx server.Cmd, url string, fn func(context.Context, *mcpclient.Client) error) error

Types

type CallToolCommand

type CallToolCommand struct {
	URLFlag `embed:""`
	Name    string `arg:"" name:"name" help:"Tool name"`
	Input   string `arg:"" name:"input" help:"JSON input payload" optional:""`
}

func (*CallToolCommand) Run

func (cmd *CallToolCommand) Run(ctx server.Cmd) (err error)

type Commands

type Commands struct {
	ToolCommands
	PromptCommands
	ResourceCommands
}

type GetPromptCommand

type GetPromptCommand struct {
	URLFlag `embed:""`
	Name    string `arg:"" name:"name" help:"Prompt name"`
	Input   string `arg:"" name:"input" help:"JSON object of string prompt arguments" optional:""`
}

func (*GetPromptCommand) Run

func (cmd *GetPromptCommand) Run(ctx server.Cmd) (err error)

type GetResourceCommand

type GetResourceCommand struct {
	URLFlag `embed:""`
	URI     string `arg:"" name:"uri" help:"Resource URI"`
}

func (*GetResourceCommand) Run

func (cmd *GetResourceCommand) Run(ctx server.Cmd) (err error)

type ListPromptsCommand

type ListPromptsCommand struct {
	URLFlag `embed:""`
}

func (*ListPromptsCommand) Run

func (cmd *ListPromptsCommand) Run(ctx server.Cmd) (err error)

type ListResourcesCommand

type ListResourcesCommand struct {
	URLFlag `embed:""`
}

func (*ListResourcesCommand) Run

func (cmd *ListResourcesCommand) Run(ctx server.Cmd) (err error)

type ListToolsCommand

type ListToolsCommand struct {
	URLFlag `embed:""`
}

func (*ListToolsCommand) Run

func (cmd *ListToolsCommand) Run(ctx server.Cmd) (err error)

type PromptCommands

type PromptCommands struct {
	ListPrompts ListPromptsCommand `cmd:"" name:"prompts" help:"List prompts exposed by an MCP server." group:"MCP"`
	GetPrompt   GetPromptCommand   `cmd:"" name:"prompt" help:"Get a prompt by name from an MCP server." group:"MCP"`
}

type ResourceCommands

type ResourceCommands struct {
	ListResources ListResourcesCommand `cmd:"" name:"resources" help:"List resources exposed by an MCP server." group:"MCP"`
	GetResource   GetResourceCommand   `cmd:"" name:"resource" help:"Get a resource by URI from an MCP server." group:"MCP"`
}

type ToolCommands

type ToolCommands struct {
	ListTools ListToolsCommand `cmd:"" name:"tools" help:"List tools exposed by an MCP server." group:"MCP"`
	CallTool  CallToolCommand  `cmd:"" name:"tool-call" help:"Call a tool exposed by an MCP server." group:"MCP"`
}

type URLFlag

type URLFlag struct {
	URL string `name:"url" help:"MCP server endpoint URL" required:""`
}

Jump to

Keyboard shortcuts

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