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

@lgolabs/idempotency-mcp

v0.2.2

Published

MCP server for the LGO Labs Idempotency API. Stripe-style idempotency keys for any AI agent tool call.

Readme

LGO Labs — Idempotency API

Stripe-style idempotency keys for any AI agent tool call. One header. Pay-per-call USDC. No signup.

Agents retry. They retry on timeouts, on partial failures, on flaky networks. Without an idempotency primitive, a single retry sends two emails, writes two database rows, or charges a customer twice. This API is that primitive — and it's fronted by an MCP server so agents can call it as a tool, not as glue.

# 30 seconds: one-shot mode (recommended)
curl -X POST https://idempotency.lgolabs.com/v1/execute \
  -H "Authorization: Bearer $LGOLABS_KEY" \
  -H "content-type: application/json" \
  -d '{
    "key":        "send-welcome-email-user-42",
    "target_url": "https://your.api/send-email",
    "payload":    { "to": "[email protected]", "template": "welcome" }
  }'

The first call hits your API. Every subsequent call with the same key returns the cached response without re-calling your API. That's it.


Why this exists

If you're wrapping a Stripe-style retry pattern around an LLM tool call, an external HTTP webhook, or a database write — this is the cheapest way to never ship the bug twice.

Six endpoints, two modes

Mode A — Bookkeeping (you control the side effect)

POST /v1/claim   → fresh + lock_token | in_flight + claim_age_seconds | duplicate + result
POST /v1/store   → store result against lock_token, transition to "stored"
POST /v1/release → drop your in_flight lock voluntarily (caller cancels)
GET  /v1/lookup/{key} → read-only inspection

Mode B — One-shot (we run the operation for you, recommended)

POST /v1/execute → claim → fetch your URL → cache → return
                   { dedup: "fresh"|"duplicate", upstream: { status, body, headers } }

Utilities

POST /v1/derive-key → deterministic key from {operation, inputs, scope}.
                      Solves "agents pass random UUIDs every retry."
GET  /healthz       → ok

Full spec: idempotency.lgolabs.com/openapi.yaml.

Install (MCP)

In Claude Desktop, Cursor, Windsurf, Zed, or any MCP-aware client:

{
  "mcpServers": {
    "lgolabs-idempotency": {
      "command": "npx",
      "args": ["-y", "@lgolabs/idempotency-mcp"],
      "env": {
        "IDEMPOTENCY_API_URL": "https://idempotency.lgolabs.com",
        "IDEMPOTENCY_API_KEY": "sk_..."
      }
    }
  }
}

Tools exposed: idempotency_claim, idempotency_store, idempotency_release, idempotency_execute, idempotency_derive_key, idempotency_lookup.

Install (TypeScript SDK)

npm i @lgolabs/idempotency-client
import { IdempotencyClient } from '@lgolabs/idempotency-client'

const idem = new IdempotencyClient({
  apiUrl: 'https://idempotency.lgolabs.com',
  apiKey: process.env.LGOLABS_KEY,
})

// One-shot: never sends duplicate emails on retry
const r = await idem.execute({
  key: 'send-welcome-email-user-42',
  targetUrl: 'https://your.api/send-email',
  payload: { to: '[email protected]', template: 'welcome' },
})
console.log(r.dedup)  // "fresh" first time, "duplicate" on every retry

Pay-per-call without signup (x402)

Any endpoint accepts an X-PAYMENT header instead of Authorization. The first request returns a 402 with payment requirements per x402.org; your client signs a USDC transfer on Base, retries with the signed payload, gets the result. ~200ms settlement, no chargebacks. Free tier: 500 calls/day.

Pricing

| Tier | Limit | Price | |---|---|---| | Free | 500 calls / day | $0 (API key or x402 wallet) | | PAYG | beyond free tier | $0.001 per call | | x402 | per call, no signup | 1000 atomic micro-USDC ($0.001) per call |

The fastest way to try it without any setup: use x402. Your client signs a USDC transfer on Base, retries with the signed payload, gets the result. ~200ms settlement, no signup.

How it works

  • Cloudflare Durable Objects. One DO per (customer, idempotency_key) ⇒ single-writer, strongly consistent. The 50-concurrent-claim test in tests/concurrency.test.ts asserts that exactly one caller sees fresh under contention.
  • TTL via DO alarm. Each record self-expires after ttl_seconds (default 24h). No cron, no GC.
  • Hono on Workers. Sub-200ms p99, scale-to-zero, global edge.
  • OpenAPI as source of truth. The MCP server, the SDK, and openapi.yaml are all derived from the same contract.

Status

v0.2 — 6 endpoints, MCP server + TypeScript SDK published, structured errors, deployed at idempotency.lgolabs.com.

License

MIT.