When to use it
- The host already runs Azure Cosmos DB for NoSQL.
- You want
/ownerUserIdas the partition key and native document TTL.
AddMcpTasksTable today. The native package earns its keep with in-partition point reads and change feed fan-out.
Intended how-to
- Add
McpEssentials.Cosmos. - Create a tasks container partitioned by
/ownerUserId. Point reads aretaskId+ partitionownerUserId. - Client-facing get/cancel/resolve always have the user, so they stay in-partition.
- Server-facing complete has
taskIdonly. Keep a second index containerMcpTaskIndexwithtaskIdas partition key mapping toownerUserId.CreateTaskAsyncawaits both writes. - Register the store as a singleton with the same current-user factory as Authenticated tasks.
Events
Change feed oninput_required transitions and input-request map changes, or Azure Service Bus as IMcpTaskInputSignalBus.
TTL
Cosmos native TTL on the document fromDiscardAfter (Unix seconds), or a container default.
See Stores.