Skip to main content
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.

Why use ATXP for MCP servers?

  • Earn per-use: Charge per tool call with flexible pricing.
  • Programmatic enforcement: Require payment before execution with a single router 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 express SDK in your project:
npm install @atxp/express
2

Set up your wallet

Create an ATXP account and set your wallet address 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
ATXP_CONNECTION=<YOUR_ATXP_CONNECTION_STRING>
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 router to your MCP server:
// Import the ATXP SDK and other dependencies
import { atxpExpress, requirePayment, ATXPPaymentDestination } from '@atxp/express';  
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 ATXP_CONNECTION = process.env.ATXP_CONNECTION

// Add the ATXP payment router
app.use(atxpExpress({ 
  paymentDestination: new ATXPPaymentDestination(ATXP_CONNECTION), // Your connection string
  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

I