Documentation
¶
Overview ¶
Package cli implements the abs-mcp command line interface: the cobra commands, flag and config handling, and the MCP server exposing Audiobookshelf library tools to AI clients.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultToolsets = []string{"core"}
DefaultToolsets is what the binary registers when neither --toolsets nor --allow-tools is given: enough to find things and read them, and nothing that writes. The whole surface is around 12,000 tokens of tool definitions before a question is asked, which is a poor thing to spend a client's context on by default. Ask for more 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"`
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"`
ProviderTag string `mapstructure:"provider-tag"`
Providers []string `mapstructure:"providers"`
AuditSkip []string `mapstructure:"audit-skip"`
}
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 is the client for the configured server and key, logging what it sends, or which setting is missing.
func (*FlagData) ToolOptions ¶
ToolOptions maps the flags onto the tool registration options. The default toolsets are for a binary told nothing about which tools it is to serve: an allow list with no toolsets beside it is only the tools it names.