Skip to main content
Glama

MCP Selenium WebDriver

by Nixon-Suarez
  • Linux
  • Apple
config.py4.1 kB
""" Módulo de configuración para el servidor MCP Selenium. """ from typing import Dict, Any, Optional from pydantic import BaseModel class ProxyConfig(BaseModel): """Configuración de proxy.""" http: Optional[str] = None https: Optional[str] = None socks: Optional[str] = None class BrowserOptions(BaseModel): """Opciones de configuración del navegador.""" headless: bool = False window_width: int = 1920 window_height: int = 1080 user_agent: Optional[str] = None disable_images: bool = False disable_javascript: bool = False disable_plugins: bool = False disable_extensions: bool = False incognito: bool = True disable_dev_shm_usage: bool = True no_sandbox: bool = True disable_gpu: bool = True disable_web_security: bool = False disable_features: Optional[str] = None enable_features: Optional[str] = None custom_args: Optional[list[str]] = None class DetectionEvasionConfig(BaseModel): """Configuración para evasión de detección.""" use_undetected_chrome: bool = True stealth_mode: bool = True randomize_user_agent: bool = True randomize_viewport: bool = True disable_blink_features: bool = True exclude_switches: Optional[list[str]] = None add_experimental_options: Optional[Dict[str, Any]] = None class ServerConfig(BaseModel): """Configuración general del servidor.""" max_sessions: int = 10 session_timeout: int = 3600 # segundos default_browser: str = "chrome" browser_options: BrowserOptions = BrowserOptions() detection_evasion: DetectionEvasionConfig = DetectionEvasionConfig() proxy: Optional[ProxyConfig] = None # Configuración por defecto DEFAULT_CONFIG = ServerConfig( browser_options=BrowserOptions( incognito=True, headless=False ) ) # Configuraciones predefinidas para diferentes casos de uso STEALTH_CONFIG = ServerConfig( browser_options=BrowserOptions( headless=True, user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36", disable_images=True, custom_args=[ "--disable-blink-features=AutomationControlled", "--disable-dev-shm-usage", "--no-first-run", "--no-service-autorun", "--password-store=basic", "--use-mock-keychain", "--disable-background-timer-throttling", "--disable-backgrounding-occluded-windows", "--disable-renderer-backgrounding", "--disable-features=TranslateUI", "--disable-ipc-flooding-protection" ] ), detection_evasion=DetectionEvasionConfig( use_undetected_chrome=True, stealth_mode=True, randomize_user_agent=True, randomize_viewport=True, disable_blink_features=True, exclude_switches=[ "enable-automation", "enable-blink-features=AutomationControlled", "use-automation-extension" ], add_experimental_options={ "useAutomationExtension": False, "excludeSwitches": ["enable-automation"], "prefs": { "profile.default_content_setting_values.notifications": 2, "profile.default_content_settings.popups": 0, "profile.managed_default_content_settings.images": 2 } } ) ) PERFORMANCE_CONFIG = ServerConfig( browser_options=BrowserOptions( headless=True, disable_images=True, disable_javascript=False, custom_args=[ "--disable-dev-shm-usage", "--disable-gpu", "--no-sandbox", "--disable-extensions", "--disable-plugins", "--disable-background-timer-throttling", "--disable-backgrounding-occluded-windows", "--disable-renderer-backgrounding" ] ), detection_evasion=DetectionEvasionConfig( use_undetected_chrome=False, stealth_mode=False ) )

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/Nixon-Suarez/MCP-Selenium-WebDriver'

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