> ## Documentation Index
> Fetch the complete documentation index at: https://si.easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# NATS

> NATS JetStream KV for the task row, Core NATS for elicitation signals. Specified; not in this repository yet.

> [!WARNING]
>
> `McpEssentials.Nats` is specified and is not in this repository yet.

Edge / IoT / already-on-NATS hosts. JetStream Key/Value holds the canonical record. Core NATS subject `mcp.essentials.task.input` wakes waiting `ElicitAsync` callers.

> [card] When it ships
>
> The host already runs NATS and wants KV plus a native subject instead of a database plus a separate bus.

> [card] [Until then](https://si.easyaf.dev/mcpessentials/guides/stores/redis.md)
>
> Redis pub/sub is the shipped native channel on [`NotifyingMcpTaskStoreBase`](https://si.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Core/Tasks/NotifyingMcpTaskStoreBase).

## Intended how-to

**1. Add the package**

Add `McpEssentials.Nats` and a NATS connection.

**2. Put the row in KV**

Each `StoredMcpTask` in a JetStream KV bucket keyed by task id, including `OwnerUserId`.

**3. Register the store**

Singleton, same current-user factory as [Authenticated tasks](https://si.easyaf.dev/mcpessentials/guides/authenticated-tasks.md).

**4. Publish on resolve**

After a successful resolve, publish task id plus request id on `mcp.essentials.task.input`. Subscribers raise `InputResponseReceived`.

## TTL

KV entry TTL from `DiscardAfter` (`CreatedAt + 2×TimeToLive`).

## Related

> [card] [Redis](https://si.easyaf.dev/mcpessentials/guides/stores/redis.md)
>
> Shipped native pub/sub plus `PEXPIREAT`.

> [card] [PostgreSQL](https://si.easyaf.dev/mcpessentials/guides/stores/postgresql.md)
>
> Shipped native `LISTEN` / `NOTIFY` on Npgsql.

> [card] [Stores](https://si.easyaf.dev/mcpessentials/guides/stores.md)
>
> Pick a backing store by the engine you already run.

> [card] [Authenticated tasks](https://si.easyaf.dev/mcpessentials/guides/authenticated-tasks.md)
>
> Identity factory, isolation rules, and the in-memory store.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.