pub struct Builder { /* private fields */ }Expand description
Configures and starts the embedded server.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn mode(self, mode: Mode) -> Self
pub fn mode(self, mode: Mode) -> Self
Safety mode for the server. Defaults to Mode::ReadOnly.
Sourcepub fn auth(self, auth: Value) -> Self
pub fn auth(self, auth: Value) -> Self
Provider auth document, passed to the server as --auth=<json>.
Example: json!({"github": {"type": "null_auth"}}).
Sourcepub fn approot(self, approot: impl Into<PathBuf>) -> Self
pub fn approot(self, approot: impl Into<PathBuf>) -> Self
Override the server’s application root. Defaults to <home>/.stackql.
Sourcepub fn binary(self, path: impl Into<PathBuf>) -> Self
pub fn binary(self, path: impl Into<PathBuf>) -> Self
Run an existing stackql binary instead of acquiring one. The
STACKQL_MCP_BIN env var takes precedence over this.
Sourcepub fn bundle_path(self, path: impl Into<PathBuf>) -> Self
pub fn bundle_path(self, path: impl Into<PathBuf>) -> Self
Extract a local .mcpb bundle instead of downloading. The
STACKQL_MCP_BUNDLE env var takes precedence over this.
Sourcepub fn bundle_bytes(self, bytes: &'static [u8]) -> Self
pub fn bundle_bytes(self, bytes: &'static [u8]) -> Self
Embed the .mcpb bundle in your binary and extract it on first run:
builder.bundle_bytes(include_bytes!("../stackql-mcp-linux-x64.mcpb")).
Sourcepub fn command(&self) -> Result<Command>
pub fn command(&self) -> Result<Command>
Resolve the binary (acquiring it if needed) and return a
std::process::Command preloaded with the canonical launch args.
Blocking. The escape hatch for callers bringing their own MCP stack
or process supervision; stdio configuration is left to the caller.
Sourcepub async fn start(self) -> Result<RunningServer>
pub async fn start(self) -> Result<RunningServer>
Acquire the binary if needed, spawn the server, and complete the MCP handshake. Must be called from within a tokio runtime.