Payments for MCP servers
An MCP server exposed over HTTP is an API — which means x402 can charge for it per tool call. The agent's client hits your gated endpoint, receives the 402 challenge, pays, and retries; your tools never know billing exists.
Because payment is per-call, you skip everything that kills MCP monetization today: API-key distribution, subscription management, and asking a user to enter a card for an agent's tool.
Gate the HTTP transport
Serve your MCP server over HTTP (rather than stdio) and put the paygate middleware — or the hosted proxy — in front of the endpoint. Express example:
import express from "express"; import { paygate } from "paygate/express"; const app = express(); const pw = paygate({ merchantId: process.env.PAYGATE_MERCHANT_ID }); // Each MCP request (tool call) pays 2 cents. app.post("/mcp", pw({ priceCents: 2 }), mcpHttpHandler); app.listen(3000);
Get discovered by paying agents
List the server in the ArisPay agent marketplace (agentmarketplace.arispay.app). Listings carry transport, capabilities, and pricing metadata that agents query programmatically via /v1/marketplace/discover — a budget-bounded search that favors paid, healthy, verified endpoints.
On the buyer side, any AI agent can pay your endpoint with `npx payagent pay <url>` or the payagent SDK — the 402 challenge your route now returns is the whole integration contract.
Pricing guidance
- Price per tool call, in integer cents. Tools with an upstream cost (search, enrichment, inference) should be priced cost-plus; pure-compute tools can start at 1 cent.
- If different tools have very different costs, split them across routes so each carries its own price rather than averaging.
FAQ
- Does this work with stdio MCP servers?
- Payment gating happens at an HTTP boundary. Publish an HTTP transport for the paid surface; a stdio distribution can stay free for local use.
- How do agents find the price?
- The 402 challenge carries it. Marketplace listings also expose pricing metadata so agents can budget before they ever call you.
Is your service agent-ready?
Run the free readiness scan — it inspects your live endpoint's discoverability, machine-readable contracts, and payment support, then tells you the highest-impact fix.
