MCP Monetize - Drop-in Billing & Capability Token Engine MCP Server
Drop-in billing, paywalls, and capability token middleware for MCP servers.
MCP Monetize - Drop-in Billing & Capability Token Engine scores 63 (Good), licensed MIT and written in TypeScript. It installs as a local process. It does not declare tools yet. Filed under Finance. GitHub shows 0 stars. Package registries report about 881 downloads a week. Install configs are generated for 10 clients. Being listed in the registry is not the same as being vendor-official.
Good trust
63 of 100 from six public signals. Nobody can buy a point.
- Listed in the official MCP registry.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade C
65/100 for listing completeness. Lost points: no listed tools, short summary.
How quality is graded
Where the 63 comes from
22 + 20 + 0 + 10 + 4 + 7 = 63. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 22 of 30 points.How recently the repository saw a commit or release.
Maintenance: 20 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 0 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 7 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "ritualdev-lab-mcp-monetize": { "command": "npx", "args": [ "-y", "@ritualdev-lab/mcp-monetize@0.1.3" ] } }}
Environment variables
This server does not declare environment variables.
Tools
All capabilitiesTools show up when the registry metadata or the repository README lists them. Public READMEs are read directly. A GitHub token is used only when one is already configured.
About
💳 mcp-monetize
Drop-in billing, credit tracking, and paywall middleware for Model Context Protocol (MCP) servers.
Monetize your AI agent tools in 3 lines of code with Dodo Payments & Stripe.
⚡ The Problem
Developers are publishing thousands of Model Context Protocol (MCP) servers for Claude Desktop, Cursor, and Windsurf. But until now:
- There was no standard way to charge users per tool invocation or per month.
- Tool creators bear the heavy server, LLM API, and scraping costs while users consume unlimited queries for free.
mcp-monetize solves this by giving MCP server creators an effortless 3-line drop-in middleware that manages quotas, verifies credits, and returns interactive payment links directly inside the agent chat when quotas run out.
mcp-monetize vs. mcp-builder-kit
| Package | Role | When to Use |
|---|---|---|
mcp-monetize (this repo) | Commercial Billing Clearinghouse & Paywall SDK | Monetizing MCP tool invocations with Universal Pre-Paid MCP Credits, usage quotas, Dodo Payments / Stripe checkout links, and webhook-driven credit settlement. |
@ritualdev-lab/mcp-builder-kit (RitualDev-Lab/mcp-builder-kit) | Free Open-Source (Apache-2.0) MCP Scaffolding CLI | Bootstrapping TypeScript/Python MCP servers (stdio / streamable-http), wrapping tools with --with-agentshield redaction, converting OpenAPI/GraphQL/Protobuf specs, and running protocol conformance tests. |
🚀 Quickstart (3 Lines of Code)
1. Install
npm install @ritualdev-lab/mcp-monetize
# or
pnpm add @ritualdev-lab/mcp-monetize
2. Wrap your MCP tool handler
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { withMcpMonetization } from "@ritualdev-lab/mcp-monetize";
import { z } from "zod";
const server = new McpServer({ name: "market-oracle", version: "1.0.0" });
server.tool(
"query_stock_valuation",
{ ticker: z.string() },
withMcpMonetization(
async ({ ticker }) => {
const data = await fetchValuation(ticker);
return { content: [{ type: "text", text: `Valuation for ${ticker}: $142.50` }] };
},
{
// Your Dodo Payments or Stripe payment link
checkoutUrl: "https://checkout.dodopayments.com/buy/pdt_0NpjONGugY5QkrFDUaPva",
priceLabel: "$5 for 1,000 queries",
freeTierCalls: 5 // 5 free queries for every new user
}
)
);
📦 1-Click Production Starter Kit
Looking for a complete, runnable production MCP server with token-bucket rate limiting, SQLite persistence, and Dodo Payments / Stripe webhook listener?
Check out examples/production-starter-kit/:
server.ts: Metered tools (financial_report,semantic_search,ping) with burst rate limiting and PASETO capability tokens.webhook-server.ts: HTTP webhook listener on port 4001 fulfilling customer credits upon payment.client-demo.ts: Interactive script simulating free calls, paywall trigger, and webhook fulfillment.
cd examples/production-starter-kit
npm install
npm run demo
🖼️ How the Agent Sees the Paywall
When a user in Claude Desktop, Cursor, or Windsurf exhausts their free calls, the agent automatically receives structured markdown prompting the user to top up:
🔒 Usage Limit Reached for `query_stock_valuation`
Your complimentary tool credits have been exhausted. To continue executing queries with uninterrupted speed:
### 💳 Unlock Instant Access ($5 for 1,000 queries)
👉 [Click Here to Activate / Top-Up Credits via Secure Checkout](https://checkout.dodopayments.com/buy/pdt_xyz)
---
*User Ref: `dev_client_01` • Payments securely powered by Dodo Payments & Stripe.*
Once the user completes payment via UPI, Credit Card, or Apple Pay, their webhook or API key activates paid credits and execution resumes seamlessly!
⚙️ Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
checkoutUrl | string | (userId: string) => string | Required | Dodo Payments product link or Stripe Payment link. Can be dynamic function. |
freeTierCalls | number | 5 | Number of free calls given to each new user before paywall triggers. |
priceLabel | string | "$0.05 / call" | Pricing description displayed inside the paywall message. |
provider | "dodo" | "stripe" | "custom" | "dodo" | Payment provider tag. |
store | TokenStore | MemoryTokenStore | Storage engine (MemoryTokenStore or JsonFileTokenStore). |
getUserId | (args, extra) => string | Automatic | Custom function to extract workspace or user ID. |
customPaywallMessage | (info) => string | Standard template | Optional custom paywall markdown generator. |
💾 Storage Adapters
1. In-Memory (Default)
Fastest, zero-dependency. Great for local desktop tools.
import { MemoryTokenStore } from "mcp-monetize";
const store = new MemoryTokenStore(5);
2. SQLite Database Persistence
Built-in node:sqlite store with zero native dependencies. Supports thread-safe transactions and atomic balances.
import { SqliteTokenStore } from "mcp-monetize/adapters/sqlite";
const store = new SqliteTokenStore("./data/mcp-credits.sqlite", 10);
3. Serverless Redis / Upstash
Designed for cloud-hosted MCP servers (Render, Fly.io, Railway, AWS Lambda).
import { RedisTokenStore } from "mcp-monetize/adapters/redis";
const store = new RedisTokenStore({
url: process.env.UPSTASH_REDIS_REST_URL!,
token: process.env.UPSTASH_REDIS_REST_TOKEN!,
defaultFreeCredits: 10
});
4. JSON File Persistence
Zero database dependencies; persists user credits across server restarts in mcp-credits.json.
import { JsonFileTokenStore } from "mcp-monetize";
const store = new JsonFileTokenStore("./data/credits.json", 10);
🤝 Webhook Fulfillment Engine (Turnkey Dodo & Stripe)
Use the built-in PaymentWebhookHandler to process checkouts and replenish user credits automatically:
import { PaymentWebhookHandler, SqliteTokenStore } from "mcp-monetize";
const store = new SqliteTokenStore("./data/tokens.sqlite");
const webhooks = new PaymentWebhookHandler({
store,
dodoWebhookSecret: process.env.DODO_WEBHOOK_SECRET || process.env.DODO_PAYMENTS_WEBHOOK_KEY,
stripeWebhookSecret: process.env.STRIPE_WEBHOOK_SECRET
});
// In your Express or Fastify server:
app.post("/api/webhooks/dodo", async (req, res) => {
const result = await webhooks.handleDodoWebhook(req.body, req.headers["x-dodo-signature"]);
res.status(result.success ? 200 : 400).json(result);
});
🔐 Cryptographic License Key Verification
For off-line or client-side MCP distribution (where users supply a license key in claude_desktop_config.json):
import { McpLicenseValidator } from "mcp-monetize";
const validator = new McpLicenseValidator("your_hmac_secret_key_min_32_chars");
// Issue a 30-day license key:
const token = validator.generateLicenseKey("user_456", 30);
// Verify inside your tool:
const check = validator.verifyLicense(token);
if (check.valid) {
console.log(`Verified user ${check.userId}, expires: ${check.expiresAt}`);
}
📦 Turnkey Starter Kit & Production Examples
Looking for ready-to-deploy boilerplates? Check the examples/ directory:
examples/01-weather-api-server.ts— Pay-per-query API ($5 for 500 calls).examples/02-sql-agent-server.ts— Monthly recurring subscription with HMAC license verification.examples/03-web-scraper-server.ts— Usage credits with turnkey Dodo checkout webhook.
👉 Get the complete package with instant setup at ritualdev.in/mcp-starter-kit.
📜 License
MIT © RitualDev Lab
💖 Sponsor & Support
If you find this project valuable, consider supporting our open-source development:
🛡️ Community & Governance
Frequently asked questions
What is MCP Monetize - Drop-in Billing & Capability Token Engine MCP Server?
Drop-in billing, paywalls, and capability token middleware for MCP servers.
How do I install MCP Monetize - Drop-in Billing & Capability Token Engine MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. MCP Monetize - Drop-in Billing & Capability Token Engine MCP Server runs locally from the npm package @ritualdev-lab/mcp-monetize with the command npx -y @ritualdev-lab/mcp-monetize@0.1.3.
Is MCP Monetize - Drop-in Billing & Capability Token Engine MCP Server free and open source?
Yes. MCP Monetize - Drop-in Billing & Capability Token Engine MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does MCP Monetize - Drop-in Billing & Capability Token Engine MCP Server support remote (HTTP) connections?
No remote endpoint is listed for MCP Monetize - Drop-in Billing & Capability Token Engine MCP Server. It runs locally on your machine over stdio, started by your MCP client.
How is MCP Monetize - Drop-in Billing & Capability Token Engine MCP Server's trust score calculated?
MCP Monetize - Drop-in Billing & Capability Token Engine MCP Server scores 63 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.