About
Demo Playwright — Model Context Protocol server
README
Demo project showing how to use Playwright MCP with GitHub Copilot Agent to navigate a .NET 10 Blazor Server application protected by Keycloak OIDC authentication.
Stack
| Layer | Technology |
|---|---|
| App | .NET 10 Blazor Server |
| Auth | Keycloak 26 (OIDC / Authorization Code Flow) |
| Browser automation | Playwright MCP (@playwright/mcp) |
| AI agent | GitHub Copilot (Claude Sonnet) |
Project Structure
demo-playwright-mcp/
├── .github/
│ ├── prompts/ # Copilot Agent prompt files (.prompt.md)
│ └── instructions/ # Reporting rules applied to all prompts
├── .vscode/
│ └── mcp.json # Playwright MCP server configuration
├── .auth/ # Runtime only — auth.json is gitignored
├── keycloak/
│ └── realm-export.json # Pre-configured realm (auto-imported on startup)
├── src/
│ └── BlazorDemo/ # .NET 10 Blazor Server app
└── docker-compose.yml # Keycloak
Pages
| Route | Auth | Description |
|---|---|---|
/ |
Public | Home — shows auth status |
/dashboard |
Required | Activity cards |
/profile |
Required | Keycloak claims |
/contact |
Required | Contact form with submit |
Prompts
| File | Purpose |
|---|---|
00-save-auth-state |
User logs in manually → saves .auth/auth.json |
01-login-flow |
Visual demo of the full OIDC login flow |
02-logout |
Logout and session termination |
03-protected-page-redirect |
Unauthenticated access → redirect to Keycloak |
04-navigate-authenticated |
Navigation between protected pages |
05-submit-form |
Fill and submit the contact form |
06-full-demo |
All scenarios in a single run |
07-validation-failure |
Intentional validation errors — demonstrates ❌ reporting |
Prerequisites
- .NET 10 SDK
- Docker
- Node.js (for
npx @playwright/mcp) - VS Code with GitHub Copilot
Getting Started
1. Start Keycloak
docker compose up -d
Wait ~30s for Keycloak to import the realm. Verify at http://localhost:8080 (admin / admin).
2. Run the app
dotnet run --project src/BlazorDemo
App runs at http://localhost:5000.
3. Enable Playwright MCP in VS Code
Open the Command Palette → MCP: List Servers → confirm playwright is running.
4. Save auth state (one-time)
In Copilot Chat (Agent mode), run:
/00-save-auth-state
The agent opens the browser and navigates to the Keycloak login page. Type your credentials manually in the browser, then reply done in the chat. The agent saves .auth/auth.json.
5. Run the demo
/06-full-demo
Or run individual prompts (/01-login-flow, /03-protected-page-redirect, etc.).
Test Credentials
| Field | Value |
|---|---|
| Username | [email protected] |
| Password | Demo@123 |
These credentials exist only in the local Keycloak instance and have no external access.
Auth State Approach
Prompts 04, 05, and 06 load .auth/auth.json instead of using hardcoded credentials — this is the Playwright recommended pattern for separating authentication setup from test logic.
Prompt 01 intentionally includes credentials because demonstrating the login flow is its purpose.
Installing Demo Playwright
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/dianper/demo-playwright-mcpFAQ
Is Demo Playwright MCP free?
Yes, Demo Playwright MCP is free — one-click install via Unyly at no cost.
Does Demo Playwright need an API key?
No, Demo Playwright runs without API keys or environment variables.
Is Demo Playwright hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Demo Playwright in Claude Desktop, Claude Code or Cursor?
Open Demo Playwright on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
Playwright
Browser automation, scraping, screenshots
by MicrosoftPuppeteer
Browser automation and web scraping.
by modelcontextprotocolopentabs-dev/opentabs
Plugin-based MCP server + Chrome extension that gives AI agents access to web applications through the user's authenticated browser session. 100+ plugins with a
by opentabs-devrobhunter/agentdeals
1,500+ developer infrastructure deals, free tiers, and startup programs across 54 categories. Search deals, compare vendors, plan stacks, and track pricing chan
by robhunterhlydecker/ucsc-genome-mcp
MCP server to interact with the UCSC Genome Browser API, letting you find genomes, chromosomes, and more.
by hlydecker34892002/bilibili-mcp-js
A MCP server that supports searching for Bilibili content. Provides LangChain integration examples and test scripts.
by 34892002achiya-automation/safari-mcp
Native Safari browser automation for AI agents with 80+ tools. No Chrome dependency, optimized for Apple Silicon with 60% less CPU overhead.
by achiya-automationagent-infra/mcp-server-browser
Browser automation capabilities using Puppeteer, both support local and remote browser connection.
by bytedanceaparajithn/agent-scraper-mcp
Web scraping MCP server for AI agents. 6 tools: clean content extraction, structured scraping with CSS selectors, full-page screenshots via Playwright, link ext
by aparajithnapireno/DOMShell
Browse the web using filesystem commands (ls, cd, grep, click). 38 MCP tools map Chrome's Accessibility Tree to a virtual filesystem via a Chrome Extension.
by apirenoCompare Demo Playwright with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All browse MCPs
