Skip to content

Feature Request: Add clipboard permissions support #759

@noda-uv

Description

@noda-uv

Description

Currently, Playwright MCP does not support clipboard permissions, which is available in native Playwright through permissions: ["clipboard-read", "clipboard-write"]. While clipboard operations work with explicit user permission prompts in the browser, automated testing requires these permissions to be granted programmatically without user interaction.

Suggested Solution

Add a --permissions command-line argument that accepts a comma-separated list of permissions:

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp@latest",
        "--permissions", "clipboard-read,clipboard-write"
      ]
    }
  }
}

This would enable clipboard operations via browser_evaluate without requiring manual permission approval:

// Read clipboard (no permission prompt)
await browser_evaluate({ function: "() => navigator.clipboard.readText()" })

// Write clipboard (no permission prompt)
await browser_evaluate({ 
  function: "(text) => navigator.clipboard.writeText(text)",
  args: ["Copy this!"]
})

Use Case

I need to test copy/paste functionality in my web application automatically. Currently, navigator.clipboard API calls trigger browser permission prompts that block automation workflows. I want to grant these permissions programmatically to enable unattended testing of clipboard-dependent features.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions