$git clone https://github.com/merajmehrabi/puppeteer-mcp-serverThis project is an experimental implementation inspired by @modelcontextprotocol/server-puppeteer. While it shares similar goals and concepts, it explores alternative approaches to browser automation through the Model Context Pro
| 1 | # Puppeteer MCP Server |
| 2 | |
| 3 | [](https://smithery.ai/server/@merajmehrabi/puppeteer-mcp-server) |
| 4 | This MCP server provides browser automation capabilities through Puppeteer, allowing interaction with both new browser instances and existing Chrome windows. |
| 5 | |
| 6 | ## Acknowledgment |
| 7 | |
| 8 | This project is an experimental implementation inspired by [@modelcontextprotocol/server-puppeteer](https://github.com/modelcontextprotocol/servers). While it shares similar goals and concepts, it explores alternative approaches to browser automation through the Model Context Protocol. |
| 9 | |
| 10 | <a href="https://glama.ai/mcp/servers/lpt1tvbubf"><img width="380" height="200" src="https://glama.ai/mcp/servers/lpt1tvbubf/badge" alt="Puppeteer Server MCP server" /></a> |
| 11 | |
| 12 | ## Features |
| 13 | |
| 14 | - Navigate web pages |
| 15 | - Take screenshots |
| 16 | - Click elements |
| 17 | - Fill forms |
| 18 | - Select options |
| 19 | - Hover elements |
| 20 | - Execute JavaScript |
| 21 | - Smart Chrome tab management: |
| 22 | - Connect to active Chrome tabs |
| 23 | - Preserve existing Chrome instances |
| 24 | - Intelligent connection handling |
| 25 | |
| 26 | ## Project Structure |
| 27 | |
| 28 | ``` |
| 29 | / |
| 30 | ├── src/ |
| 31 | │ ├── config/ # Configuration modules |
| 32 | │ ├── tools/ # Tool definitions and handlers |
| 33 | │ ├── browser/ # Browser connection management |
| 34 | │ ├── types/ # TypeScript type definitions |
| 35 | │ ├── resources/ # Resource handlers |
| 36 | │ └── server.ts # Server initialization |
| 37 | ├── index.ts # Entry point |
| 38 | └── README.md # Documentation |
| 39 | ``` |
| 40 | |
| 41 | ## Installation |
| 42 | |
| 43 | ### Option 1: Install from npm |
| 44 | |
| 45 | ```bash |
| 46 | npm install -g puppeteer-mcp-server |
| 47 | ``` |
| 48 | |
| 49 | You can also run it directly without installation using npx: |
| 50 | |
| 51 | ```bash |
| 52 | npx puppeteer-mcp-server |
| 53 | ``` |
| 54 | |
| 55 | ### Option 2: Install from source |
| 56 | |
| 57 | 1. Clone this repository or download the source code |
| 58 | 2. Install dependencies: |
| 59 | |
| 60 | ```bash |
| 61 | npm install |
| 62 | ``` |
| 63 | |
| 64 | 3. Build the project: |
| 65 | |
| 66 | ```bash |
| 67 | npm run build |
| 68 | ``` |
| 69 | |
| 70 | 4. Run the server: |
| 71 | |
| 72 | ```bash |
| 73 | npm start |
| 74 | ``` |
| 75 | |
| 76 | ## MCP Server Configuration |
| 77 | |
| 78 | To use this tool with Claude, you need to add it to your MCP settings configuration file. |
| 79 | |
| 80 | ### For Claude Desktop App |
| 81 | |
| 82 | Add the following to your Claude Desktop configuration file (located at `%APPDATA%\Claude\claude_desktop_config.json` on Windows or `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS): |
| 83 | |
| 84 | #### If installed globally via npm: |
| 85 | |
| 86 | ```json |
| 87 | { |
| 88 | "mcpServers": { |
| 89 | "puppeteer": { |
| 90 | "command": "puppeteer-mcp-server", |
| 91 | "args": [], |
| 92 | "env": {} |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | ``` |
| 97 | |
| 98 | #### Using npx (without installation): |
| 99 | |
| 100 | ```json |
| 101 | { |
| 102 | "mcpServers": { |
| 103 | "puppeteer": { |
| 104 | "command": "npx", |
| 105 | "args": ["-y", "puppeteer-mcp-server"], |
| 106 | "env": {} |
| 107 | } |
| 108 | } |
| 109 | } |
| 110 | ``` |
| 111 | |
| 112 | #### If installed from source: |
| 113 | |
| 114 | ```json |
| 115 | { |
| 116 | "mcpServers": { |
| 117 | "puppeteer": { |
| 118 | "command": "node", |
| 119 | "args": ["path/to/puppeteer-mcp-server/dist/index.js"], |
| 120 | "env": { |
| 121 | "NODE_OPTIONS": "--experimental-modules" |
| 122 | } |
| 123 | } |
| 124 | } |
| 125 | } |
| 126 | ``` |
| 127 | |
| 128 | ### For Claude VSCode Extension |
| 129 | |
| 130 | Add the following to your Claude VSCode extension MCP settings file (located at `%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json` on Windows or `~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` on macOS): |
| 131 | |
| 132 | #### If installed globally via npm: |
| 133 | |
| 134 | ```json |
| 135 | { |
| 136 | "mcpServers": { |
| 137 | "puppeteer": { |
| 138 | "command": "puppeteer-mcp-server", |
| 139 | "args": [], |
| 140 | "env": {} |
| 141 | } |
| 142 | } |
| 143 | } |
| 144 | ``` |
| 145 | |
| 146 | #### Using npx (without installation): |
| 147 | |
| 148 | ```json |
| 149 | { |
| 150 | "mcpServers": { |
| 151 | "puppeteer": { |
| 152 | "command": "npx", |
| 153 | "args": ["-y", "puppeteer-mcp-server"], |
| 154 | "env": {} |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | ``` |
| 159 | |
| 160 | #### If installed from source: |
| 161 | |
| 162 | ```json |
| 163 | { |
| 164 | "mcpServers": { |
| 165 | "puppeteer": { |
| 166 | "command": "node", |
| 167 | "args": ["path/to/puppeteer-mcp-server/dist/index.js"], |
| 168 | "env": { |
| 169 | "NODE_OPTIONS": "--experimental-modules" |
| 170 | } |
| 171 | } |
| 172 | } |
| 173 | } |
| 174 | ``` |
| 175 | |
| 176 | For source installation, replace `path/to/puppeteer-mcp-server` with the actual path to where you installed this tool. |
| 177 | |
| 178 | ## U |