> ## Documentation Index
> Fetch the complete documentation index at: https://docs.atxp.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP server quickstart

> Monetize your MCP tools in minutes with ATXP

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

<Steps>
  <Step title="Install the library">
    Install the [ATXP express SDK](https://www.npmjs.com/package/@atxp/express) in your project:

    ```bash theme={null}
    npm install @atxp/express
    ```
  </Step>

  <Step title="Set up your wallet">
    <a href="/developers/monetize/create-account" target="_blank">Create an ATXP account</a> 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:

    ```bash .env lines theme={null}
    ATXP_CONNECTION=<YOUR_ATXP_CONNECTION_STRING>
    ```

    <Warning>
      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.

      ```bash theme={null}
      echo .env >> .gitignore
      ```
    </Warning>
  </Step>

  <Step title="Integrate with your MCP server">
    Add the ATXP Express router to your MCP server:

    ```typescript theme={null}
    // Import the ATXP SDK and other dependencies
    import { atxpExpress, requirePayment, ATXPAccount } from '@atxp/express';  // [!code ++]
    import BigNumber from "bignumber.js"; // [!code ++]

    // 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 // [!code ++]

    // Add the ATXP payment router  // [!code ++]
    app.use(atxpExpress({ // [!code ++]
      destination: new ATXPAccount(ATXP_CONNECTION), // Your connection string  // [!code ++]
      payeeName: 'Your Server Name',    // The name of your MCP server  // [!code ++]
    }))  // [!code ++]

    // Other MCP server configuration...
    ```
  </Step>

  <Step title="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:

    ```typescript theme={null}
    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  // [!code ++]
        await requirePayment({price: BigNumber(0.01)}); // [!code ++]

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

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

  <Step title="Connect to your MCP server">
    Deploy your changes and connect to your MCP server with a host such as [Goose](https://block.github.io/goose/) or [Claude](https://claude.ai) to start paying for tool calls.

    <Tip>
      Running your MCP server locally? See on [how to connect to a local MCP server](/developers/monetize/tutorial#run-the-mcp-server).
    </Tip>
  </Step>
</Steps>

## Resources

<CardGroup cols={3}>
  <Card title="Account Portal" icon="user" href="https://accounts.atxp.ai">
    Log in to manage your ATXP account, configure your wallet, and view earnings.
  </Card>

  <Card title="Monetized MCP tutorial" icon="messages-dollar" href="/developers/monetize/tutorial">
    Follow a complete tutorial to build your first paid MCP server with ATXP integration, from initial setup to live deployment.
  </Card>

  <Card title="Build an agent using paid MCP servers" icon="robot" href="/developers/build-agents">
    Get started building an ATXP‑powered agent that pays for MCP server tool calls.
  </Card>
</CardGroup>
