Documentation
¶
Overview ¶
Package cmd has the commands, and flags, of the MCP connectors: those which call the connectors' API, and the server's
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // WaitTimeout is how long a connector which is created is waited for, // as its server is connected, and signed in to, when it needs to be WaitTimeout = 10 * time.Minute // PollInterval is how often the connector is asked about, as well as // when there's an event of it, as events which happen before they're // watched aren't seen PollInterval = 2 * time.Second // LoopbackPort is the port of the loopback the authorization server // redirects to, when the server's own callback can't be, which is the // same each time, so the client registered with it, with its redirect, // is used again, or any port, when it's taken LoopbackPort = 8977 )
Functions ¶
This section is empty.
Types ¶
type ClientCommands ¶
type ClientCommands struct {
ConnectorCommands
}
ClientCommands are the commands which call the connectors' API
type ConnectorClient ¶
type ConnectorClient struct {
ClientIDCredential string `` /* 205-byte string literal not displayed */
ClientSecretCredential string `name:"client-secret-credential" help:"Name of the credential holding the client's secret, such as GITHUB_CLIENT_SECRET."`
}
ConnectorClient are the names of the credentials of the client a connector's server is authorized as, when its authorization server doesn't register clients, such as GitHub's
type ConnectorCommands ¶
type ConnectorCommands struct {
Connectors ConnectorListCmd `` /* 136-byte string literal not displayed */
Connector ConnectorGetCmd `cmd:"" name:"connector" help:"Get a connector by name." group:"MCP CONNECTORS"`
ConnectorCreate ConnectorCreateCmd `` /* 192-byte string literal not displayed */
ConnectorUpdate ConnectorUpdateCmd `cmd:"" name:"connector-update" help:"Update a connector's URL, or patterns, so it's connected again." group:"MCP CONNECTORS"`
ConnectorDelete ConnectorDeleteCmd `cmd:"" name:"connector-delete" help:"Delete a connector by name, so it's disconnected." group:"MCP CONNECTORS"`
}
ConnectorCommands are the commands which list, get, create, update and delete the connectors, which are remote MCP servers
type ConnectorCreateCmd ¶
type ConnectorCreateCmd struct {
ConnectorPatterns
ConnectorClient
URL string `` /* 127-byte string literal not displayed */
Name string `name:"name" help:"Connector name, which is an identifier, such as github, or the server's own name, when it's omitted."`
}
type ConnectorDeleteCmd ¶
type ConnectorDeleteCmd struct {
Name string `arg:"" name:"name" help:"Connector name."`
}
type ConnectorGetCmd ¶
type ConnectorGetCmd struct {
Name string `arg:"" name:"name" help:"Connector name."`
}
type ConnectorListCmd ¶
type ConnectorListCmd struct{}
type ConnectorPatterns ¶
type ConnectorPatterns struct {
Include []string `` /* 171-byte string literal not displayed */
Exclude []string `` /* 135-byte string literal not displayed */
}
ConnectorPatterns are the patterns of the names of a connector's server's tools, prompts and resources, as a provider's are of its models
type ConnectorUpdateCmd ¶
type ConnectorUpdateCmd struct {
ConnectorPatterns
Name string `arg:"" name:"name" help:"Connector name."`
URL string `name:"url" help:"URL of the MCP server, which replaces it, or it's kept when it isn't given."`
ClientIDCredential string `` /* 176-byte string literal not displayed */
ClientSecretCredential string `` /* 143-byte string literal not displayed */
}
ConnectorUpdateCmd updates a connector, whose patterns are replaced with those given, so one which isn't given is cleared, and whose URL is kept, unless one is given
type Flags ¶
type Flags struct {
ConnectTimeout time.Duration `` /* 167-byte string literal not displayed */
ToolTimeout time.Duration `` /* 150-byte string literal not displayed */
}
Flags are the connectors' flags for the server: how long a connector's server is waited for, as it's connected, and its tools are listed, and how long one of its tools has, as it's called
func (Flags) WithConnectorRegistry ¶
func (flags Flags) WithConnectorRegistry(ctx server.Cmd, srv *servercmd.RunServer, b *broadcaster.Broadcaster, fn func(*registry.Registry) error, opts ...registry.Opt) error
WithConnectorRegistry creates the registry of the connectors, with the command's client options, such as its tracer, and user agent, which the clients of the connectors' servers use, and its name, and version, which the servers are told, the broadcaster it publishes its changes to, when there is one, and the options, such as its store, registers its HTTP handlers with the server, when there is one, and then calls the function with the registry, returning any error, once its connectors' servers are disconnected