A wallet you own.
An approval you control.
This optional local MCP server proposes an exact paid-tool request, waits for your approval in a separate terminal and can then submit one USDC payment. The key and durable ledger stay on your computer. It is not a hosted wallet, card or automatic refund service.
The local guard and protocol tests do not prove a Base mainnet purchase. This preview has no independent security audit. Complete your own low-value canary before using it with real tasks. You pay the quoted USDC amount; development being free does not make real purchases free.
01Use a separate wallet and process
Use Node.js 24 or newer and a dedicated Base wallet with a small USDC balance. The signing process must run outside the agent's shell/filesystem permissions. A model with access to the same OS account, private environment or ledger can bypass local approval controls. Limits apply to this bridge, not to transfers made elsewhere.
02Download and install
Save all four files in one private directory, check them against the published SHA-256 sums, inspect them, then install the pinned dependencies.
sha256sum -c SHA256SUMS # macOS: shasum -a 256 -c SHA256SUMS npm install node --version node bridge.mjs help
03Configure privately
Set these variables in the private environment of the local MCP process. Do not paste the wallet key into a prompt, web form, ticket or committed MCP configuration. Use the public address of the dedicated wallet.
INVOKEPORT_SPEND_WALLET=<dedicated public wallet address> INVOKEPORT_SPEND_PRIVATE_KEY=<private local secret> INVOKEPORT_SPEND_LEDGER=<absolute private path>/spend.sqlite INVOKEPORT_SPEND_TOTAL_ATOMIC=100000 INVOKEPORT_SPEND_PER_PAYMENT_ATOMIC=50000 INVOKEPORT_SPEND_DAILY_ATOMIC=50000 INVOKEPORT_SPEND_MONTHLY_ATOMIC=100000 INVOKEPORT_SPEND_TOOLS=secret-redactor,markdown-chunker
Optional since 0.3: INVOKEPORT_SPEND_DAILY_ATOMIC caps approvals in any rolling 24 hours (it must be at least the per-payment limit), and INVOKEPORT_SPEND_TOOLS limits the agent to a comma-separated list of tools; anything else is refused before a quote is requested. Leave them unset for no daily cap and all tools.
INVOKEPORT_SPEND_MONTHLY_ATOMIC caps approvals across a rolling 30 days for both manual and automatic approval. Set it between the per-payment limit and total budget. The total budget still accounts for older payments. Restart the bridge after changing its limits.
Optional since 0.4, an auto-approval policy lets small requests skip the manual step. It needs all three of INVOKEPORT_SPEND_AUTO_APPROVE=accept-unattended-payments, INVOKEPORT_SPEND_AUTO_APPROVE_MAX_ATOMIC (per call, at most the per-payment limit) and INVOKEPORT_SPEND_AUTO_APPROVE_DAILY_ATOMIC (rolling 24 hours, inside the daily and total limits). Anything larger still waits for you. The agent cannot change the policy; freezing the bridge stops it. Without these variables every payment needs your approval, as before.
node bridge.mjs simulate secret-redactor 11112 # what would the policy decide? node bridge.mjs report # spend by tool and day, auto-approved share, blocks node bridge.mjs export csv > spend-audit.csv # no inputs, results or signatures
These example limits are 0.10 USDC total and 0.05 USDC per payment, including the quoted platform fee. They are a lifetime allowance for this ledger, not a recurring charge. Keep the ledger and its WAL files; deleting or replacing them resets the local accounting. Configure a separate ledger and wallet for each agent.
{
"mcpServers": {
"invokeport-paid": {
"command": "node",
"args": [
"<absolute path>/bridge.mjs",
"serve"
]
}
}
}04Review and approve the exact request
The agent calls spend_propose_purchase with a unique requestId, one of data-cleaner / dataset-diff / html-markdown / openapi-review / openapi-change-review / json-quality-audit / agent-tool-lint / llm-output-check / markdown-chunker / secret-redactor, the actual JSON and its purpose. Input rejection or a wrong chain, token, payee or excessive quote stops before signing. A successful proposal returns a fingerprint.
node bridge.mjs review <requestId> node bridge.mjs approve <requestId> <fingerprint> --accept-upfront-risk
Review the actual input, destination, total USDC price and expiry in your terminal. Approval expires after 15 minutes; an expired request stops reserving budget. The flag accepts that payment settles before tool execution and upstream failure has no automatic refund. MCP deliberately exposes no approval command. Keep the review/approval terminal outside the agent's permissions.
05Run once, then inspect the receipt
The agent calls spend_buy_approved using that same requestId and fingerprint. The bridge reserves its allowance before signing, checks the USDC domain and balance, and verifies both the Transfer and the exact AuthorizationUsed nonce in a successful on-chain receipt. spend_result reads the locally retained result without sending another payment.
node bridge.mjs status node bridge.mjs freeze node bridge.mjs cancel <unsigned requestId> node bridge.mjs reconcile <unknown requestId>
A failure before the signed payment is sent (missing key, wrong network, low balance) ends as not_paid and releases the allowance. An uncertain response after sending keeps its allowance reserved; there is no automatic retry or replacement signature. reconcile reads the USDC authorization state on Base: a used nonce becomes paid_unconfirmed_delivery, an unused nonce after its deadline becomes not_paid. Rejections show a reason code such as per_payment_limit or approval_expired, never input or keys. A confirmed payment with failed delivery remains a charge; use the purchasing wallet's purchase history and recovery or support. Cancellation is allowed only before signing. To resume a deliberately frozen bridge, run node bridge.mjs unfreeze.
Free remote MCP is a separate connection
The hosted endpoint /api/mcp executes free data tools with a limited API key. The paid preview runs locally and uses the paid gateway with separate wallet approval.