Skip to main content

hyperdb_mcp/daemon/
mod.rs

1// Copyright (c) 2026, Salesforce, Inc. All rights reserved.
2// SPDX-License-Identifier: Apache-2.0 OR MIT
3
4//! Single-instance daemon for sharing a `hyperd` process across MCP clients.
5
6pub mod discovery;
7pub mod health;
8pub mod run;
9pub mod spawn;
10
11/// Default base TCP port for the daemon health listener. When no env var is set,
12/// the daemon scans `[base, base + DAEMON_PORT_SCAN_SPAN)` to find a free port.
13/// Previously 7484; changed to 7485 to avoid collision with hyperd's default gRPC port.
14pub const DEFAULT_DAEMON_BASE_PORT: u16 = 7485;
15
16/// Number of ports to scan starting from the base port when discovering or spawning
17/// a daemon. Used by the later port-scanning stage (not yet implemented).
18pub const DAEMON_PORT_SCAN_SPAN: u16 = 16;
19
20/// Suggested idle timeout value (30 minutes) for use with the `--idle-timeout` flag
21/// or `HYPERDB_DAEMON_IDLE_TIMEOUT` env var. By default (when neither is set), the
22/// daemon never auto-shuts down due to inactivity.
23pub const DEFAULT_IDLE_TIMEOUT_SECS: u64 = 30 * 60;
24
25/// Environment variable to override the daemon port.
26pub const ENV_DAEMON_PORT: &str = "HYPERDB_DAEMON_PORT";
27
28/// Environment variable to override the idle timeout (seconds).
29pub const ENV_IDLE_TIMEOUT: &str = "HYPERDB_DAEMON_IDLE_TIMEOUT";