Documentation
¶
Overview ¶
Package cli implements the dockhand-mcp command line interface: the cobra commands, flag and config handling, and the MCP server exposing Dockhand's tools to AI clients.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultToolsets = []string{"core", "audit"}
DefaultToolsets is what the binary registers when neither --toolsets nor --allow-tools is given: enough to see what the Dockhand is and what runs on its hosts, and the audits that look for what is wrong there, which is what the server is for; nothing that writes. Every tool's definition is spent from a client's context before a question is asked, so the rest is asked for with --toolsets, or --toolsets all for everything.
Functions ¶
Types ¶
type FlagData ¶
type FlagData struct {
Server string `mapstructure:"server"`
Token string `mapstructure:"token"`
ReadOnly bool `mapstructure:"read-only"`
EnableWrite bool `mapstructure:"enable-write"`
EnableDelete bool `mapstructure:"enable-delete"`
Toolsets []string `mapstructure:"toolsets"`
AllowTools []string `mapstructure:"allow-tools"`
DenyTools []string `mapstructure:"deny-tools"`
Listen string `mapstructure:"listen"`
AuthToken string `mapstructure:"auth-token"`
AllowNoAuth bool `mapstructure:"allow-no-auth"`
}
func GetFlags ¶
func GetFlags() *FlagData
GetFlags returns the fully populated FlagData. We must unmarshal from Viper instead of using globally bound pflags variables because pflags only parses command-line arguments. Viper merges environment variables (and config files) on top of the CLI flags.
func (*FlagData) NewClient ¶
NewClient builds the client for the configured Dockhand: with the token when one is given, and with none for a Dockhand that has its login switched off. Which of the two a server is, it says itself when asked.
func (*FlagData) ToolOptions ¶
ToolOptions maps the flags onto the tool registration options. An allow list with no --toolsets is the whole choice: it already says which tools to load, so the default set is not added to it. Beside --toolsets it adds its tools to the sets.
A session only reads unless --enable-write says otherwise. --read-only is taken because the other katbyte MCP servers are started with it, and here says what is already so: beside --enable-write it is a contradiction, and refused.