Supports secure credential and secret management by allowing the use of .env files within browser automation tasks.
Integrates with GitHub Copilot by seeding chat models and prompts designed for creating and testing browser automation shortcuts and scripts.
Click on "Install 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., "@Playwrightiumnavigate to news.ycombinator.com and list the top 5 headlines"
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.
Playwrightium
Model Context Protocol server for browser automation with Playwright
Build reusable browser automation workflows that AI can intelligently select and execute. Stop regenerating the same steps repeatedlyβdefine tested automation once, use everywhere.
π Quick Start
Installation
MCP Configuration
Add to your MCP settings (VS Code, Claude Desktop, etc.):
That's it! The server will automatically create a .playwright-mcp workspace in your home directory.
Custom Workspace (Optional)
Seed AI Assistant Integration (Optional)
Install chatmodels and prompts for your AI assistant:
This creates workspace-specific configurations in .github/chatmodels and .github/prompts (Copilot) or .claude/agents (Claude).
Your First Automation
Use the @create-shortcut prompt in your AI assistant:
The AI will guide you through:
Testing the workflow manually with
browser-sessionCreating a YAML shortcut with proper selectors
Saving to
.playwright-mcp/shortcuts/login.yamlTesting the final shortcut
π― Three Ways to Automate
1. Browser Session (Built-in)
Execute commands directly without creating files:
2. Shortcuts (YAML)
Reusable workflows with environment variable support:
Run with: execute-shortcut { "shortcutPath": "login.yaml" }
3. Scripts (TypeScript/JavaScript)
Advanced automation with full programming capabilities:
Run with: execute-script { "scriptPath": "extract-users.ts" }
π Environment Variables
Keep credentials secure using .env files:
Use in shortcuts: ${{VARIABLE_NAME}}
Use in scripts: env.VARIABLE_NAME
π§° Built-in Tools
browser-session- Execute 25+ browser commands in one callexecute-shortcut- Run YAML workflow filesexecute-script- Run TypeScript/JavaScript automationbrowser-snapshot- Capture page state for debuggingbrowser-debug- Get console logs and network requestsclose-browser- Reset browser session
Available Commands
Navigate, click, fill, type, hover, screenshot, scroll, evaluate, wait_for_text, get_text, get_attribute, press_key, select_option, check, uncheck, upload_file, drag, reload, get_url, get_title, and more!
π€ AI Assistant Prompts
Playwrightium includes built-in prompts to guide automation creation:
@create-shortcut
Creates YAML shortcuts with proper testing workflow:
@create-script
Creates TypeScript scripts with best practices:
Both prompts enforce:
β Test manually first with
browser-sessionβ Use environment variables for credentials
β Create file only after successful testing
β Include comprehensive error handling
Project-Level Integration
Use playwrightium seed to install chatmodels/agents in your project for team-wide consistency:
See Seed Command Documentation for details.
π Documentation
Full documentation available in the docs/ directory:
Quick Start Guide - Detailed setup and first automation
Commands Reference - Complete command documentation
Shortcuts Guide - YAML workflow creation
Scripts Guide - TypeScript/JavaScript automation
Secrets Management - Environment variables and security
Custom Actions - Build reusable TypeScript tools
Best Practices - Robust automation patterns
Architecture - How Playwrightium works
π Key Features
π₯οΈ Headed browser by default - see your automation in action
π Secure secret management - environment variables with
${{VAR}}syntaxπ― Persistent browser sessions - maintain state across actions
π€ AI-guided creation - built-in prompts for shortcuts and scripts
π¦ Three automation layers - browser commands, shortcuts, and scripts
π§ TypeScript-first - full type safety and intellisense
β‘ Zero config - works out of the box with sensible defaults
π§ͺ Test-first workflow - manual testing before file creation
π Development
Local Development
Configuration Options
οΏ½ Examples
Quick Search Automation
E-commerce Testing Shortcut
Data Extraction Script
π Links
NPM Package: https://www.npmjs.com/package/playwrightium
GitHub Repository: https://github.com/analysta-ai/playwrightium
Documentation: ./docs/
Model Context Protocol: https://modelcontextprotocol.io
Playwright: https://playwright.dev
π€ Contributing
Contributions welcome! Please read our contributing guidelines and submit pull requests to the repository.
Happy automating! π