> ## Documentation Index
> Fetch the complete documentation index at: https://ai.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.

## When to use it

The host already runs NATS and wants KV plus a native subject instead of a database plus a separate bus.

## Intended how-to

1. Add `McpEssentials.Nats` and a NATS connection.
2. Put each `StoredMcpTask` in a JetStream KV bucket keyed by task id, including `OwnerUserId`.
3. Register the store as a singleton with the same current-user factory as [Authenticated tasks](https://ai.easyaf.dev/mcpessentials/guides/authenticated-tasks.md).
4. 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`).

See [Stores](https://ai.easyaf.dev/mcpessentials/guides/stores.md).


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