tinyhumansai/openhuman · error

mcp feature disabled at compile time: this build was compile

Error message

mcp feature disabled at compile time: this build was compiled without the `mcp` feature, so the MCP stdio server is unavailable. Rebuild with `--features mcp`.

What it means

Builds compiled without the `mcp` Cargo feature replace the whole MCP server module with a stub whose run_stdio_from_cli logs a warning and bails with this message. The design goal (stated in the source docs): an MCP host that spawns `openhuman mcp` gets an immediate non-zero exit and a one-line stderr diagnostic naming the fix, instead of hanging forever on an stdout stream that never speaks JSON-RPC. `mcp` is ON in default builds; kernel/slim profiles omit it.

Source

Thrown at src/openhuman/mcp/server/stub.rs:46

/// in `src/core/cli.rs`. Deleting the arm is the naive move and is WRONG: the
/// `mcp` token would fall through to generic namespace resolution and die with
/// `unknown namespace: mcp`, which reads like the user typo'd a command rather
/// than like a deliberate property of this build. Keeping the arm and failing
/// here means:
///
/// * an MCP host (Claude Desktop, Cursor, …) that spawns `openhuman mcp` gets
///   a non-zero exit and a one-line stderr diagnostic naming the fix, instead
///   of hanging forever on an stdout stream that never speaks JSON-RPC;
/// * `cli.rs` needs no `#[cfg]` at all, so the gate stays invisible to the
///   transport layer.
///
/// Banner suppression in `cli.rs` is a `matches!` on the raw string, so it
/// keeps working here without touching a gated symbol.
pub fn run_stdio_from_cli(_args: &[String]) -> anyhow::Result<()> {
    log::warn!(
        "[mcp_server] {DISABLED_MSG} — `openhuman mcp` rejected; rebuild with `--features mcp`"
    );
    anyhow::bail!(
        "{DISABLED_MSG}: this build was compiled without the `mcp` feature, so the MCP stdio \
         server is unavailable. Rebuild with `--features mcp`."
    )
}

// ---------------------------------------------------------------------------
// In-process local HTTP server (mirrors `local::{ensure_local_http, LocalMcpEndpoint}`)
// ---------------------------------------------------------------------------

/// Address + bearer token of the in-process MCP HTTP server.
///
/// Mirrors [`super::local::LocalMcpEndpoint`] (real build). No value of this
/// type is ever constructed here — [`ensure_local_http`] always errors — but
/// the type must stay nameable for call sites that bind its `Ok` variant.
#[derive(Debug, Clone)]
pub struct LocalMcpEndpoint {
    pub addr: std::net::SocketAddr,
    pub token: String,

View on GitHub (pinned to 7491200858)

Solutions

  1. Rebuild with the gate: `cargo build --bin openhuman-core --features mcp` (default features already include it).
  2. Or point MCP hosts at a product/full build of the core.
  3. Embedders: decide the feature set against the surface you intend to expose before shipping, and assert it in build scripts.

Example fix

# before
$ cargo build --bin openhuman-core --no-default-features
$ openhuman-core mcp
error: mcp feature disabled at compile time ... Rebuild with `--features mcp`.

# after
$ cargo build --bin openhuman-core --features mcp
$ openhuman-core mcp --transport stdio
Defensive patterns

Strategy: fallback

Validate before calling

fn mcp_compiled_in() -> bool {
    cfg!(feature = "mcp")
}

Try / catch

In wrappers that spawn `openhuman mcp`, treat this message as a deployment error: deregister the server from the MCP client config rather than retrying, and point the operator at the rebuild flag.

Prevention

When it happens

Trigger: Running `openhuman mcp` (or the mcp-server alias) on a binary built `--no-default-features` or with a feature list lacking `mcp` — e.g. the kernel profile `--no-default-features --features flows` — so the CLI arm resolves to the stub.

Common situations: Embedding hosts using feature-slim cores; size-optimized custom builds; accidentally running a minimal CI artifact as the daily binary; distro-style packaging that trims features.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/c2a8a5fc58fff425. Report an issue: GitHub.