You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: 'Using Playwright MCP with PraisonAI'
4
+
---
5
+
6
+
# Playwright MCP
7
+
8
+
[Playwright](https://playwright.dev/) is a powerful browser automation tool that can be used with the Model Context Protocol (MCP) to enable agents to interact with web browsers.
9
+
10
+
## Installation
11
+
12
+
To use Playwright with MCP, you'll need to install the Playwright MCP package:
13
+
14
+
```bash
15
+
npm install @playwright/mcp
16
+
```
17
+
18
+
## Running the Playwright MCP Server
19
+
20
+
You need to run the Playwright MCP server in a separate terminal before your agent can use it:
21
+
22
+
```bash
23
+
npx @playwright/mcp@latest --port 8931
24
+
```
25
+
26
+
This will start a Playwright MCP server on port 8931 that your agent can connect to.
27
+
28
+
## Using Playwright MCP with PraisonAI
29
+
30
+
Once the Playwright MCP server is running, you can create an agent that uses it as a tool:
31
+
32
+
```python
33
+
from praisonaiagents import Agent, MCP
34
+
35
+
search_agent = Agent(
36
+
instructions="""You help search the web.""",
37
+
llm="gpt-4o-mini",
38
+
tools=MCP("http://localhost:8931/sse")
39
+
)
40
+
41
+
search_agent.start("Find about Praison AI")
42
+
```
43
+
44
+
The agent will be able to use Playwright to automate browser interactions and search the web.
45
+
46
+
## Advanced Configuration
47
+
48
+
You can customize the Playwright MCP server by passing additional options:
For more information on available options, refer to the [Playwright MCP documentation](https://github.com/microsoft/playwright/tree/main/packages/mcp).
0 commit comments