Skip to main content

Overview

Use the Browse MCP server from your ATXP-powered agent to search and extract information from the web. The Browse MCP server can be used to:
  • run browser automation tasks
  • extract information from websites
  • take screenshots and GIF recordings

Example prompts

  • “What are the top 3 articles by points on https://news.ycombinator.com?”
  • “Browse https://docs.atxp.ai and tell me the two biggest usability issues on the site.”
  • “Visit baseball-reference.com and give me summary career stats for Babe Ruth.”
  • “Visit the top 3 Google search results for ‘Chicken Noodle Soup’ and give me a screenshot of each.”
  • “Visit https://docs.atxp.ai and create a GIF recording of navigating to the docs for the Browse MCP server.”

Tools

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.

Arguments

Accepts a JSON object with the following properties:
instructions
string
required
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.
saveBrowserData
boolean
If truthy, the tool call with save the browser cookies and data.
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.

Arguments

Accepts a JSON object with the following properties:
taskId
string
required
The ID of the task to get information about.
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.

Arguments

Accepts a JSON object with the following properties:
taskId
string
required
The ID of the task to stop.
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.

Arguments

Accepts a JSON object with the following properties:
taskId
string
required
The ID of the task to get screenshots from.
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.

Arguments

Accepts a JSON object with the following properties:
taskId
string
required
The ID of the task to get a GIF from.

Usage

1

Define the Browse service

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.
const browseService = {
    mcpServer: 'https://browse.mcp.atxp.ai/',
    runTaskToolName: 'browse_run_task',
    getTaskToolName: 'browse_get_task',
    description: 'ATXP Browse MCP server',
    getArguments: (prompt: string) => ({ instructions: prompt }),
    getRunTaskResult: (result: any) => JSON.parse(result.content[0].text).id,
    getGetTaskResult: (result: any) => JSON.parse(result.content[0].text),
  };
2

Create an ATXP client

  • Using an ATXP account
  • Using a Base account
  • Using a Solana account
  • Using a Worldchain account
  • Using a Polygon account
Create a client using an ATXP account by importing the ATXP client SDK and other dependencies.
// Import the ATXP client SDK
import { atxpClient, ATXPAccount } from '@atxp/client';

// Read the ATXP account details from environment variables
const atxpConnectionString = process.env.ATXP_CONNECTION;

// Create a client using the `atxpClient` function
const client = await atxpClient({
  mcpServer: browseService.mcpServer,
  account: new ATXPAccount(atxpConnectionString),
});
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.
I