Skip to main content
McpEssentials.Redis is specified and is not in this repository yet.
Low-latency handles, native TTL, and pub/sub for elicitation. Prefer this over IDistributedCache when the cache is Redis and you need fan-out.

When to use it

  • The host already runs Redis.
  • Tasks should vanish with EXPIRE / EXPIREAT from DiscardAfter.
  • Several nodes wait on ElicitAsync and can subscribe to a Redis channel.

Intended how-to

  1. Add McpEssentials.Redis and a ConnectionMultiplexer.
  2. Keys:
  1. Register the store as a singleton with the same current-user factory as Authenticated tasks.
  2. CreateTaskAsync uses SET with replica wait (Wait / waitReplicas) so a later get on any node can see the row. Eventually-consistent Redis without wait is not SEP-2663 compliant.
  3. Terminal transitions use a Lua script that checks status before writing.
A missing key is not found. Get does not distinguish expiry from isolation.

Events

Subscribers raise InputResponseReceived. Payload is task id plus request id.

TTL

EXPIREAT on the task key from DiscardAfter (CreatedAt + 2×TimeToLive). No sweeper required. Core SweepExpiredAsync is a no-op; Redis owns expiry. See Stores.