Skip to main content
Glama
seabassgonzalez

MCP Browser Screenshot Server

browser_navigate

Navigate to specified URLs to prepare web pages for automated screenshot capture, testing, or monitoring purposes.

Instructions

Navigate to a URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to navigate to
waitUntilNoWhen to consider navigation completenetworkidle2

Implementation Reference

  • Handler for the browser_navigate tool. Ensures a browser page is available, navigates to the specified URL with optional waitUntil option, and returns a success message.
    case 'browser_navigate': {
      const { page } = await ensureBrowser();
      const url = args?.url as string;
      const waitUntil = (args?.waitUntil as any) || 'networkidle2';
    
      await page.goto(url, { waitUntil });
    
      return {
        content: [
          {
            type: 'text',
            text: `Navigated to ${url}`,
          },
        ],
      };
    }
  • Input schema for browser_navigate tool, requiring a URL and optionally specifying waitUntil navigation completion condition.
    inputSchema: {
      type: 'object',
      properties: {
        url: {
          type: 'string',
          description: 'URL to navigate to',
        },
        waitUntil: {
          type: 'string',
          enum: [
            'load',
            'domcontentloaded',
            'networkidle0',
            'networkidle2',
          ],
          description: 'When to consider navigation complete',
          default: 'networkidle2',
        },
      },
      required: ['url'],
    },
  • src/index.ts:107-131 (registration)
    Registration of the browser_navigate tool in the ListTools response, including name, description, and input schema.
    {
      name: 'browser_navigate',
      description: 'Navigate to a URL',
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            description: 'URL to navigate to',
          },
          waitUntil: {
            type: 'string',
            enum: [
              'load',
              'domcontentloaded',
              'networkidle0',
              'networkidle2',
            ],
            description: 'When to consider navigation complete',
            default: 'networkidle2',
          },
        },
        required: ['url'],
      },
    },
  • Helper function ensureBrowser() used by browser_navigate handler to launch or reuse a Puppeteer browser and page instance.
    async function ensureBrowser(): Promise<{ browser: Browser; page: Page }> {
      if (!browserState.browser || !browserState.browser.isConnected()) {
        const headless = process.env.HEADLESS !== 'false';
        browserState.browser = await puppeteer.launch({
          headless,
          args: ['--no-sandbox', '--disable-setuid-sandbox'],
        });
        browserState.page = await browserState.browser.newPage();
      }
    
      if (!browserState.page || browserState.page.isClosed()) {
        browserState.page = await browserState.browser.newPage();
      }
    
      return {
        browser: browserState.browser,
        page: browserState.page,
      };
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/seabassgonzalez/mcp-browser-screenshot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server