cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package cli implements the technitium-mcp command line interface: the cobra commands, flag and config handling, and the MCP server exposing Technitium DNS server tools to AI clients.

Index

Constants

This section is empty.

Variables

View Source
var DefaultToolsets = []string{"core"}

DefaultToolsets is what the binary registers when neither --toolsets nor --allow-tools is given: enough to see what the servers are and read what they hold, and nothing that writes. Every tool's definition is spent from a client's context before a question is asked, which is a poor thing to spend it on by default. Ask for more with --toolsets, or --toolsets all for everything.

Functions

func Make

func Make() (*cobra.Command, error)

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) Servers

func (f *FlagData) Servers() (*servers.Set, error)

Servers builds the configured servers, each with a client for it.

func (*FlagData) ToolOptions

func (f *FlagData) ToolOptions() (tools.Options, error)

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.

Jump to

Keyboard shortcuts

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