MCP Puppeteer Linux
Enables browser automation for LLMs on Linux display servers, supporting web interaction, screenshots, and JavaScript execution in a real browser.
Enables browser automation for LLMs on Linux display servers, supporting web interaction, screenshots, and JavaScript execution in a real browser.
A Model Context Protocol server that provides browser automation capabilities using Puppeteer, with full support for Linux display servers (X11 and Wayland). This server enables LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment.
This fork adds automatic detection and configuration for Linux display servers: - Automatic X11/Wayland detection - Dynamic environment variable configuration - Support for various desktop environments (GNOME, KDE, etc.) - Fallback mechanisms and robust error handling - XWayland compatibility
url
(string)name
(string, required): Name for the screenshotselector
(string, optional): CSS selector for element to screenshotwidth
(number, optional, default: 800): Screenshot widthheight
(number, optional, default: 600): Screenshot heightselector
(string): CSS selector for element to clickselector
(string): CSS selector for element to hoverselector
(string): CSS selector for input fieldvalue
(string): Value to fillselector
(string): CSS selector for element to selectvalue
(string): Value to selectscript
(string): JavaScript code to executeThe server provides access to two types of resources:
1. Console Logs (console://logs
)
- Browser console output in text format
- Includes all console messages from the browser
2. Screenshots (screenshot://<name>
)
- PNG images of captured screenshots
- Accessible via the screenshot name specified during capture
{
"mcpServers": {
"puppeteer": {
"command": "npx",
"args": ["ts-node", "/path/to/index.ts"]
}
}
}
To install Puppeteer Linux for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @PhialsBasement/mcp-puppeteer-linux --client claude
Clone the repository:
git clone https://github.com/PhialsBasement/MCP-Puppeteer-Linux.git
Install dependencies:
npm install
Start the server:
ts-node index.ts
The server automatically detects and configures the appropriate display environment:
WAYLAND_DISPLAY
WAYLAND_DISPLAY
QT_QPA_PLATFORM
GDK_BACKEND
MOZ_ENABLE_WAYLAND
XDG_SESSION_TYPE
DISPLAY
XAUTHORITY
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
[
{
"description": "Navigate to a URL",
"inputSchema": {
"properties": {
"url": {
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
},
"name": "puppeteer_navigate"
},
{
"description": "Take a screenshot of the current page or a specific element",
"inputSchema": {
"properties": {
"height": {
"description": "Height in pixels (default: 600)",
"type": "number"
},
"name": {
"description": "Name for the screenshot",
"type": "string"
},
"selector": {
"description": "CSS selector for element to screenshot",
"type": "string"
},
"width": {
"description": "Width in pixels (default: 800)",
"type": "number"
}
},
"required": [
"name"
],
"type": "object"
},
"name": "puppeteer_screenshot"
},
{
"description": "Click an element on the page",
"inputSchema": {
"properties": {
"selector": {
"description": "CSS selector for element to click",
"type": "string"
}
},
"required": [
"selector"
],
"type": "object"
},
"name": "puppeteer_click"
},
{
"description": "Fill out an input field",
"inputSchema": {
"properties": {
"selector": {
"description": "CSS selector for input field",
"type": "string"
},
"value": {
"description": "Value to fill",
"type": "string"
}
},
"required": [
"selector",
"value"
],
"type": "object"
},
"name": "puppeteer_fill"
},
{
"description": "Select an element on the page with Select tag",
"inputSchema": {
"properties": {
"selector": {
"description": "CSS selector for element to select",
"type": "string"
},
"value": {
"description": "Value to select",
"type": "string"
}
},
"required": [
"selector",
"value"
],
"type": "object"
},
"name": "puppeteer_select"
},
{
"description": "Hover an element on the page",
"inputSchema": {
"properties": {
"selector": {
"description": "CSS selector for element to hover",
"type": "string"
}
},
"required": [
"selector"
],
"type": "object"
},
"name": "puppeteer_hover"
},
{
"description": "Execute JavaScript in the browser console",
"inputSchema": {
"properties": {
"script": {
"description": "JavaScript code to execute",
"type": "string"
}
},
"required": [
"script"
],
"type": "object"
},
"name": "puppeteer_evaluate"
}
]