{"record":{"id":"b6609234417f72a8","repo":"openai/codex","slug":"mcp-client-not-initialized","errorCode":null,"errorMessage":"MCP client not initialized","messagePattern":"MCP client not initialized","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/rmcp-client/src/rmcp_client.rs","lineNumber":928,"sourceCode":"        let handle = service\n            .peer()\n            .send_cancellable_request(\n                ClientRequest::CustomRequest(request),\n                rmcp::service::PeerRequestOptions::no_options(),\n            )\n            .await?;\n\n        Ok(CancellableEventStreamRequest {\n            handle,\n            notifications,\n        })\n    }\n\n    async fn service(&self) -> Result<Arc<RunningService<RoleClient, ElicitationClientService>>> {\n        let guard = self.state.lock().await;\n        match &*guard {\n            ClientState::Ready { service, .. } => Ok(Arc::clone(service)),\n            ClientState::Connecting { .. } => Err(anyhow!(\"MCP client not initialized\")),\n            ClientState::Closed => Err(anyhow!(\"MCP client is shut down\")),\n        }\n    }\n\n    async fn oauth_persistor(&self) -> Option<OAuthPersistor> {\n        let guard = self.state.lock().await;\n        match &*guard {\n            ClientState::Ready {\n                oauth: Some(runtime),\n                ..\n            } => Some(runtime.clone()),\n            _ => None,\n        }\n    }\n\n    /// Returns `None` when this client does not manage stored OAuth credentials.\n    pub async fn managed_oauth_credentials(&self) -> Option<Option<StoredOAuthTokens>> {\n        let persistor = self.oauth_persistor().await?;","sourceCodeStart":910,"sourceCodeEnd":946,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rmcp-client/src/rmcp_client.rs#L910-L946","documentation":"Error \"MCP client not initialized\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rmcp-client/src/rmcp_client.rs:928 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}