MCP-Midscene

MCP-Midscene

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.

Category
Visit Server

README

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).

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured