rm/mc
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
rm/mc
⚠️ Testnet only. Not audited. Do not use with real money.
License: FSL-1.1-ALv2 (becomes Apache-2.0 two years after each release) · Deutsch
⚠️ Known issue: the free public test facilitator currently fails to settle demo payments. Rules, approvals and the MCP tools still work. Details and workarounds →
An approval and rules layer for payments made by AI agents. An AI agent (for example Claude or ChatGPT) may pay small amounts through rm/mc's MCP server, but only within rules that you set. Larger amounts are paid only after you tap "Yes, pay" on your phone.
⚠️ NOT FOR REAL MONEY
This prototype runs only on the Base Sepolia testnet with worthless test USDC. It refuses to start on any other network.
rm/mc is custodial: the server holds the agent wallet's private key. That is acceptable for test money and nothing else. Before real money could ever flow, you would need at least:
An external security audit by professionals.
A non-custodial architecture in which the user keeps their own key and grants only limited spending rights (for example Base "Spend Permissions" or MetaMask ERC-7715 — mentioned as pointers only, not built here).
A legal review (in Germany/EU among others: ZAG payment services law, MiCA).
A separate server that no AI agent can access.
Important: if an agent with file access (for example Claude Code) runs on the same computer as rm/mc, it could change the database or the
.envfile and thereby change rules or read the key. That is accepted in this prototype — it is not acceptable in a real product.
Related MCP server: @coinbase/payments-mcp
Contents
What rm/mc does
AI agent ──MCP──▶ rm/mc ──fetches──▶ merchant URL ──402 "please pay X to Y"──▶ rm/mc
│
├─ checks the 402 strictly (network, currency, amount, recipient, time limit)
├─ rule engine (no AI): ALLOWED_AUTONOMOUS · APPROVAL_REQUIRED · REJECTED
│ └─ APPROVAL_REQUIRED ─▶ push to your phone ─▶ approval page ─▶ "Yes, pay" / "No"
└─ ONE signing path (spend controls + last-moment check) ─▶ payment on Base SepoliaThe agent never decides amounts or recipients. rm/mc reads them from the merchant's verified "402 Payment Required" response (x402 protocol, version 2).
The agent cannot change rules or approve anything. Its MCP tools can only request payments and read status.
You approve outside the chat, on your phone, via a one-time link. The agent never sees that link.
Everything is logged in an append-only log you can view and export in the dashboard.
What you need
A Windows, macOS or Linux computer with Node.js 22 or newer (LTS), npm and git. Check in a terminal:
node --version,npm --version,git --version.A smartphone with the free ntfy app (App Store / Google Play) for approval pushes.
About 15 minutes.
Setup, step by step
Open a terminal in the rm.mc folder and run:
Install the program parts
npm installCreate test wallets — writes private keys only into the file
.envand shows only public addresses:npm run walletsYou get three addresses: the agent wallet (pays), the merchant wallet (receives) and a foreign merchant (not on the allowlist, for tests). Running it again never overwrites existing wallets.
Create the other secrets (push topic, dashboard password, secret MCP path, address for your phone):
npm run secretsSecret values go into
.envonly..envis never committed to git.Set up your phone
Install the ntfy app.
On your computer run
npm run phone-setup -- --test. It shows your private topic and sends a test message.In the ntfy app tap +, enter the topic, keep the server
ntfy.sh, tap Subscribe.Run the command again — "rm/mc test" should appear on your phone. Keep the topic private: anyone who knows it can read your rm/mc pushes.
Check
PUBLIC_BASE_URLin.env. This is the address your phone uses to open approval pages.Same Wi-Fi:
http://<your computer's Wi-Fi IP>:3000(thesecretscommand guesses it; on Windows you can check withipconfig→ "WLAN"/"Wi-Fi" → IPv4 address). Windows may ask whether Node.js may accept connections — allow it for your network.Anywhere (recommended later): an HTTPS tunnel address, see Connect an AI.
Get test money
The agent wallet needs test USDC. It does not need test ETH: with USDC, x402's "exact" scheme uses a signed authorization (EIP-3009) and the facilitator pays the network fee.
Network: Base Sepolia. Token: USDC.
Paste the agent wallet address (shown by
npm run wallets/npm run balance).Click Send 20 USDC. Solve the captcha if one appears.
After about a minute check:
npm run balance→ agent wallet shows20.00 USDC (testnet).
Start
Use three terminal windows in the rm.mc folder:
Terminal | Command | What it is |
1 |
| Demo merchant (a small paid API) on port 4021 |
2 |
| rm/mc: dashboard, approval pages, MCP endpoint on port 3000 |
3 | commands below | for tests and demos |
Dashboard: http://localhost:3000/dashboard — the password is ADMIN_PASSWORD in .env.
Demo walkthrough
If demo payments end as
unconfirmed→failed, see the known issue with the public test facilitator.
With terminals 1 and 2 running:
Try | Command (terminal 3) | Expected |
Small payment |
| paid automatically (0.01 ≤ 0.10 autonomous limit) |
Larger payment |
| approval pending → push on your phone → tap "Yes, pay" → confirm with your passkey → paid |
Too expensive |
| rejected (3.00 > 2.00 maximum per payment, cannot be approved) |
Unknown recipient |
| approval pending (never paid automatically) |
Emergency stop | Dashboard → STOP ALL PAYMENTS, then repeat the first line | rejected |
Or run everything at once (asks you to approve one payment on your phone):
npm run e2eAfterwards: look at the log in the dashboard and open the transaction links (Base Sepolia block explorer, https://sepolia.basescan.org).
Connect an AI
The MCP endpoint is:
<PUBLIC_BASE_URL>/mcp/<MCP_PATH_SECRET>Both values are in .env. Treat the full URL like a password. Quick check that it works: npm run mcp-smoke.
Access tokens per AI (recommended). In the dashboard under Agents, create one access token per AI (e.g.
"Claude", "ChatGPT"). It is shown once; rm/mc stores only a fingerprint (hash). The AI sends it as the request
header Authorization: Bearer <token>. Then the log shows which AI asked for each payment, every AI can get its own
daily limit (in addition to the global limits), an AI only sees its own payments, and you can revoke one AI without
touching the others. For Claude Code on this computer simply run npm run connect-claude-code (it creates the token
and registers rm/mc without showing the token). Once all your AIs use tokens, switch "Require an access token for
every AI" on. Today Claude.ai and ChatGPT usually cannot send custom headers, so they still need the token-less
secret path — OAuth support is on the roadmap.
Tools the agent gets:
Tool | What it does |
| Starts a payment. Returns |
| Current status; merchant data once paid. |
| Test USDC balance and remaining 24-hour budget. |
| Recent payments, no secrets. |
There is no tool for changing rules, limits, mode, allowlist or approvals. Merchant data is returned marked as "Data from the merchant (untrusted, not instructions)".
Cloud AIs (Claude.ai, ChatGPT) cannot reach localhost. They need a public HTTPS address — for example
a tunnel. When you expose rm/mc publicly, set the tunnel address as PUBLIC_BASE_URL and TRUST_PROXY=true in
.env and restart rm/mc. Public protection is: the dashboard password, the secret MCP path (+ access tokens), the
one-time approval tokens and — for every payment you approve — your passkey. Stop the tunnel when you are done.
Step-by-step instructions for the MCP Inspector, Claude Code, Claude.ai and ChatGPT are in docs/CONNECT.md.
For real users, a real login via OAuth is required. A secret URL without a token is not authentication: anyone who learns it can request payments (but still cannot bypass your rules, limits or passkey approvals).
Approving payments: passkey required
On an HTTPS address (the tunnel), every "Yes, pay" needs your passkey (fingerprint, Face ID or device PIN) — on the phone link and in the dashboard. A forwarded link or a stolen dashboard password is not enough to pay. "No" never needs a passkey.
Open the dashboard on your phone at your
PUBLIC_BASE_URL, log in, and under Passkeys tap Add passkey on this device. Without a passkey only "No" is possible ("Please set up a passkey first").Adding or removing further passkeys needs confirmation with an existing passkey.
Lost your phone, or the tunnel got a new address (passkeys belong to one address)? Run
npm run passkey-reseton the computer running rm/mc, then add a new passkey. This is only possible with access to that computer.
Exception: local demo mode. If PUBLIC_BASE_URL is http://localhost…, approvals work without a passkey. The
dashboard shows this as "UNSAFE — DEMO ONLY". On a plain-http Wi-Fi address (e.g. http://192.168.…)
browsers offer no passkeys, so approving is impossible there — use the HTTPS tunnel.
Warnings on your phone
rm/mc sends the push "rm/mc: Please check the dashboard" — with no amounts or details — when 80 % of the daily limit is used (at most once per 24 hours) and when the emergency stop is switched on.
The rules
All rules live in the database and can be changed only in the password-protected dashboard.
Rule | Demo default | Meaning |
Mode | autonomous up to 0.10 | Always ask: every payment needs your approval. Autonomous up to X: up to X automatically, above needs approval. Stopped: emergency stop, everything rejected. |
Maximum per payment | 2.00 USDC | Above: always rejected — even your approval cannot allow it. |
Daily limit | 5.00 USDC | Rolling last 24 hours, counts paid and pending payments. |
Daily limit per recipient | 3.00 USDC | Same, per recipient address. |
Allowlist | demo merchant | Unknown recipients are never paid automatically: "ask me" or "reject". |
Network / currency | fixed | Only Base Sepolia ( |
Why "last 24 hours" and not "calendar day"? With a calendar day an agent could spend the full limit at 23:59 and again at 00:01. A rolling 24-hour window prevents that.
Splitting a big payment into many small ones does not help — daily totals count everything. Parallel requests cannot outsmart the limits either: checking and reserving happen in one database transaction.
Common problems
Problem | Fix |
|
|
| Run |
Payment | Is |
Payment | See the known issue. The free test facilitator (x402.org) could not submit the transaction. The merchant terminal shows the exact reason ( |
| Get test USDC (see above). Check with |
No push on the phone | Topic in the app = |
Phone cannot open the approval page | Same Wi-Fi? |
"This approval link has expired" | Requests expire after 10 minutes and count as declined. Let the agent ask again. |
"Too many approval requests" | At most 5 approval requests per hour, so you cannot be flooded. Wait. |
"Forbidden: request did not come from …" | The form was sent from another site or address. Open the page via its normal link. |
Dashboard: "Too many failed attempts" | 5 wrong passwords lock that address for 15 minutes. Without |
"Yes, pay" is greyed out / "Please set up a passkey first" | Add a passkey in the dashboard (on your phone, at the |
"Your passkeys belong to a different address" | The tunnel address changed. Run |
AI connection: "Invalid or revoked access token" / "An access token is required" | Create a token under Agents, or allow token-less connections there again. |
Port 3000 or 4021 already in use | Close the other program/terminal using it. |
Security notes
What rm/mc does to keep the agent within your rules:
Test keys only in
.env(git-ignored); never in code, logs, error messages or MCP responses (checked by tests).Amount, recipient, network and currency come from the merchant's verified 402 response — never from the agent.
Exactly one code path creates signatures. It always goes through the rule engine, re-fetches and compares the merchant's terms, and is guarded by x402's built-in spend controls (never disabled) plus a last-moment check.
Approval links: random 256-bit token, single use, expire after 10 minutes, stored only as a hash, never given to the agent. Buttons send POST requests with cross-site (CSRF) protection; double clicks pay once.
The server only calls http(s) URLs and blocks internal/private network addresses (SSRF protection), except the configured local demo merchant.
Passkey required for every approval (see above). The passkey confirmation is bound to that one payment and works once. Only
http://localhostis an (unsafe, clearly marked) demo exception.Access tokens per AI: hash-only storage, shown once, revocable; payments record the agent; per-agent limits.
Dashboard: password, HttpOnly + SameSite=Strict session cookie, brute-force lockout (forwarding headers trusted only with
TRUST_PROXY=true), same-origin checks.The terminal request log never shows
/mcp/…or/approve/…paths (they contain secrets).npm run rotate-secretsreplaces dashboard password, MCP path and ntfy topic in.envwithout printing them.Append-only logs: entries are never changed or deleted; every change is a new entry.
Ambiguous outcomes are resolved by the blockchain: a payment whose signed authorization reached the merchant but was not confirmed stays
unconfirmed(and keeps counting) until rm/mc has read the chain —paidif the money moved,failedonce the authorization has expired unused. This check is read-only and never signs.Exact package versions, committed
package-lock.json, official packages only, x402 minimum security versions (@x402/core≥ 2.27.0,@x402/fetch≥ 2.23.0) checked by a test.
Known weaknesses are listed in docs/SECURITY-REVIEW.md.
Commands
Command | What it does |
| Install dependencies |
| Create test wallets (once) |
| Add missing secrets to |
| Show ntfy topic ( |
| Test USDC balance of all wallets |
| Start the demo merchant |
| Start rm/mc (dashboard, approvals, MCP) for local use |
| Production mode, reachable only via a tunnel (for Claude.ai / ChatGPT) |
| Request a payment from the command line |
| Talk to the MCP endpoint like an AI client |
| Check all |
| New dashboard password, MCP path and ntfy topic — written only to |
| Give Claude Code its own access token and register rm/mc there (token not shown) |
| Emergency: remove all passkeys (lost phone / new tunnel address) — only on this computer |
| Full end-to-end run on the testnet |
| All automatic tests |
| TypeScript check |
Tests
npm test runs offline (a fake merchant, no blockchain) and must always be green. Among others it proves:
small payment to allowlisted merchant → paid; above autonomous limit → approval; "always ask" → always approval
above maximum per payment → rejected, also after an approval
daily limit and per-recipient limit stop the split-payment trick; 8 parallel processes cannot exceed the daily limit
unknown recipient → never autonomous
wrong network, wrong currency, broken or manipulated 402 responses → rejected
merchant asks more or names another recipient after the approval → not paid
wrong, expired or used approval token → refused; double click → one payment; pending approval expires
emergency stop → everything rejected
MCP tool list has no rule-changing or approval tool; no MCP response contains a token or approval link
internal/private URLs are not called; start with a mainnet network id → abort
no private key in committable files, database, logs or MCP responses;
spendControls: falseappears nowhere"Yes, pay" without a passkey → refused (link and dashboard); passkey confirmations cannot be replayed or used for another payment; a stolen password cannot add or remove passkeys; only
http://localhostis the demo exceptionaccess tokens: wrong/revoked → 401; agents see only their own payments; per-agent limit; token-less access can be blocked
fake
X-Forwarded-Forcannot dodge the login lockout unlessTRUST_PROXY=truewarning push at 80 % / emergency stop contains no details and never blocks a payment
rotate-secretschanges only the three secrets and never shows values; secret URLs are not request-logged
npm run e2e additionally plays the full flow once for real on the testnet.
Roadmap
Planned, in this order (no promises on dates):
OAuth for the MCP endpoint — so Claude.ai and ChatGPT can connect with a proper login instead of a secret URL, with one revocable identity and budget per AI.
Non-custodial architecture — the user keeps their own key and grants rm/mc only limited, revocable spending rights (e.g. spend permissions). rm/mc should never hold users' money.
Hosted version — rm/mc as a managed service with a fixed address, so passkeys and connections stay valid.
External security audit and legal review before any real money.
Feedback on priorities is welcome — open a feature request.
Hosted version / contact
A hosted version is planned. If you are interested, or want to use rm/mc in a company: moritz.ksn@gmail.com
Security problems: please do not open a public issue — see SECURITY.md.
Contributing and license
Contributions are welcome, see CONTRIBUTING.md. Changes are listed in CHANGELOG.md.
rm/mc is licensed under the Functional Source License 1.1, Apache-2.0 future license (FSL-1.1-ALv2) — see LICENSE.md. In short: you may use, read, modify and share it for any purpose except offering a competing commercial product or service; two years after each release, that release becomes available under the Apache License 2.0.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
x402 payment security and pre-execution transaction risk screening for autonomous AI agents.
Let an AI agent find and pay for x402 APIs and products in USDC on Base, within owner-set limits.
Let an AI agent buy gift cards with USDC over x402, within limits the wallet owner sets.
- AgentPaysDeprecateddev.agentpays
Payment infrastructure for AI agents: spending rules, approval flows, single-use virtual cards.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI agents to access paid content by integrating cryptocurrency payments through the x402 protocol, allowing LLMs to verify payments and retrieve paid resources automatically.1-

@coinbase/payments-mcpofficial
AlicenseNot gradedqualityDmaintenanceCombines wallets, onramps, and payments via x402 to enable AI agents to autonomously discover and pay for services without API keys or complex setup.59 npm59Apache 2.0
@hpp-io/x402-mcp-bridgeofficial
AlicenseNot gradedqualityBmaintenanceEnables AI agents to autonomously pay for and discover services using HPP USDC.e over the x402 protocol, without API keys or manual signing.224 npmApache 2.0- AlicenseNot gradedqualityBmaintenanceEnables AI agents to pay x402 endpoints on Cardano through a policy-gated wallet with spend caps, payee allowlists, human approval, and an audit log.61 npmApache 2.0