PlayGuard — Claude Code MCP server: what it does, how to install
PlayGuard — an MCP server for Claude Code that proxies browser actions and developer tools through a single connection. Handles Playwright, Figma, and DevTools calls while trimming response token size.
MIT ★ 24 updated 2026-11-10
claude mcp add --env FIGMA_MCP_CMD=<FIGMA_MCP_CMD> --env FIGMA_MCP_URL=<FIGMA_MCP_URL> --env DEVTOOLS_MCP_CMD=<DEVTOOLS_MCP_CMD> --env SHOPIFY_DEV_MCP_CMD=<SHOPIFY_DEV_MCP_CMD> --env CONTEXT7_MCP_CMD=<CONTEXT7_MCP_CMD> --transport stdio playguard -- npx -y playguardWhat PlayGuard does
PlayGuard routes requests to multiple upstream MCP servers through a single stdio connection. Playwright MCP comes bundled and active by default, whereas Figma, Chrome DevTools, Shopify Dev, and Context7 activate via environment variables. If an optional server crashes, PlayGuard removes its tools without disrupting the remaining services.
The server optimizes token consumption by compacting DOM accessibility trees, issuing delta updates, and pruning Figma node hierarchies. It also intercepts browser crash errors, restarts the Playwright process in the background, and restores the current URL before returning the result to the agent.
Two standalone tools are provided out of the box: playguard_a11y_audit running axe-core and playguard_compare_design for visual alignment. Running the package requires Node.js and npx.
What it helps with
- trim token consumption from browser accessibility snapshots
- route Playwright, Figma, and DevTools through one MCP connection
- recover terminated browser sessions without failing the prompt
- perform accessibility audits on active pages using axe-core
- evaluate Figma design nodes against live DOM elements
Example prompts for the agent
- Run an accessibility check on the current page with playguard_a11y_audit
- Match the Figma button design against the live DOM element using playguard_compare_design
- Browse to localhost:3000 and capture the trimmed accessibility tree
How to install PlayGuard
Platform CLI
claude mcp add --env FIGMA_MCP_CMD=<FIGMA_MCP_CMD> --env FIGMA_MCP_URL=<FIGMA_MCP_URL> --env DEVTOOLS_MCP_CMD=<DEVTOOLS_MCP_CMD> --env SHOPIFY_DEV_MCP_CMD=<SHOPIFY_DEV_MCP_CMD> --env CONTEXT7_MCP_CMD=<CONTEXT7_MCP_CMD> --transport stdio playguard -- npx -y playguardReplace <…> with your own values
Platform CLI
codex mcp add playguard --env FIGMA_MCP_CMD=<FIGMA_MCP_CMD> --env FIGMA_MCP_URL=<FIGMA_MCP_URL> --env DEVTOOLS_MCP_CMD=<DEVTOOLS_MCP_CMD> --env SHOPIFY_DEV_MCP_CMD=<SHOPIFY_DEV_MCP_CMD> --env CONTEXT7_MCP_CMD=<CONTEXT7_MCP_CMD> -- npx -y playguardReplace <…> with your own values
Config file
{
"mcpServers": {
"playguard": {
"command": "npx",
"args": [
"-y",
"playguard"
],
"env": {
"FIGMA_MCP_CMD": "<FIGMA_MCP_CMD>",
"FIGMA_MCP_URL": "<FIGMA_MCP_URL>",
"DEVTOOLS_MCP_CMD": "<DEVTOOLS_MCP_CMD>",
"SHOPIFY_DEV_MCP_CMD": "<SHOPIFY_DEV_MCP_CMD>",
"CONTEXT7_MCP_CMD": "<CONTEXT7_MCP_CMD>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"playguard": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"playguard"
],
"env": {
"FIGMA_MCP_CMD": "<FIGMA_MCP_CMD>",
"FIGMA_MCP_URL": "<FIGMA_MCP_URL>",
"DEVTOOLS_MCP_CMD": "<DEVTOOLS_MCP_CMD>",
"SHOPIFY_DEV_MCP_CMD": "<SHOPIFY_DEV_MCP_CMD>",
"CONTEXT7_MCP_CMD": "<CONTEXT7_MCP_CMD>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e FIGMA_MCP_CMD=<FIGMA_MCP_CMD> -e FIGMA_MCP_URL=<FIGMA_MCP_URL> -e DEVTOOLS_MCP_CMD=<DEVTOOLS_MCP_CMD> -e SHOPIFY_DEV_MCP_CMD=<SHOPIFY_DEV_MCP_CMD> -e CONTEXT7_MCP_CMD=<CONTEXT7_MCP_CMD> playguard npx -y playguardReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about PlayGuard
How to install PlayGuard in Claude Code?
Run claude mcp add playguard -- npx -y playguard. To pass optional upstream variables, use `claude mcp add --env FIGMA_MCP_CMD=<FIGMA_MCP_CMD> --env FIGMA_MCP_URL=<FIGMA_MCP_URL> --env DEVTOOLS_MCP_CMD=<DEVTOOLS_MCP_CMD> --env SHOPIFY_DEV_MCP_CMD=<SHOPIFY_DEV_MCP_CMD> --env CONTEXT7_MCP_CMD=<CONTEXT7_MCP_CMD> --transport stdio playguard -- npx -y playguard`.
What does PlayGuard do?
It serves as a proxy for browser and developer MCP servers, trimming token overhead in responses and restarting crashed browser instances.
What is required to run optional tools in PlayGuard?
Playwright is built in, but additional tools require specific environment variables such as FIGMA_MCP_CMD, DEVTOOLS_MCP_CMD, or API keys.