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

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

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.