Turn your MCP tools into a revenue stream with pay‑per‑call pricing—without building billing, authentication, or account management. ATXP lets you require payment before execution, so you get predictable income with minimal overhead.
  • Earn per-use: Charge per tool call with flexible pricing.
  • Programmatic enforcement: Require payment before execution with a single middleware and helper.
  • No user accounts or API keys: Agents pay from their own wallets; you don’t manage users, keys, or invoices.
  • Works everywhere: Compatible with major hosts (e.g., Claude, Goose), local dev, and your own infrastructure.

Build your first monetized MCP server

1

Install the library

Install the ATXP server SDK in your project:
npm install @atxp/server
2

Set up your wallet

Create an ATXP wallet and set your wallet ID in an environment variable. The best way to do this is to create a .env file in the root of your project and add the following line:
.env
PAYMENT_DESTINATION=<YOUR_WALLET_ID>
Never commit wallet address to version control. It is a good idea to add your .env to your .gitignore file to prevent it from being committed.
echo .env >> .gitignore
3

Integrate with your MCP server

Add the ATXP Express middleware to your MCP server:
// Import the ATXP SDK and other dependencies
import { atxpServer, requirePayment } from '@atxp/server';  
import BigNumber from "bignumber.js"; 

// Create your MCP server
const server = new McpServer();

// Define your MCP tools...
// server.tool(...);

// Create and configure your Express server
const app = express()
app.use(express.json())

// Read your wallet ID from the environment variable
const PAYMENT_DESTINATION = process.env.PAYMENT_DESTINATION

// Add the ATXP payment middleware
app.use(atxpServer({ 
  destination: PAYMENT_DESTINATION, // Your wallet ID
  payeeName: 'Your Server Name',    // The name of your MCP server
}))  

// Other MCP server configuration...
4

Add payment requirements to tools

In each MCP tool exposed by your server that you want to charge per-use for, require payment before tool execution:
server.tool(
  "upcase",
  "Convert the provided string to uppercase",
  {
    text: z.string().describe("The text to convert to uppercase"),
  },
  async ({ text }) => {
    // Require payment (in USDC) for the tool call
    await requirePayment({price: BigNumber(0.01)}); 

    // Your tool's logic
    const result = text.toUpperCase();

    // Return the result of the tool call
    return {
      content: [
        {
          type: "text",
          text: result,
        },
      ],
    };
  }
);
5

Connect to your MCP server

Deploy your changes and connect to your MCP server with a host such as Goose or Claude to start paying for tool calls.
Running your MCP server locally? See on how to connect to a local MCP server.

Resources