EnvarPay
OfficialIntegrates with the Hermes agent runtime to enable selling agent capabilities and making payments through MCP and x402, including serving paid tools and configuring a payment wallet.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@EnvarPaycall the seller's paid ask_agent tool to answer my question about knowledge review"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
EnvarPay is an open-source Python SDK and CLI that connects agents to MCP + x402 v2 payments. Put a USDC payment gate in front of an existing MCP tool or Hermes agent, and give buyers a wallet tool with an explicit spending budget.
Two sides. One package.
Command | What it does | |
Get paid |
| Quote a price, confirm payment, then execute your agent's capability. |
Pay others |
| Give an MCP-capable agent a payment tool constrained by your allowlist and budget. |
sequenceDiagram
participant B as Buyer agent
participant W as EnvarPay wallet
participant S as EnvarPay seller
participant F as x402 facilitator / USDC
participant A as Your agent or MCP tool
B->>W: Call a paid capability
W->>S: MCP tool call
S-->>W: PaymentRequired + price
W->>W: Check recipient and budget; sign
W->>S: Request + x402 payment
S->>F: Verify and settle
F-->>S: Transaction receipt
S->>S: Verify Transfer + authorization nonce
S->>A: Execute after payment
A-->>B: Deliver result through EnvarPayWhy EnvarPay?
Keep your agent. Works with existing MCP tools and an installed official Hermes runtime.
Use open protocols. Official MCP and x402 SDKs handle the wire format. No Envar account or proprietary settlement API is required.
Pay first, work second. The seller checks the exact USDC transfer and nonce before running the paid capability.
Put spending limits in code. Configure allowed services, full recipients, tools, per-call limits and a persistent cumulative budget.
Keep uncertain payments visible. Save the original authorization; reuse request IDs and inspect unresolved attempts without signing again.
Install
Python 3.11+, tested on macOS and Linux. Native Windows permissions are not yet validated; use WSL or Docker.
git clone https://github.com/EnvarAI/EnvarPay.git
cd EnvarPay
python -m pip install .
envar-pay --helpThis alpha is not on PyPI yet. You can also install the wheel from GitHub Releases. For a Hermes seller, install into Hermes's Python environment; see the Hermes setup notes.
Start receiving payments
envar-pay init --directory ./agent-pay --pay-to YOUR_WALLET_ADDRESS --backend hermes
# Configure your model and capability in agent-pay/seller.toml.
envar-pay serve --config ./agent-pay/seller.tomlYour paid ask_agent tool is available at http://127.0.0.1:4020/mcp (or /sse).
The seller needs its receiving address, not its private key.
Already run an MCP service? Choose --backend mcp and configure which tools to sell.
Give an agent a payment wallet
envar-pay keygen --output ./agent-pay/buyer.key
# Fund the dedicated test wallet; review the recipient and budget in buyer.toml.
# Payments default to OFF. Enable them only after reviewing the configuration.
envar-pay hermes-config --config ./agent-pay/buyer.tomlMerge the generated mcp_servers.payments entry into Hermes's MCP configuration.
Other MCP clients can launch the same envar-pay wallet --config ... process.
The agent gets list_paid_tools, call_paid_tool and payment_status.
For a direct call:
envar-pay call --config ./agent-pay/buyer.toml --peer seller --tool ask_agent \
--arguments '{"question":"Help our team plan a weekly knowledge review"}' \
--request-id weekly-review-001For an embedded integration:
from pathlib import Path
from envar_pay import WalletService, load_config
wallet = WalletService(load_config(Path("agent-pay/buyer.toml")))
result = await wallet.call(
"seller", "ask_agent", {"question": "Review these notes"}, "review-001"
)What has been proven?
A prior two-container Hermes POC paid 0.01 test USDC on Base Sepolia, then delivered a real model-generated answer. Buyer balance: 20 → 19.99. Seller: 0 → 0.01.
View the on-chain transaction · Evidence and its limits
The extracted package has been tested with an official Hermes 0.20.0 image, clean wheel installation, real model connectivity and local MCP transport tests. Those tests are not additional blockchain payments. The package rechecked the existing POC receipt; a new package-version live payment is still pending.
Current scope
0.1.0a1 is an alpha, not a production financial system. Defaults use Base
Sepolia, payments off, and a 0.01 test-USDC per-call and cumulative budget.
Included | Not yet included |
MCP Streamable HTTP, SSE and stdio adapters | Agent discovery marketplace and A2A tasks |
x402 v2 exact USDC / EIP-3009, upfront flow | Automatic refunds or delivery-quality guarantees |
Local dedicated-key signer and durable local state | Hosted custody, external signing providers, multi-host coordination |
Duplicate-request protection and read-only receipt reconciliation | Automatic recovery of ambiguous execution or lost transaction hashes |
Base mainnet configuration exists, but this release has no new mainnet payment validation. Preserve the state after an uncertain result: deleting it or creating a new purchase ID can defeat your intended spending controls. A wallet component running under the same OS identity as an agent with shell access is not isolated from that agent. See operating boundaries.
Contribute
Try an integration, report a reproducible issue, or improve interoperability. Start with CONTRIBUTING.md. Report vulnerabilities through GitHub's private reporting channel.
Built with MCP, x402 and optional Hermes integration. EnvarPay is an independent project by EnvarAI, not an official distribution or endorsement by those projects. MIT licensed.
This server cannot be deployed
Maintenance
Related MCP Connectors
Agent-native MCP for governed commerce, x402 payments, paid capabilities, and verifiable receipts.
Metered MCP tools: free discovery over MCP; per-call execution settled in USDC via x402 v2.
Paid MCP tools behind one endpoint. Agents pay per call in USDC on Base via x402.
- mcpOAuthai.agentgates
Confidential compute and inference sold to agents over x402 USDC, plus an agent wallet over MCP.
Related MCP Servers
- AlicenseAqualityAmaintenanceProvides a catalog of paid micro-work tools for text processing, speech, and image generation with fixed USDC pricing via x402. Enables agents to discover capabilities, get quotes, and prepare calls without handling wallet keys.3MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to discover and pay for MCP tools on a sub-cent, pay-per-call basis using x402 and Algorand USDC settlements.10 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables agents to access production-grade paid MCP tools with real on-chain x402 v2 settlement, including EVM wallet risk scoring, payload normalization, and facilitator discovery, all discoverable via Bazaar-compatible metadata.MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to discover, pay for, and call paid APIs from the Coinbase x402 Bazaar via MCP tools, settling USDC micropayments from a CDP treasury wallet.-