Use this file to discover all available pages before exploring further.
Build agents that can safely discover and use paid MCP (Model Context Protocol) tools without creating vendor accounts or managing API keys. With ATXP, your agent brings a wallet and pays per request, so you can start building immediately and ship faster.
Create an ATXP account and set your account connection string 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:
You can use ATXP to pay for MCP tool calls made from within a Base Mini App. This approach uses a paymaster to pay for gas on behalf of the Mini App’s end-users.In order to use a ATXP with a Base Mini App, you must have a Base Mini App API key from the Coinbase Developer Portal. You then need to set the Base Mini App API key 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:
If you already have a Base wallet, you can use it in your ATXP agent by setting the Base endpoint and your Base private key in environment variables. The best way to do this is to create a .env file in the root of your project and add the following lines:
If you already have a Solana wallet, you can use it in your ATXP agent by setting the Solana endpoint and your Solana private key in environment variables. The best way to do this is to create a .env file in the root of your project and add the following lines:
ATXP Worldchain is designed for World Chain Mini Apps using MiniKit. Users authenticate through World App, and transactions are signed via MiniKit’s secure interface. No environment variables or private keys are needed - the integration uses World App’s wallet functionality directly.
For browser applications: ATXP Polygon works with any EIP-1193 compatible wallet provider (e.g., MetaMask, Coinbase Wallet). Users will sign transactions directly with their wallet and pay gas fees in POL. No environment variables are needed.For server/CLI applications: If you’re building a backend service or CLI tool, set the Polygon endpoint and your Polygon private key in environment variables. The best way to do this is to create a .env file in the root of your project and add the following lines:
Create a client using an ATXP account by importing the ATXP client SDK and other dependencies.
// Import the ATXP client SDKimport { atxpClient, ATXPAccount } from '@atxp/client';// Read the ATXP account details from environment variablesconst atxpConnectionString = process.env.ATXP_CONNECTION;// Create a client using the `atxpClient` functionconst client = await atxpClient({ mcpServer: browseService.mcpServer, account: new ATXPAccount(atxpConnectionString),});
Create a client using a Base Mini App account by importing the ATXP client SDK and other dependencies.
// Import the ATXP client SDKimport { useAccount } from "wagmi";import { atxpClient } from '@atxp/client';import { BaseAppAccount } from '@atxp/base';// Read the Base mini app API key details from the environment variablesconst apiKey = process.env.NEXT_PUBLIC_ONCHAINKIT_API_KEY;const { address } = useAccount();// Create a BaseAppAccount object using the mini app API keyconst account = await BaseAppAccount.initialize({ walletAddress: address, apiKey, appName: 'Mini App with ATXP', allowance: BigInt('10000000'), // 10 USDC periodInDays: 30,});// Create a client using the `atxpClient` functionconst client = await atxpClient({ mcpServer: browseService.mcpServer, account: account,});
Create a client using a Base account by importing the ATXP client SDK and other dependencies.
// Import the ATXP client SDK and Base accountimport { atxpClient } from '@atxp/client';import { BaseAccount } from '@atxp/base';// Read the Base account details from the environment variablesconst baseRpcUrl = process.env.BASE_RPC_URL;const basePrivateKey = process.env.BASE_PRIVATE_KEY;// Create a client using the `atxpClient` functionconst client = await atxpClient({ mcpServer: browseService.mcpServer, account: new BaseAccount(baseRpcUrl, basePrivateKey),});
Create a client using a Solana account by importing the ATXP client SDK and other dependencies.
// Import the ATXP client SDK and Solana accountimport { atxpClient } from '@atxp/client';import { SolanaAccount } from '@atxp/solana';// Read the Solana account details from the environment variablesconst solanaRpcUrl = process.env.SOLANA_RPC_URL;const solanaPrivateKey = process.env.SOLANA_PRIVATE_KEY;// Create a client using the `atxpClient` functionconst client = await atxpClient({ mcpServer: browseService.mcpServer, account: new SolanaAccount(solanaRpcUrl, solanaPrivateKey),});
Create a client using a Worldchain account with MiniKit integration.
// Import the ATXP client SDK and Worldchain account creatorimport { atxpClient } from '@atxp/client';import { createMiniKitWorldchainAccount } from '@atxp/worldchain';import { MiniKit } from '@worldcoin/minikit-js';// Create a Worldchain account using MiniKitconst account = await createMiniKitWorldchainAccount({ walletAddress: '0x1234...', // User's wallet address miniKit: MiniKit});// Create a client using the `atxpClient` functionconst client = await atxpClient({ mcpServer: browseService.mcpServer, account,});
Browser applications:
// Import the ATXP client SDK and Polygon browser accountimport { atxpClient } from '@atxp/client';import { PolygonBrowserAccount } from '@atxp/polygon';// Initialize the Polygon browser account with wallet providerconst account = await PolygonBrowserAccount.initialize({ provider: window.ethereum, // or any EIP-1193 provider walletAddress: '0x1234...', // User's wallet address});// Create a client using the `atxpClient` functionconst client = await atxpClient({ mcpServer: browseService.mcpServer, account,});
Server/CLI applications:
// Import the ATXP client SDK and Polygon server accountimport { atxpClient } from '@atxp/client';import { PolygonServerAccount } from '@atxp/polygon';// Read the Polygon account details from the environment variablesconst polygonRpcUrl = process.env.POLYGON_RPC_URL;const polygonPrivateKey = process.env.POLYGON_PRIVATE_KEY;// Create a Polygon server accountconst account = new PolygonServerAccount( polygonRpcUrl, polygonPrivateKey, 137 // Chain ID: 137 = Polygon mainnet, 80002 = Amoy testnet);// Create a client using the `atxpClient` functionconst client = await atxpClient({ mcpServer: browseService.mcpServer, account,});
5
Use the services in your agent
Use the services in your agent.
const prompt = "What are the top 3 articles by points on https://news.ycombinator.com?";try { const result = await client.callTool({ name: browseService.toolName, arguments: browseService.getArguments(prompt), }); console.log(`${browseService.description} result successful!`); console.log('Result:', browseService.getResult(result));} catch (error) { console.error(`Error with ${browseService.description}:`, error); process.exit(1);}