Documentation
¶
Overview ¶
Package daemon starts a local Directory daemon (`dirctl daemon start`, run in-process) next to the MCP server, so the tools have a Directory node to talk to without any manual setup.
Index ¶
Constants ¶
const (
// EnvDisable turns off the automatic daemon when set to "false", "0" or "off".
EnvDisable = "DIR_MCP_DAEMON"
)
Variables ¶
var ErrAddressInUse = errors.New("directory server address is already in use")
ErrAddressInUse is returned by Start when another server keeps holding the configured Directory address.
Functions ¶
This section is empty.
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon is a Directory daemon running in this process.
func Start ¶
Start launches a local Directory daemon when one is needed and returns it. It returns (nil, nil) when nothing was started: the feature is disabled or the configured server is not local. If another server holds the address, Start waits up to 30 seconds for it (and its locks) to go away and then fails with ErrAddressInUse. The caller must Stop a non-nil Daemon.
The daemon is the dirctl `daemon start` command, run in-process. It logs to os.Stdout, so callers that use stdout for a protocol stream must point os.Stdout elsewhere before calling Start.