Kuberwastaken/claurst · error

rmcp subscribe ' ' failed

Error message

rmcp subscribe '{}' failed: {}

What it means

The rmcp peer's `subscribe` call for a resource URI failed — the MCP server rejected or errored on the resources/subscribe request (unsupported capability, unknown URI, or connection-level failure propagated through the peer).

Solutions

  1. Verify the server advertises resource subscription support
  2. Check that the URI exists (list resources first)
  3. Inspect the server-side error for the reject reason
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src-rust/crates/mcp/src/rmcp_backend.rs:586 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/9f738699f5b50d61. Report an issue: GitHub.

Appendix: source

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

            let args = arguments
                .into_iter()
                .map(|(key, value)| (key, Value::String(value)))
                .collect();
            params = params.with_arguments(args);
        }
        let result = self
            .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
                };

View on GitHub (pinned to b0637c97ec)