mcp-AI-playwright-template
A template for building a custom Playwright MCP server that enables AI-driven browser automation, translating high-level test intentions into dynamic Playwright actions.
README
This project is set up to debug with LOCAL AI
This is in sync with C:\MCP_BDC\mcpServer-Playwright-templateV8 on author's hard drive.
Custom MCP-Playwrght Server
Architecture Overview and Configuration
High-level test cases are processed by the AI and translated into structured JSON commands that are natively understood by the Model Context Protocol (MCP) server.
Underlying Language Model: The project leverages the Phi-3 Mini LLM for this translation layer.
Client Requirements: The MCP-aware AI client (in this architecture, the Playwright MCP server itself) requires a specific configuration file to establish communication.
Configuration File Path
Ensure the configuration file is present at the following location, replacing {userName} with your local system username:
C:\Users{userName}.config\mcp\clients\playwright-mcp-config.json This file tells the MCP server to expect you calls from:
{
"servers": {
"playwright-mcp": {
"command": "node",
"args": ["./mcp/server.js"],
"env": {
"NODE_ENV": "development"
}
}
}
}
Compiling TypeScript Files to Distinct Target Directories
To compile TypeScript (.ts) source files into JavaScript (.js) and distribute them to specific target directories, you can leverage dedicated TypeScript configuration files (e.g., tsconfig.*.json).
Run the standard project build script
npm run build
Compile using a specific TypeScript configuration target
npx tsc -p tsconfig.prompts.json
In another window verify if ollama is installed
DOS PROMPT>>>ollama list
possibly it is scheduled to start on boot
DOS PROMPT>>>tasklist | findstr ollama
verify if it is running
DOS PROMPT>>>>curl http://localhost:11434/api/tags
If not start Phi-3::
DOS PROMPT>>>ollama run phi3
It it is expected to fail in GitHub Action Workflow every time. To run other AI's you need to replace the code below
async function callOllama(prompt) {
const response = await axios.post("http://localhost:11434/api/generate", {
model: "phi3",
prompt: prompt,
stream: false
});
RUN RESULT:
TOOL RECEIVED: close_browser
ARGS: undefined
=======================
[close_browser] Closing browser
[close_browser] Page closed
[close_browser] Browser closed
========================
š TEST SUMMARY
========================
Test 1: ā
PASS - BDC Entrepreneur support
Test 2: ā
PASS - BDC reCAPTCHA Link must be present
Test 3: ā
PASS - BDC Should Not Contain a string MakunaimaRA
Test 4: ā FAIL - BDC must contain string 'Warszwa'
Test 5: ā
PASS - BDC must contain string 'Solutions'
============================================================
Total: 4/5 tests passed
TOTAL TIME: 116572ms
============================================================
## Test cases are re-defined by AI ( Phi-3-mini ) but they are not truly plain English.
For example:
[STDIN] {"method":"tools/call","params":{"name":"search_text","arguments":{"text":"Warszwa"}},"jsonrpc":"2.0","id":15}
is constructed from :
{
"id": 4,
"question": "Is the text 'Warszwa' present on the BDC website?",
"description": "BDC must contain string 'Warszwa'",
"baseUrl": "https://www.bdc.ca/fr",
"expectation": "should-contain",
"searchTerm": "Warszwa"
}
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.