# Playwright MCP Browser Automation Server (`produkdigitalali/playwright-mcp-browser-server`) Actor

Control a Playwright browser through MCP: navigate, fill forms, extract text and links, and save screenshots with isolated sessions and domain controls.

- **URL**: https://apify.com/produkdigitalali/playwright-mcp-browser-server.md
- **Developed by:** [ProdukDigitalAli](https://apify.com/produkdigitalali) (community)
- **Categories:** AI, Developer tools, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $12.00 / 1,000 successful browser tool calls

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Playwright MCP Browser Automation Server

Give an MCP-compatible AI agent a live Playwright browser with isolated sessions, domain controls, predictable limits, and ten focused tools.

### Connect in one minute

Use the Actor Standby endpoint and include every domain the browser may navigate to:

```text
https://produkdigitalali--playwright-mcp-browser-server.apify.actor/mcp?allowedDomains=example.com
```

Cursor and other remote MCP clients can use:

```json
{
  "mcpServers": {
    "secure-playwright": {
      "url": "https://produkdigitalali--playwright-mcp-browser-server.apify.actor/mcp?allowedDomains=example.com"
    }
  }
}
```

For Claude Desktop, add the same URL as a custom remote MCP connector. In n8n, use it as the Streamable HTTP URL in an MCP Client Tool node. Never paste an Apify token into a prompt or issue.

### Three useful examples

1. **Extract a public table**
   - URL: `https://example.com`
   - Allowlist: `example.com`
   - Prompt: "Open the page, extract its visible text and links, then tell me the current URL."

2. **Fill a public form**
   - Allowlist every expected form and redirect domain.
   - Prompt: "Open the contact form, fill the name and message fields, take a screenshot, and stop before submitting."

3. **Capture evidence**
   - Prompt: "Open this public page, wait for the main heading, extract the text, and save a full-page screenshot."

### Ten tools

| Tool | Purpose |
| --- | --- |
| `navigate` | Open an allowlisted public HTTP(S) URL and check redirects. |
| `click` | Click the first matching element. |
| `fill` | Replace a form value without logging that value. |
| `press` | Press a keyboard key on an element or page. |
| `extract_text` | Return bounded visible text. |
| `extract_links` | Return up to 200 links. |
| `screenshot` | Save a PNG in Apify key-value storage and return its key. |
| `get_url` | Return the current page URL. |
| `wait` | Wait for a visible element or up to 10 seconds. |
| `close` | Close the browser context and release session resources. |

Version 1 deliberately excludes arbitrary JavaScript execution, cookies, downloads, raw HTML, PDF generation, and network capture.

### Session controls

The endpoint accepts these query parameters:

| Parameter | Default | Accepted |
| --- | ---: | ---: |
| `allowedDomains` | required | Comma-separated exact domains; subdomains are included. |
| `maxToolCalls` | 50 | 1-200 |
| `idleTimeoutMs` | 90000 | 30000-300000 |
| `hardTimeoutMs` | 900000 | 60000-1800000 |

Each MCP session gets its own Playwright browser context. The server blocks localhost, private and link-local networks, reserved and multicast addresses, URL credentials, non-HTTP(S) schemes, and ports other than 80/443. Navigation redirects are checked against the same domain allowlist. External public subresources may load, while any private-network subresource is blocked.

### Result shape

Successful tools return compact JSON in both text and structured MCP content:

```json
{
  "success": true,
  "tool": "extract_text",
  "currentUrl": "https://example.com/",
  "durationMs": 24,
  "data": {
    "text": "Example Domain ...",
    "truncated": false
  }
}
```

Screenshots return a storage reference:

```json
{
  "storageKey": "screenshot_SESSION_HASH_TIMESTAMP_ID.png",
  "contentType": "image/png",
  "bytes": 18432
}
```

### Pricing

The launch price is **$0.012 per successful tool call** ($12 per 1,000 successful calls). Failed calls are not charged as successful calls.

- 10 successful calls: $0.12
- 50 successful calls: $0.60
- 100 successful calls: $1.20

Apify Standby users also cover platform usage for the running container. Keep sessions short and call `close` when finished. Pricing will be reviewed only after enough external usage exists to measure typical session cost.

### When to use this Actor

- Give Claude, Cursor, n8n, or another MCP agent an interactive browser.
- Restrict an agent to one public domain or a small approved domain set.
- Extract text and links one decision at a time.
- Fill forms with a human review before submission.
- Capture screenshots as referenced evidence.
- Run browser work where a fixed batch script cannot decide the next action in advance.

### Choosing the right browser Actor

| Tool | Choose it when |
| --- | --- |
| Puppeteer Browser Automation Runner | You want a simple deterministic Chrome workflow. |
| Selenium Browser Automation Runner | You use WebDriver locators or Selenium knowledge. |
| Chrome DevTools Automation Runner | You need low-level CDP commands or rendering diagnostics. |
| Playwright Browser Automation Runner | You want a deterministic batch workflow with Playwright actions. |
| Browser Network & HAR Capture Inspector | You need network, API, failed-request, or HAR diagnostics. |
| Browser Use AI Task Runner | You want to submit a natural-language goal as a batch task. |
| **Playwright MCP Browser Automation Server** | You need a live browser controlled one tool call at a time by an MCP agent. |

### Limits and responsible use

Use this Actor only on sites you are authorized to access. It does not bypass CAPTCHAs, access controls, robots restrictions, or rate limits. A target may return 403/429 or block cloud browsers. The Actor does not expose or persist cookies, API keys, authorization headers, or proxy credentials.

### Support

Include the approximate time, tool name, target hostname, MCP client, and sanitized error in an issue. Never post API tokens, passwords, cookies, authorization headers, form values, or private URLs.

# Actor input Schema

## Actor input object example

```json
{}
```

# Actor output Schema

## `screenshots` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("produkdigitalali/playwright-mcp-browser-server").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("produkdigitalali/playwright-mcp-browser-server").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call produkdigitalali/playwright-mcp-browser-server --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,produkdigitalali/playwright-mcp-browser-server"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/9AQYtj4bb972gXLst/builds/dZp3jAg4qzfiHF8c5/openapi.json
