AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Paidmcp Template

mcp-paidmcp-template · by paidmcp

Forkable template for MCP servers that charge AI agents per call in USDC (Base) or USDT0 (Plasma) - powered by x402 + Tether WDK.

No reviews yet
0 installs
37 views
0.0% view→install

Install

$ agentstack add mcp-paidmcp-template

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-paidmcp-template)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Paidmcp Template? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

paidmcp/template

Build native Streamable HTTP MCP servers that charge per call with x402.

Quickstart

Run inside template/:

npm install
npm run setup
npm run dev

Default setup is NETWORK_MODE=test so you can start with Base Sepolia before switching to live mode.

Commands

Run inside template/ after npm install.

| Command | What it does | | ---------------------------- | ---------------------------------------------------------------- | | npm run setup | creates .env defaults, generates SEED_PHRASE, sets test mode | | npm run wallet:create | prints a new receiver seed phrase | | npm run wallet:info | shows receiver address plus Base/Plasma balances | | npm run calls:recent | shows recent paid/trial calls from SQLite | | npm run dev | starts the native MCP server at /mcp | | npm run build && npm start | runs compiled server |

Endpoints

  • Native MCP endpoint: POST/GET/DELETE /mcp
  • Compatibility listing endpoint: GET /mcp/tools

Tool authoring stays in src/tools.ts. The server automatically exposes those tools over MCP and enforces x402 for tools/call.

Free trial + payment behavior

  • FREE_TRIAL_CALLS controls how many successful trial calls each payer gets.
  • After trial quota, tool calls require x402 settlement.
  • Successful paid calls and successful trial calls are both logged in SQLite (is_trial column).

Key files

  • src/tools.ts - define paid tools (name, description, priceUsdt, schema, handler)
  • src/server.ts - MCP transport + per-tool x402 enforcement + trial handling
  • src/config.ts - env validation
  • src/log.ts - SQLite call logging
  • src/payments.ts - facilitator + x402 scheme wiring

Environment

See .env.example for all variables.

  • NETWORK_MODE=test|live controls default network/facilitator behavior.
  • Leave BASE_FACILITATOR_URL empty to use mode defaults.
  • For live Coinbase facilitator, set CDP_API_KEY_ID + CDP_API_KEY_SECRET.

Deployment

  • Fly.io config: deploy/fly.toml
  • Railway config: deploy/railway.json
  • Dockerfile: deploy/Dockerfile

deploy/fly.toml sets DB_PATH=/app/data/paidmcp.db so SQLite persists on the mounted volume.

License

MIT. See LICENSE.

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.