Get the FREE Ultimate OpenClaw Setup Guide →

mcp-selenium-grid

[pre-release, testing usage] A Model Context Protocol (MCP) server that enables AI Agents to request and manage Selenium browser instances through a secure API. Perfect for your automated browser testing needs! 🚀 [In development: creating usage examples and in-cluster setup]

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio catchnip-mcp-selenium-grid uvx mcp-selenium-grid server run --host 127.0.0.1 --port 8000 --stdio \
  --env AUTH_ENABLED="false" \
  --env ALLOWED_ORIGINS="["http://127.0.0.1:8000"]" \
  --env DEPLOYMENT_MODE="kubernetes" \
  --env KUBERNETES__CONTEXT="k3s-selenium-grid" \
  --env KUBERNETES__NAMESPACE="selenium-grid-dev" \
  --env KUBERNETES__KUBECONFIG="~/.kube/config-local-k3s" \
  --env SELENIUM_GRID__PASSWORD="CHANGE_ME" \
  --env SELENIUM_GRID__USERNAME="USER" \
  --env SELENIUM_GRID__VNC_PASSWORD="CHANGE_ME" \
  --env SELENIUM_GRID__VNC_VIEW_ONLY="false" \
  --env SELENIUM_GRID__SE_NODE_MAX_SESSIONS="1" \
  --env SELENIUM_GRID__MAX_BROWSER_INSTANCES="4" \
  --env KUBERNETES__SELENIUM_GRID_SERVICE_NAME="selenium-grid" \
  --env FASTMCP_EXPERIMENTAL_ENABLE_NEW_OPENAPI_PARSER="true"

How to use

This MCP server provides a Selenium Grid manager that can operate in Docker or Kubernetes deployment modes and exposes an HTTP MCP API at http://localhost:8000 with an interactive docs UI at /docs. It supports creating and managing multiple browser instances (Chrome, Firefox, Edge) via a token-authenticated API. Use the /mcp endpoint for MCP transports and /sse for Server-Sent Events depending on your integration needs. The server supports running in Kubernetes, Docker, or local uvx-based modes, making it suitable for automation agents and test pipelines that require scalable browser automation.

How to install

Prerequisites:

  • Python and uv (uvx) installed or Docker installed depending on deployment
  • Node.js is not required for this server
  • Kubernetes (optional) if deploying to a cluster

Installation steps (UVX / Kubernetes deployment):

  1. Install uv and uvx (Python-based MCP runner):
    • pipx install uvx (or follow uvx installation instructions from the project)
  2. Ensure Docker is installed if you plan to use Docker deployment:
  3. If using Kubernetes (local via K3s):
  4. Start the MCP Selenium Grid server (example in uvx usage below):
    • uvx mcp-selenium-grid server run --host 127.0.0.1 --port 8000 --stdio

Notes:

  • You can enable authentication by setting API_TOKEN or other auth-related env vars as shown in the examples.
  • If deploying to Kubernetes, ensure your KUBECONFIG and CONTEXT are correctly set in the environment.
  • For Kubernetes deployment, you may need to provision a Selenium Grid in Kubernetes (e.g., via Helm) and point the deployment mode accordingly.

Additional notes

Environment variables to consider: AUTH_ENABLED, ALLOWED_ORIGINS, DEPLOYMENT_MODE, KUBERNETES__KUBECONFIG, KUBERNETES__CONTEXT, KUBERNETES__NAMESPACE, KUBERNETES__SELENIUM_GRID_SERVICE_NAME, SELENIUM_GRID__USERNAME, SELENIUM_GRID__PASSWORD, SELENIUM_GRID__VNC_PASSWORD, SELENIUM_GRID__VNC_VIEW_ONLY, SELENIUM_GRID__MAX_BROWSER_INSTANCES, SELENIUM_GRID__SE_NODE_MAX_SESSIONS. When using stdio transport, the MCP server may require explicit cleanup commands (uv run mcp-selenium-grid clean) to terminate resources, especially in long-running sessions. The server runs at http://localhost:8000 and docs at http://localhost:8000/docs by default. Ensure proper port exposure in your environment and adjust host/port in the command as needed for your setup.

Related MCP Servers

Sponsor this space

Reach thousands of developers