MCP-Midscene
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP-Midscene test login flow on demo site with invalid credentials and verify error messages"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Playwright IA: Midscene.js
Proyecto de automation con Playwright e inteligencia artificial (Midscene).
Instala dependencias, ejecuta tests y visualiza el reporte para tener un primer vistazo del modo en que opera Midscene.
Configura el MCP Server de Midscene para que automatize lo que le pidas desde un prompt.
📥 Instalación
Instalar dependencias:
npm install
# o
yarn installRelated MCP server: Cloudflare Playwright MCP
▶️ 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 testSi 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.htmlSe 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
Instala Cursor.
Abre este proyecto con Cursor.
Configura el MCP en Cursor.
⚙️ Configuración del MCP en Cursor
Abre Cursor
Ve a:
File > Preferences > SettingsAgrega 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"
}
}
}
}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 --headedNota: 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).
Available Tools
12 toolsmidscene_aiAssertA
Asserts that a specified condition, described in natural language, is true on the page. Polls the condition using AI.
Inputs: assertion (required).
midscene_aiHoverA
Moves the mouse cursor to hover over an element identified by a natural language selector.
Inputs: locate (required).
midscene_aiInputC
Inputs text into a specified form field or element identified by a natural language selector.
Inputs: value (required), locate (required).
midscene_aiKeyboardPressC
Presses a specific key on the keyboard.
Inputs: key (required), locate, deepThink.
midscene_aiScrollC
Scrolls the page or a specified element. Can scroll by a fixed amount or until an edge is reached.
Inputs: direction (required), scrollType, distance, locate, +1 more.
midscene_aiTapC
Locates and clicks an element on the current page based on a natural language description (selector).
Inputs: locate (required).
midscene_aiWaitForA
Waits until a specified condition, described in natural language, becomes true on the page. Polls the condition using AI.
Inputs: assertion (required), timeoutMs, checkIntervalMs.
midscene_get_tabsA
Retrieves a list of all open browser tabs, including their ID, title, and URL.
Inputs: no named parameters.
midscene_playwright_exampleC
Provides Playwright code examples for Midscene. If users need to generate Midscene test cases, they can call this method to get sample Midscene Playwright test cases for generating end-user test cases. Each step must first be verified using the mcp method, and then the final test case is generated based on the playwright example according to the steps executed by mcp
Inputs: no named parameters.
midscene_screenshotB
Captures a screenshot of the currently active browser tab and saves it with the given name.
Inputs: name (required).
midscene_set_active_tabA
Switches the browser's focus to the tab specified by its ID. Use midscene_get_tabs first to find the correct tab ID.
Inputs: tabId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool has a clearly distinct purpose with no overlap. For example, midscene_aiAssert checks conditions, midscene_aiHover hovers over elements, and midscene_aiInput inputs text, all targeting different actions in browser automation. The tools are well-defined and unlikely to cause misselection.
All tools follow a consistent 'midscene_' prefix and snake_case pattern, with clear verb_noun combinations like aiAssert, aiHover, and get_tabs. This predictability makes it easy for agents to understand and use the toolset without confusion.
With 12 tools, the count is well-scoped for browser automation and testing. It covers core actions like navigation, interaction, waiting, and tab management, with each tool earning its place without being excessive or insufficient for the domain.
The toolset provides comprehensive coverage for browser automation, including navigation, element interaction, condition checking, and tab management. A minor gap is the lack of tools for handling browser contexts or windows, but core workflows are fully supported, allowing agents to perform most common tasks effectively.
Maintenance
Related MCP Connectors
Write, run and check natural-language browser tests of your web app from your AI assistant.
Browser-based QA for AI-built software. Test pages with real browsers via agents.
Playwright browser automation — navigate, click, fill forms, extract, screenshot — 17 agent tools.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Related MCP Servers
- AlicenseBqualityDmaintenanceA server that enables browser automation using Playwright, allowing interaction with web pages, capturing screenshots, and executing JavaScript in a browser environment through LLMs.1215,256 npm1MIT
- AlicenseBqualityFmaintenanceA 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.22261Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn AI-powered MCP server that automates web testing workflows by enabling recording, execution, and discovery of tests through natural language prompts.66Apache 2.0
- AlicenseNot gradedqualityNot gradedmaintenanceA server that enables AI assistants to control a browser through tools, allowing them to perform web automation tasks like navigation, typing, clicking, and taking screenshots.Apache 2.0