npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mcp-usage-control-redis

v1.3.1

Published

Atomic Redis usage store for mcp-usage-control.

Readme

mcp-usage-control-redis

Atomic Redis store for mcp-usage-control.

Distribution: Check the current published version on npm and find verified source artifacts on GitHub Releases. For an unreleased source candidate or local tarballs, follow Use from source.

English

The current adapter implements all-or-nothing multi-budget reserve, pending -> cost-liable activation, renewal, settlement, state-dependent expiry recovery, bounded replay tombstones, and optional recovery observability with Redis-side Lua.

Lease/tombstone timestamps come from Redis server TIME, not application Date.now(). One global lease index ensures an expired reservation affecting several budgets is recovered once. Transactional state intentionally shares one configurable Redis Cluster hash slot.

Pending expiry releases every participating budget. Cost-liable expiry conservatively keeps the full charge. Identical settlement replay is idempotent; conflicting replay fails. The logical replay scope is (tenantId, principal.id, tool, operationId).

Pass the same optional UsageObserver to RedisUsageStore and UsageControl when you want store-level expiry recovery plus runtime lifecycle events. Redis lazy cleanup reports aggregate recovery counts/units and does not persist raw principal, tenant, tool, or budget strings solely for telemetry.

Lua atomicity is not persistence/failover durability. Review HA, persistence, cleanup backlog, acknowledgement ambiguity, and single-slot scaling trade-offs before production use.

日本語

current adapterはRedis-side Luaでall-or-nothing multi-budget reserve、pending -> cost-liable activation、renewal、settlement、state-dependent expiry recovery、bounded replay tombstone、optionalなrecovery observabilityを実装します。

lease / tombstone時刻はapplication Date.now() ではなくRedis server TIME を使います。global lease indexを1つ使うため、複数budgetに影響するexpired reservationを1回だけrecoveryします。transactional stateは意図的に1つのconfigurable Redis Cluster hash slotを共有します。

pending expiryは参加する全budgetを解放し、cost-liable expiryはfull chargeを保守的に維持します。identical settlement replayはidempotent、conflicting replayはfailします。logical replay scopeは (tenantId, principal.id, tool, operationId) です。

store-level expiry recoveryとruntime lifecycle eventの両方が必要なら、同じoptional UsageObserver を RedisUsageStore と UsageControl に渡します。Redis lazy cleanupはrecovery件数/unitsをaggregateして通知し、telemetryのためだけにraw principal、tenant、tool、budget stringを永続化しません。

Lua atomicityはpersistence / failover durabilityと同一ではありません。production利用前にHA、persistence、cleanup backlog、ACK ambiguity、single-slot scaling trade-offを確認してください。

Operation reconciliation (v0.8)

RedisUsageStore implements optional scalar OperationReconciliationStore and v0.13 VectorOperationReconciliationStore through read-only Lua lookups. Expected retained scalar units or exact vector dimension/budget topology must match authoritative retained state or the lookup fails closed. Real-Redis CI runs the portable scalar and vector reconciliation conformance suites.

Atomic vector usage (v0.7)

RedisUsageStore implements optional VectorUsageStore with vector-specific Lua transactions. Existing mode-less reservation JSON remains scalar; vector metadata is additive and requires no key/balance migration. Real-Redis integration covers portable vector conformance and committed-growth acknowledgement-loss replay.