tinyhumansai/openhuman · error · anyhow::Error

stdio server missing stdin

Error message

stdio server missing stdin

What it means

After successfully spawning the stdio MCP child process, child.stdin was None — the command was built without piped stdin, so the host cannot write JSON-RPC frames to the server. The child exists but is unusable as a stdio transport.

Source

Thrown at src/openhuman/mcp/config_servers/stdio.rs:110

            .find(|(key, _)| key == "PATH")
            .map(|(_, value)| value.as_str())
            .unwrap_or(resolved_path.as_str());
        if spawn_env::locate_command(&self.command, effective_path, self.cwd.as_deref()).is_none() {
            tracing::warn!(
                target: "[mcp_client::stdio]",
                command = %self.command,
                "stdio MCP command not found on resolved PATH"
            );
            anyhow::bail!(spawn_env::missing_command_error(&self.command));
        }

        let mut child = command
            .spawn()
            .with_context(|| format!("spawning MCP stdio server `{}`", self.command))?;
        let stdin = child
            .stdin
            .take()
            .ok_or_else(|| anyhow::anyhow!("stdio server missing stdin"))?;
        let stdout = child
            .stdout
            .take()
            .ok_or_else(|| anyhow::anyhow!("stdio server missing stdout"))?;
        let mut session = StdioSession {
            child,
            stdin,
            stdout: BufReader::new(stdout),
            initialize: McpInitializeResult {
                protocol_version: LATEST_PROTOCOL_VERSION.into(),
                capabilities: json!({}),
                server_info: json!({}),
                instructions: None,
            },
        };

        let response = self
            .send_request_on_session(

View on GitHub (pinned to 7491200858)

Solutions

  1. Ensure the StdioCommand is created with stdin piped (Stdio::piped) before spawn
  2. Check that no wrapper script or shell redirection closes or consumes the child's stdin
  3. Kill and re-spawn the child with a correctly configured pipeline
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src/openhuman/mcp/config_servers/stdio.rs:110 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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