{"record":{"id":"c2a8a5fc58fff425","repo":"tinyhumansai/openhuman","slug":"mcp-feature-disabled-at-compile-time-this-build-w","errorCode":null,"errorMessage":"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`.","messagePattern":"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`\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/mcp/server/stub.rs","lineNumber":46,"sourceCode":"/// in `src/core/cli.rs`. Deleting the arm is the naive move and is WRONG: the\n/// `mcp` token would fall through to generic namespace resolution and die with\n/// `unknown namespace: mcp`, which reads like the user typo'd a command rather\n/// than like a deliberate property of this build. Keeping the arm and failing\n/// here means:\n///\n/// * an MCP host (Claude Desktop, Cursor, …) that spawns `openhuman mcp` gets\n///   a non-zero exit and a one-line stderr diagnostic naming the fix, instead\n///   of hanging forever on an stdout stream that never speaks JSON-RPC;\n/// * `cli.rs` needs no `#[cfg]` at all, so the gate stays invisible to the\n///   transport layer.\n///\n/// Banner suppression in `cli.rs` is a `matches!` on the raw string, so it\n/// keeps working here without touching a gated symbol.\npub fn run_stdio_from_cli(_args: &[String]) -> anyhow::Result<()> {\n    log::warn!(\n        \"[mcp_server] {DISABLED_MSG} — `openhuman mcp` rejected; rebuild with `--features mcp`\"\n    );\n    anyhow::bail!(\n        \"{DISABLED_MSG}: this build was compiled without the `mcp` feature, so the MCP stdio \\\n         server is unavailable. Rebuild with `--features mcp`.\"\n    )\n}\n\n// ---------------------------------------------------------------------------\n// In-process local HTTP server (mirrors `local::{ensure_local_http, LocalMcpEndpoint}`)\n// ---------------------------------------------------------------------------\n\n/// Address + bearer token of the in-process MCP HTTP server.\n///\n/// Mirrors [`super::local::LocalMcpEndpoint`] (real build). No value of this\n/// type is ever constructed here — [`ensure_local_http`] always errors — but\n/// the type must stay nameable for call sites that bind its `Ok` variant.\n#[derive(Debug, Clone)]\npub struct LocalMcpEndpoint {\n    pub addr: std::net::SocketAddr,\n    pub token: String,","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/mcp/server/stub.rs#L28-L64","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Rebuild with the gate: `cargo build --bin openhuman-core --features mcp` (default features already include it).","Or point MCP hosts at a product/full build of the core.","Embedders: decide the feature set against the surface you intend to expose before shipping, and assert it in build scripts."],"exampleFix":"# before\n$ cargo build --bin openhuman-core --no-default-features\n$ openhuman-core mcp\nerror: mcp feature disabled at compile time ... Rebuild with `--features mcp`.\n\n# after\n$ cargo build --bin openhuman-core --features mcp\n$ openhuman-core mcp --transport stdio","handlingStrategy":"fallback","validationCode":"fn mcp_compiled_in() -> bool {\n    cfg!(feature = \"mcp\")\n}","typeGuard":null,"tryCatchPattern":"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.","preventionTips":["Match feature sets to the intended surface at build time.","Point MCP hosts (Claude Desktop, Cursor) at full/product builds of the core.","CI should assert which features shipped artifacts actually contain."],"tags":["mcp","feature-gate","build-config","cli"],"backgroundTag":"feature-not-compiled-in","analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}