mcp-selenium-grid

[DEV PRE-RELEASE, NOT READY, TESTING IN MCP CLIENTS] 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]

https://github.com/catchnip/mcp-selenium-grid

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • βœ“
    CITATION.cff file
    Found CITATION.cff file
  • βœ“
    codemeta.json file
    Found codemeta.json file
  • βœ“
    .zenodo.json file
    Found .zenodo.json file
  • β—‹
    DOI references
  • β—‹
    Academic publication links
  • β—‹
    Committers with academic emails
  • β—‹
    Institutional organization owner
  • β—‹
    JOSS paper metadata
  • β—‹
    Scientific vocabulary similarity
    Low similarity (11.7%) to scientific vocabulary

Keywords

browser-automation docker fastapi k3s kubernetes mcp-server pydantic selenium selenium-grid webscraping work-in-progress

Scientific Fields

Engineering Computer Science - 60% confidence
Last synced: 6 months ago · JSON representation ·

Repository

[DEV PRE-RELEASE, NOT READY, TESTING IN MCP CLIENTS] 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]

Basic Info
  • Host: GitHub
  • Owner: CatchNip
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 409 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 5
Topics
browser-automation docker fastapi k3s kubernetes mcp-server pydantic selenium selenium-grid webscraping work-in-progress
Created 9 months ago · Last pushed 7 months ago
Metadata Files
Readme Contributing License Citation

README.md

πŸ€– MCP Selenium Grid

Tests GitHub Last Commit GitHub Release GitHub commits since latest release GitHub Commit Activity GitHub Contributors License

A Model Context Protocol (MCP) server for managing Selenium Grid browser instances. Useful for browser automation and testing workflows.

The MCP Selenium Grid provides a MCP Server for creating and managing browser instances in both Docker and Kubernetes environments. It's designed to work with AI agents and automation tools that need browser automation capabilities.

Key Features

  • Multi-browser support: Chrome, Firefox and Edge
  • Dual backend support: Docker and Kubernetes deployment modes
  • Secure API: Token-based authentication for browser management
  • Scalable architecture: Support for multiple browser instances
  • MCP compliance: Follows Model Context Protocol standards

πŸš€ Quick Start

Prerequisites

  • uv (Python dependency manager)
  • Docker (for Docker deployment mode)
  • K3s (for Kubernetes deployment mode, optional)

πŸ“– Usage

The MCP Selenium Grid provides a Web API for creating and managing browser instances. The server runs on localhost:8000 and exposes MCP endpoints at /mcp (Http Transport) and /sse (Server Sent Events).

Note: All requests to the server root http://localhost:8000 will be redirected to either /mcp or /sse endpoints, depending on the request.

MCP Client Configuration

🐳 Docker Deployment

For Docker-based deployment, ensure Docker is running and use the Docker configuration in your MCP client setup.

json { "mcpServers": { "mcp-selenium-grid": { "command": "uvx", "args": ["mcp-selenium-grid", "server", "run", "--host", "127.0.0.1", "--port", "8000" ], "env": { "API_TOKEN": "SERVER_AUTH_DISABLED", "ALLOWED_ORIGINS": "[\"http://127.0.0.1:8000\"]", "DEPLOYMENT_MODE": "docker", "SELENIUM_GRID__USERNAME": "USER", "SELENIUM_GRID__PASSWORD": "CHANGE_ME", "SELENIUM_GRID__VNC_PASSWORD": "CHANGE_ME", "SELENIUM_GRID__VNC_VIEW_ONLY": "false", "SELENIUM_GRID__MAX_BROWSER_INSTANCES": "4", "SELENIUM_GRID__SE_NODE_MAX_SESSIONS": "1" } } } }

The server will be available at http://localhost:8000 with interactive API documentation at http://localhost:8000/docs.

☸️ Kubernetes Deployment

3. Kubernetes Setup (Optional)

This project supports Kubernetes deployment for scalable browser instance management. We use K3s for local development and testing.

Install K3s (https://docs.k3s.io/quick-start)

```bash

Install K3s

curl -sfL https://get.k3s.io | sh -

Verify installation

k3s --version

Start if not running

sudo systemctl start k3s ```

Create K3s Kubernetes Context (Optional)

After installing K3s, you might want to create a dedicated kubectl context for it:

```bash

Copy K3s kubeconfig

mkdir -p ~/.kube sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config-local-k3s sudo chown $USER:$USER ~/.kube/config-local-k3s chmod 600 ~/.kube/config-local-k3s

Create context

KUBECONFIG=~/.kube/config-local-k3s \ kubectl config set-context k3s-selenium-grid \ --cluster=default \ --user=default ```

Deploy Selenium Grid

Please run for help to get to know the available commands and parameters:

bash uvx mcp-selenium-grid helm --help uvx mcp-selenium-grid helm deploy --help uvx mcp-selenium-grid helm uninstall --help

Deploy using default parameters:

bash uvx mcp-selenium-grid helm deploy

Uninstall using default parameters:

```bash

using default parameters

uvx mcp-selenium-grid helm uninstall --delete-namespace ```

json { "mcpServers": { "mcp-selenium-grid": { "command": "uvx", "args": ["mcp-selenium-grid", "server", "run", "--host", "127.0.0.1", "--port", "8000" ], "env": { "API_TOKEN": "SERVER_AUTH_DISABLED", "ALLOWED_ORIGINS": "[\"http://127.0.0.1:8000\"]", "DEPLOYMENT_MODE": "kubernetes", "SELENIUM_GRID__USERNAME": "USER", "SELENIUM_GRID__PASSWORD": "CHANGE_ME", "SELENIUM_GRID__VNC_PASSWORD": "CHANGE_ME", "SELENIUM_GRID__VNC_VIEW_ONLY": "false", "SELENIUM_GRID__MAX_BROWSER_INSTANCES": "4", "SELENIUM_GRID__SE_NODE_MAX_SESSIONS": "1", "KUBERNETES__KUBECONFIG": "~/.kube/config-local-k3s", "KUBERNETES__CONTEXT": "k3s-selenium-grid", "KUBERNETES__NAMESPACE": "selenium-grid-dev", "KUBERNETES__SELENIUM_GRID_SERVICE_NAME": "selenium-grid" } } } }

```json { "mcpServers": { "mcp-selenium-grid": { "command": "docker", "args": [ "run", "-i", "--rm", "--init", "-p", "8000:80", "-e", "APITOKEN=SERVERAUTHDISABLED", "-e", "ALLOWEDORIGINS=[\"http://127.0.0.1:8000\"]", "-e", "DEPLOYMENTMODE=kubernetes", // required for docker "-e", "SELENIUMGRIDUSERNAME=USER", "-e", "SELENIUM_GRIDPASSWORD=CHANGEME", "-e", "SELENIUMGRIDVNCPASSWORD=CHANGEME", "-e", "SELENIUM_GRIDVNCVIEWONLY=false", "-e", "SELENIUMGRIDMAXBROWSERINSTANCES=4", "-e", "SELENIUMGRIDSENODEMAX_SESSIONS=1", "-e", "KUBERNETESKUBECONFIG=/kube/config-local-k3s", "-e", "KUBERNETESCONTEXT=k3s-selenium-grid", "-e", "KUBERNETESNAMESPACE=selenium-grid-dev", "-e", "KUBERNETES_SELENIUMGRIDSERVICENAME=selenium-grid", "ghcr.io/falamarcao/mcp-selenium-grid:latest" ] } } }

```

The server will be available at http://localhost:8000 with interactive API documentation at http://localhost:8000/docs.

Server with auth enabled

UVX

Using default args

bash uvx mcp-selenium-grid server run

Custom args

bash API_TOKEN=CHANGE_ME uvx mcp-selenium-grid server run --host 127.0.0.1 --port 8000

Docker

Default args

bash docker run -i --rm --init -p 8000:80 ghcr.io/falamarcao/mcp-selenium-grid:latest

Custom args

bash docker run -i --rm --init -p 8000:80 \ -e API_TOKEN=CHANGE_ME \ -e ALLOWED_ORIGINS='["http://127.0.0.1:8000"]' \ -e DEPLOYMENT_MODE=kubernetes \ -e SELENIUM_GRID__USERNAME=USER \ -e SELENIUM_GRID__PASSWORD=CHANGE_ME \ -e SELENIUM_GRID__VNC_PASSWORD=CHANGE_ME \ -e SELENIUM_GRID__VNC_VIEW_ONLY=false \ -e SELENIUM_GRID__MAX_BROWSER_INSTANCES=4 \ -e SELENIUM_GRID__SE_NODE_MAX_SESSIONS=1 \ -e KUBERNETES__KUBECONFIG=/kube/config-local-k3s \ -e KUBERNETES__CONTEXT=k3s-selenium-grid \ -e KUBERNETES__NAMESPACE=selenium-grid-dev \ -e KUBERNETES__SELENIUM_GRID_SERVICE_NAME=selenium-grid \ ghcr.io/falamarcao/mcp-selenium-grid:latest

MCP Server configuration (mcp.json)

json { "mcpServers": { "mcp-selenium-grid": { "url": "http://localhost:8000", "headers": { "Authorization": "Bearer CHANGE_ME" } } } }

json { "mcpServers": { "mcp-selenium-grid": { "url": "http://localhost:8000/mcp", "headers": { "Authorization": "Bearer CHANGE_ME" } } } }

json { "mcpServers": { "mcp-selenium-grid": { "url": "http://localhost:8000/sse", "headers": { "Authorization": "Bearer CHANGE_ME" } } } }

🀝 Contributing

For development setup, testing, and contribution guidelines, please see CONTRIBUTING.md.

πŸ“„ License

MIT

Owner

  • Name: CatchNip
  • Login: CatchNip
  • Kind: organization

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: MCP Selenium Grid
message: "If you use this software, please cite it as below."
type: software
authors:
  - given-names: Marco
    email: falamarcao@gmail.com
repository-code: "https://github.com/Falamarcao/mcp-selenium-grid"
abstract: " enables AI Agents to request and manage Selenium browser instances through a secure API. Perfect for your automated browser testing needs! "
keywords:
  - selenium grid
  - browser automation
  - mcp server
  - webscraping
  - docker
  - kubernetes
  - fastapi
license: MIT

GitHub Events

Total
  • Release event: 5
  • Watch event: 1
  • Delete event: 6
  • Member event: 1
  • Issue comment event: 1
  • Push event: 47
  • Pull request event: 6
  • Create event: 3
Last Year
  • Release event: 5
  • Watch event: 1
  • Delete event: 6
  • Member event: 1
  • Issue comment event: 1
  • Push event: 47
  • Pull request event: 6
  • Create event: 3

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 33
  • Total Committers: 1
  • Avg Commits per committer: 33.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 33
  • Committers: 1
  • Avg Commits per committer: 33.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
falamarcao f****o@g****m 33

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
  • Total maintainers: 1
pypi.org: mcp-selenium-grid

MCP Server for managing Selenium Grid

  • Documentation: https://mcp-selenium-grid.readthedocs.io/
  • License: MIT License Copyright (c) 2025 [falamarcao](https://github.com/Falamarcao) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 0.1.0
    published 7 months ago
  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 8.7%
Average: 30.6%
Forks count: 30.9%
Stargazers count: 33.7%
Dependent repos count: 49.2%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/actions/setup-python-uv/action.yml actions
  • actions/setup-python v5 composite
.github/workflows/build-docker-image.yml actions
  • actions/cache v4 composite
  • docker/setup-buildx-action v3 composite
.github/workflows/build-python-package.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/ci.yml actions
  • ./.github/actions/setup-python-uv * composite
  • actions/checkout v4 composite
.github/workflows/release.yml actions
Dockerfile docker
  • python 3.13-slim-bullseye build
pyproject.toml pypi
  • docker >=7.1.0
  • fastapi [standard]>=0.111.0
  • fastapi-mcp >=0.3.4
  • kubernetes >=30.2.0
  • prometheus-client >=0.20.0
  • prometheus-fastapi-instrumentator >=7.1.0
  • pydantic [email]>=2.7.3
  • pydantic-settings >=2.2.1
  • python-dotenv >=1.0.1