Skip to main content
Glama

MCP-Midscene

by MauroCor

Playwright IA: Midscene.js

Proyecto de automation con Playwright e inteligencia artificial (Midscene).

  1. Instala dependencias, ejecuta tests y visualiza el reporte para tener un primer vistazo del modo en que opera Midscene.
  2. Configura el MCP Server de Midscene para que automatize lo que le pidas desde un prompt.

📥 Instalación

Instalar dependencias:

npm install # o yarn install

▶️ Ejecución de pruebas

Primero exporta tu API_KEY:

#linux export OPENAI_API_KEY="tu_api_key"

Ejecuta los tests con Playwright y genera un reporte en HTML:

npx playwright test

Si deseas ver el proceso de ejecución:

npx playwright test --headed

📂 Abrir el reporte

Para visualizar el reporte generado, usa el comando:

open midscene_run/report/tu_reporte.html

Se abrirá automáticamente una ventana del navegador con el dashboard de resultados (flujos de MidSceneJS, capturas y trazas).


📂 MidScene: APIs básicas de operación de IA

Usa estas APIs en tus steps para que la IA haga el trabajo.

  • ai o aiAction – Interacción general con IA
  • aiTap – Operación de clic
  • aiHover – Operación de hover (pasar el cursor)
  • aiInput – Operación de entrada de texto
  • aiKeyboardPress – Operación de teclado
  • aiScroll – Operación de desplazamiento
  • aiQuery – Consulta a IA
  • aiAssert – Aserción de IA
  • aiWaitFor – Espera basada en IA

Puedes encontrar más detalles en midscenejs.com/api



🧠 MidScene: MCP Server

Permite usar lenguaje natural para automatizar flujos y generar pruebas con Playwright, utilizando el agente de inteligencia artificial MidScene a través de su MCP Server.


✅ Requisitos

  1. Instala Cursor.
  2. Abre este proyecto con Cursor.
  3. Configura el MCP en Cursor.

⚙️ Configuración del MCP en Cursor

  1. Abre Cursor
  2. Ve a: File > Preferences > Settings
  3. Agrega la siguiente configuración en el apartado MCP:
{ "mcpServers": { "mcp-midscene": { "command": "npx", "args": ["-y", "@midscene/mcp"], "env": { "MIDSCENE_MODEL_NAME": "gpt-4o-mini", "OPENAI_API_KEY": "<OPENAI_API_KEY>", "MCP_SERVER_REQUEST_TIMEOUT": "800000" } } } }
  1. No olvides ingresar tu OPENAI_API_KEY en el json.

🤖 Enviar prompt en Cursor

Abre un chat en Cursor (Ctrl + N) y escribe tu prompt. Por ejemplo:

Usa el MCP de Midscene para: 1. Open page https://practicetestautomation.com/practice-test-login/ 2. Type username incorrectUser into Username field 3. Type password Password123 into Password field 4. Push Submit button 5. Verify error message is displayed 6. Verify error message text is Your username is invalid! Al finalizar: Crea el test case en Playwright con midscene, en la carpeta e2e con nombre login, usa de ejemplo @sauce-demo.spec.ts Exporta OPENAI_API_KEY que esta en @mcp.json Ejecuta el test npx playwright test e2e/login.spec.ts --headed

Nota: En el prompt, brinda contexto (ej: "@mcp.json"). De esta manera, Midscene encuentra la información necesaria para cumplir tu solicitud con éxito (templates, API_KEYS, etc).

-
security - not tested
F
license - not found
-
quality - not tested

A server that allows using natural language to automate test flows with Playwright, leveraging MidScene's AI agent capabilities to interact with web elements and perform assertions.

  1. 📥 Instalación
    1. ▶️ Ejecución de pruebas
      1. 📂 Abrir el reporte
        1. 📂 MidScene: APIs básicas de operación de IA
          1. 🧠 MidScene: MCP Server
            1. ✅ Requisitos
              1. ⚙️ Configuración del MCP en Cursor
                1. 🤖 Enviar prompt en Cursor

                  Related MCP Servers

                  • A
                    security
                    F
                    license
                    A
                    quality
                    A server that enables browser automation using Playwright, allowing interaction with web pages, capturing screenshots, and executing JavaScript in a browser environment through LLMs.
                    Last updated -
                    12
                    10,911
                    1
                    TypeScript
                  • A
                    security
                    A
                    license
                    A
                    quality
                    The server provides tools for web automation using Playwright, allowing navigation, interaction, and JavaScript execution on web pages, and supports note storage with summarization capabilities.
                    Last updated -
                    8
                    48
                    Python
                    Apache 2.0
                    • Apple
                  • -
                    security
                    F
                    license
                    -
                    quality
                    Playwright MCP server enables AI-driven Playwright test generation by allowing interaction with web pages and element inspection. Integrated with IDEs like Cursor, it provides real-time context to enhance test accuracy and efficiency.
                    Last updated -
                    682
                    6
                    TypeScript
                    • Apple
                  • A
                    security
                    A
                    license
                    A
                    quality
                    A server that leverages Playwright for automated browser testing and integrates with Cloudflare Workers, enabling AI assistants to control web browsers for navigation, interaction, and screenshots.
                    Last updated -
                    21
                    90,660
                    56
                    TypeScript
                    Apache 2.0

                  View all related MCP servers

                  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/MauroCor/mcp-midscene'

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