Run a browser automation task with the given instructions. After starting the task, use the browse_wait_for_task tool to wait for the task to complete and then get the results. For example, if you need to browse the front page of Reddit and collect information about each story posted there right now, you would use this tool.
Natural language instruction describing what you want to do on the web. This can include URLs to visit, specific actions to perform, or information to extract.
If truthy, the tool call with save the browser cookies and data.
browse_get_task
Get detailed information about a browser automation task, including its current status, the steps it has completed, its output, and other metadata. For example, if you want to see what steps a task has completed so far and check if it encountered any errors, you would use this tool.
Stops a running browser automation task. Stopped tasks cannot be resumed. For example, if a task is stuck or you realize you made an error in the instructions and want to completely stop it, you would use this tool.
Get screenshots from a completed browser automation task. For example, if you want to see visual snapshots of what the browser looked like at different points during the automation, you would use this tool.
Get GIF recording from a completed browser automation task. For example, if you want to create a short animated GIF showing the key moments of the browser automation for sharing or documentation purposes, you would use this tool.
Create a reusable service configuration that points to the MCP server and standardizes how you pass arguments and read results. This lets your agent easily interact with the Browse tools in a consistent manner.
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 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,});
3
Use the Browse service in your agent
Call the Browse tool by passing your natural‑language instruction as the argument the getArguments method.Read the response using the getResult method.
const prompt = "What are the top 3 articles by points on https://news.ycombinator.com?";try { const result = await client.callTool({ name: browseService.runTaskToolName, arguments: browseService.getArguments(prompt), }); console.log(`${browseService.description} runTask result successful!`); const taskId = browseService.getRunTaskResult(result) const pollInterval = 5000; // 5 seconds while (true) { const taskResult = await client.callTool({ name: browseService.getTaskToolName, arguments: { taskId }, }); const taskData = browseService.getGetTaskResult(taskResult) console.log(`${browseService.description} runTask result successful!`); // Check if task is complete if (['finished', 'stopped', 'failed'].includes(taskData.status)) { console.log(`${browseService.description} result successful!`); console.log(`Task completed with data: ${JSON.stringify(taskData)}`); break; } // Wait before next poll console.log(`${browseService.description} result pending.`); await new Promise(resolve => setTimeout(resolve, pollInterval)); }} catch (error) { console.error(`Error with ${browseService.description}:`, error); process.exit(1);}
You should see extracted content printed in your console.