Back to MCP Catalog

Playwright Web Browser Control MCP Server

Browser AutomationPython
Control web browsers with Playwright through Azure OpenAI
Available Tools

playwright_navigate

Navigate to a URL.

urltimeoutwait_until

This MCP server enables AI applications to control web browsers using Playwright, a powerful browser automation library. It bridges the Model Context Protocol with Azure OpenAI, allowing AI models to navigate websites, interact with web elements, and extract information from web pages. The implementation provides a minimal yet functional server/client setup that converts MCP responses to OpenAI function calling format, making it compatible with Azure OpenAI services. This enables seamless integration of web browsing capabilities into AI applications.

Overview

This MCP server provides web browser automation capabilities through Playwright, allowing AI models to navigate and interact with websites. It's designed to work with Azure OpenAI and includes a bridge that converts MCP responses to OpenAI function calling format.

Installation

Prerequisites

  • Python 3.8 or higher
  • Azure OpenAI API access

Setup Instructions

  1. Clone the repository:

    git clone https://github.com/kimtth/mcp-aoai-web-browsing.git
    cd mcp-aoai-web-browsing
    
  2. Install uv for Python package management:

    pip install uv
    
  3. Install dependencies:

    uv sync
    
  4. Configure Azure OpenAI credentials:

    • Rename .env.template to .env
    • Fill in your Azure OpenAI credentials:
      AZURE_OPEN_AI_ENDPOINT=your_endpoint
      AZURE_OPEN_AI_API_KEY=your_api_key
      AZURE_OPEN_AI_DEPLOYMENT_MODEL=your_model
      AZURE_OPEN_AI_API_VERSION=your_api_version
      

Usage

Running the Server

Start the MCP server and GUI interface:

python chatgui.py

This will launch a chat interface where you can interact with the AI and request web browsing actions.

Example Commands

You can ask the AI to perform various web browsing tasks, such as:

  • "Navigate to https://example.com"
  • "Search for information about climate change"
  • "Take a screenshot of the current page"
  • "Click on the login button"

Integration with AI Applications

To integrate this MCP server with your AI application, you can use the client bridge provided in the repository. The bridge handles the conversion between MCP responses and OpenAI function calling format.

Troubleshooting

If you encounter issues with Python processes not terminating properly, you can use:

taskkill /IM python.exe /F

For debugging in Visual Studio Code, use the configuration in .vscode/launch.json.

Related MCPs

Playwright Browser Automation
Browser AutomationPython

Automate browser interactions with Playwright

Playwright Browser Automation
Browser AutomationJavaScript

Automate browser interactions, take screenshots, and scrape web content

Playwright Browser Automation
Browser AutomationTypeScript

Browser automation capabilities using Playwright

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.