Skip to main content

ForgingStack Ration

One quota pool, many agents, no overruns.

mcp-name: io.github.jdkabattles/forgingstack-ration

This is the public client for Ration. The service itself — the token bucket, the receipt chain, the key store, and billing — runs on ForgingStack's private service and is not in this repo. Copying this repo does not give you the service: you still need an API key and credits, from signup below.

Live API: https://forgingstack-ration.jkbattles.workers.dev

What it does

A principal creates a pool with a capacity, a refill rate, a per-agent cap, and a burst limit. Agents draw units from it. The pool enforces the limits and issues a hash-chained receipt for every draw attempt — allowed and denied.

A draw is denied when:

  • the units exceed the burst limit (draw_exceeds_burst)
  • the pool does not have enough available units (pool_insufficient_units)
  • the agent's allowed draws inside the rolling 60-minute window would exceed the per-agent cap (per_agent_cap_exceeded)

The per-agent cap window is a rolling 60 minutes — a documented design choice, not a calendar window.

Signup (v1)

curl -X POST https://forgingstack-ration.jkbattles.workers.dev/v1/signup \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com"}'

Returns an API key once and 100 starter credits. Save the key immediately — it is stored only as a hash and cannot be shown again. Click the verification link in the signup email before the key can create pools or draw: until then, pool creation and draws return 403 email_not_verified.

Buying more credits

1 credit per pool creation, 1 credit per draw call (allowed or denied). Top-ups, pool reads, pool lists, and deletes are free.

curl -X POST https://forgingstack-ration.jkbattles.workers.dev/v1/billing/checkout \
  -H "X-API-Key: YOUR_PRIMARY_KEY"

Returns the Stripe Payment Link: $10 for 1,000 credits. Pay on Stripe's hosted page with the same email you signed up with. Credits land once the payment is verified (within the hour).

Use it (MCP, stdio)

Set the key, then run the MCP server in this repo:

export FORGINGSTACK_API_KEY="your-key-here"
python -m app.mcp_server

Tools: create_pool, draw, get_pool, list_pools, topup_pool, delete_pool, get_credits, get_receipt. See SKILL.md for when to use it and when not to.

Price

1 credit per pool creation. 1 credit per draw call — a denied draw still costs 1 credit, the draw was performed. An idempotent replay (same Idempotency-Key) is free and returns the original receipt.

Files in this repo

  • app/mcp_server.py — MCP wrapper client (stdio, stdlib only)
  • SKILL.md — when to use it, how to read allowed/denied
  • agent-card.json — A2A-style discovery card
  • server.json — MCP Registry metadata
  • pyproject.toml — package metadata for the MCP client

Metadata

Release files for forgingstack-ration 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for forgingstack-ration 0.1.0
File Size Uploaded Provenance Actions
forgingstack_ration-0.1.0.tar.gz 5.6 kB Without provenance Details for forgingstack_ration-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for forgingstack-ration 0.1.0
File Interpreter ABI Platform Actions
forgingstack_ration-0.1.0-py3-none-any.whl Python 3 none any Details for forgingstack_ration-0.1.0-py3-none-any.whl

Total release size: 12.1 kB

Release files / forgingstack_ration-0.1.0.tar.gz

Download URL forgingstack_ration-0.1.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2e4f9f55e976ed7db405da1047ea97940ccce6b39a9f569f6607142602cee31f
BLAKE2b-256 checksum
How to use checksums
76e78d26e77f208282c5461c4132bbfd01bda5d904b228dd406703244c6a7eea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.12

Release files / forgingstack_ration-0.1.0-py3-none-any.whl

Download URL forgingstack_ration-0.1.0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e353b1f64b6d336306dd3bcb0aa1d664324d95071e75ab8fe05f5a390efed06b
BLAKE2b-256 checksum
How to use checksums
51baafbb4c98490878a2c2b8210985e0b2bbf8255d239561588064e4d292f511
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.12

Security for forgingstack-ration 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page