ruvnet/ruflo · error · Error

Maximum subscriptions reached for resource: ${uri}

Error message

Maximum subscriptions reached for resource: ${uri}

What it means

Thrown by subscribe when the number of existing subscription callbacks for the given resource URI has already reached options.maxSubscriptionsPerResource; the registry refuses further subscriptions to that URI to cap fan-out, while subscriptions to other URIs remain unaffected.

Source

Thrown at v3/@claude-flow/mcp/src/resource-registry.ts:212

        ttl: this.options.cacheTTL,
      });
    }

    this.emit('resource:read', { uri, contentCount: contents.length });
    return { contents };
  }

  /**
   * Subscribe to resource updates
   */
  subscribe(uri: string, callback: SubscriptionCallback): string {
    if (!this.options.enableSubscriptions) {
      throw new Error('Subscriptions are disabled');
    }

    const existingSubs = this.subscriptions.get(uri) || [];
    if (existingSubs.length >= this.options.maxSubscriptionsPerResource) {
      throw new Error(`Maximum subscriptions reached for resource: ${uri}`);
    }

    const subscriptionId = `sub-${++this.subscriptionCounter}-${Date.now()}`;
    const subscription: Subscription = {
      id: subscriptionId,
      uri,
      callback,
      createdAt: new Date(),
    };

    existingSubs.push(subscription);
    this.subscriptions.set(uri, existingSubs);

    this.logger.debug('Subscription created', { subscriptionId, uri });
    this.emit('subscription:created', { subscriptionId, uri });

    return subscriptionId;
  }

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Unsubscribe unused subscriptions for the resource before adding new ones.
  2. Raise the per-resource subscription limit if the higher fan-out is intended.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at v3/@claude-flow/mcp/src/resource-registry.ts:212 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/4499c7558f9c8641. Report an issue: GitHub.