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 modelcontextprotocolGarmin Connect
An MCP server for Garmin Connect that provides access to fitness activities, health statistics, and sleep data by routing requests through a headless browser to
by etweisbergHiggsfield Unlimited
MCP server for Higgsfield AI that enables unlimited-mode image, video, audio generation, uploads, and job management via multiple parallel accounts, using brows
by nukIeeropentabs-dev/opentabs
Plugin-based server and Chrome extension that gives AI agents access to web apps through your authenticated browser session, with a plugin SDK.
by opentabs-devhlydecker/ucsc-genome-mcp
Interact with the UCSC Genome Browser API to find genomes, chromosomes and more.
by hlydecker34892002/bilibili-mcp-js
Search Bilibili content, with LangChain integration examples.
by 34892002achiya-automation/safari-mcp
Native Safari browser automation without a Chrome dependency.
by achiya-automationagent-infra/mcp-server-browser
Browser automation using Puppeteer, supporting local and remote browser connections.
by bytedanceaparajithn/agent-scraper-mcp
Web scraping: clean content extraction, CSS-selector scraping, Playwright screenshots, link and metadata extraction, and Google search.
by aparajithnCompare 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
