Kuberwastaken/claurst · error

rmcp unsubscribe ' ' failed

Error message

rmcp unsubscribe '{}' failed: {}

What it means

The rmcp peer's `unsubscribe` call failed — the MCP server errored on the resources/unsubscribe request for the given URI (not subscribed, server-side failure, or connection-level error through the peer).

Solutions

  1. Verify the subscription exists before unsubscribing
  2. Check server logs for the unsubscribe reject reason
  3. Treat as non-fatal if the subscription already expired server-side
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src-rust/crates/mcp/src/rmcp_backend.rs:593 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Kuberwastaken/claurst@b0637c97ec (2026-09-10). Data as JSON: /api/errors/bd1c58ea9a13be2e. Report an issue: GitHub.

Appendix: source

Thrown at src-rust/crates/mcp/src/rmcp_backend.rs:593

            .peer
            .get_prompt(params)
            .await
            .map_err(|e| anyhow::anyhow!("rmcp get_prompt '{}' failed: {}", name, e))?;
        Ok(convert_get_prompt_result(result))
    }

    async fn subscribe_resource(&self, uri: &str) -> anyhow::Result<()> {
        self.peer
            .subscribe(rmcp_model::SubscribeRequestParams::new(uri.to_string()))
            .await
            .map_err(|e| anyhow::anyhow!("rmcp subscribe '{}' failed: {}", uri, e))
    }

    async fn unsubscribe_resource(&self, uri: &str) -> anyhow::Result<()> {
        self.peer
            .unsubscribe(rmcp_model::UnsubscribeRequestParams::new(uri.to_string()))
            .await
            .map_err(|e| anyhow::anyhow!("rmcp unsubscribe '{}' failed: {}", uri, e))
    }

    fn subscribe_to_notifications(&self) -> BoxStream<'static, anyhow::Result<Value>> {
        let notifications_rx = Arc::clone(&self.notifications_rx);
        let (tx, rx) = mpsc::channel::<anyhow::Result<Value>>(100);
        tokio::spawn(async move {
            loop {
                let next = {
                    let mut receiver = notifications_rx.lock().await;
                    receiver.recv().await
                };
                match next {
                    Some(value) => {
                        if tx.send(Ok(value)).await.is_err() {
                            break;
                        }
                    }
                    None => break,

View on GitHub (pinned to b0637c97ec)