// {{ display_name }} MCP server — generated by mcpify. Do not hand-edit.
//
// Standalone entry point for Docker's HEALTHCHECK instruction. Checks that
// mcp_store.db is present and readable rather than depending on the running
// server's transport — stdio mode has no HTTP endpoint to probe. Kept
// dependency-free (no `use {{ crate_name }}::...`) so this binary stays fast
// to start and simple to reason about for a check that runs every 30s.

use std::path::Path;

fn main() {
    let store_path = Path::new("mcp_store.db");
    match std::fs::File::open(store_path) {
        Ok(_) => std::process::exit(0),
        Err(err) => {
            eprintln!(
                "healthcheck failed: '{}' is missing or unreadable: {err}",
                store_path.display()
            );
            std::process::exit(1);
        }
    }
}
