Claude Desktop Setup Guide
Claude Desktop Setup Guide
Section titled “Claude Desktop Setup Guide”Version: 1.0.13
Reading Time: 5 minutes
Overview
Section titled “Overview”Set up Puppeteer MCP with Claude Desktop to enable AI-powered browser automation. Claude will be able to browse websites, take screenshots, fill forms, and extract data on your behalf.
Prerequisites
Section titled “Prerequisites”- Claude Desktop installed on your computer
- Node.js 18.0.0+ and npm 9.0.0+
- Puppeteer MCP installed (see Installation Guide)
Quick Setup (3 Steps)
Section titled “Quick Setup (3 Steps)”Step 1: Install Puppeteer MCP
Section titled “Step 1: Install Puppeteer MCP”npm install -g puppeteer-mcp
Verify installation:
puppeteer-mcp --version
Step 2: Configure Claude Desktop
Section titled “Step 2: Configure Claude Desktop”Find your Claude Desktop configuration file:
📁 Configuration File Locations
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Linux:
~/.config/claude/claude_desktop_config.json
If the file doesn’t exist, create it with the directory structure.
Add this configuration:
{ "mcpServers": { "puppeteer": { "command": "npx", "args": ["puppeteer-mcp"], "env": { "PUPPETEER_MCP_AUTH_TOKEN": "your-secret-token-here" } } }}
Step 3: Restart Claude Desktop
Section titled “Step 3: Restart Claude Desktop”- Completely quit Claude Desktop (not just close the window)
- Start Claude Desktop again
- Look for “puppeteer” in the available tools list
Configuration Options
Section titled “Configuration Options”Basic Configuration (Recommended)
Section titled “Basic Configuration (Recommended)”{ "mcpServers": { "puppeteer": { "command": "npx", "args": ["puppeteer-mcp"] } }}
This uses default settings - perfect for getting started.
Advanced Configuration
Section titled “Advanced Configuration”With Authentication
{ "mcpServers": { "puppeteer": { "command": "npx", "args": ["puppeteer-mcp"], "env": { "PUPPETEER_MCP_AUTH_TOKEN": "generate-a-secure-token-here", "NODE_ENV": "production" } } }}
Generate a secure token:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
With Custom Settings
{ "mcpServers": { "puppeteer": { "command": "npx", "args": ["puppeteer-mcp"], "env": { "PUPPETEER_HEADLESS": "true", "MAX_SESSIONS": "5", "SESSION_TIMEOUT": "1800000", "PORT": "3001", "DEBUG": "puppeteer:*" } } }}
Using Global Installation
If you installed globally:
{ "mcpServers": { "puppeteer": { "command": "puppeteer-mcp" } }}
Using Local Project Path
For development or custom builds:
{ "mcpServers": { "puppeteer": { "command": "node", "args": ["/path/to/puppeteer-mcp/dist/bin/puppeteer-mcp.js"], "env": { "NODE_ENV": "development" } } }}
Verify Setup
Section titled “Verify Setup”Check Tool Availability
Section titled “Check Tool Availability”- Open Claude Desktop
- Start a new conversation
- Type: “What tools do you have available?”
- Claude should list “puppeteer” among the available tools
Test Browser Automation
Section titled “Test Browser Automation”Try these commands in Claude:
"Navigate to example.com and take a screenshot"
"Go to Wikipedia and search for 'artificial intelligence'"
"Visit https://news.ycombinator.com and tell me the top 3 stories"
Usage Examples
Section titled “Usage Examples”Basic Web Browsing
Section titled “Basic Web Browsing”Take a Screenshot
Ask Claude:
“Take a screenshot of https://example.com”
Claude will:
- Create a browser session
- Navigate to the website
- Capture a screenshot
- Show you the image
Extract Information
Ask Claude:
“Go to https://weather.com and tell me today’s weather”
Claude will:
- Navigate to the weather site
- Extract relevant information
- Summarize the weather for you
Form Automation
Section titled “Form Automation”Fill Out Forms
Ask Claude:
“Go to the contact form at example.com/contact and fill it out with test data”
Claude can:
- Fill text inputs
- Select dropdowns
- Check/uncheck boxes
- Submit forms
Data Extraction
Section titled “Data Extraction”Web Scraping
Ask Claude:
“Extract all product names and prices from shop.example.com”
Claude will:
- Navigate to the page
- Identify product elements
- Extract structured data
- Present it in a readable format
Advanced Automation
Section titled “Advanced Automation”Multi-Step Workflows
Ask Claude:
“Log into my test account at demo.example.com (username: test, password: demo123), navigate to the dashboard, and download the monthly report”
Claude can handle complex, multi-step automations.
Best Practices
Section titled “Best Practices”1. Security Considerations
Section titled “1. Security Considerations”- Never share real passwords with Claude
- Use test accounts for automation
- Set up authentication tokens for production use
- Run in headless mode for security
2. Clear Instructions
Section titled “2. Clear Instructions”Good vs Bad Instructions
❌ Bad:
“Check that website”
✅ Good:
“Navigate to https://example.com and take a screenshot of the homepage”
❌ Bad:
“Fill the form”
✅ Good:
“Go to example.com/contact, fill the email field with test@example.com, and submit the form”
3. Handle Timeouts
Section titled “3. Handle Timeouts”Some websites load slowly. Be patient or specify:
“Navigate to slow-site.com and wait up to 30 seconds for it to load completely”
4. Session Management
Section titled “4. Session Management”Claude automatically manages browser sessions, but you can be explicit:
“Create a new browser session, navigate to example.com, take a screenshot, then close the session”
Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”❌ Claude doesn't see the tool
-
Check configuration file syntax:
Terminal window # Validate JSONcat ~/Library/Application\ Support/Claude/claude_desktop_config.json | jq . -
Ensure proper file location:
- The config file must be in the exact location
- Directory must exist
-
Restart Claude completely:
- Quit Claude Desktop (Cmd+Q on Mac)
- Start it again
-
Check logs (if available):
- Look for MCP-related errors
- Verify the command runs manually
❌ "Command not found" error
-
Verify installation:
Terminal window which puppeteer-mcp # Should show pathnpx puppeteer-mcp --version # Should show version -
Try alternative commands:
{"command": "node","args": ["/usr/local/lib/node_modules/puppeteer-mcp/dist/bin/puppeteer-mcp.js"]} -
Use npx (recommended):
{"command": "npx","args": ["puppeteer-mcp"]}
❌ Browser fails to launch
-
Install Chrome dependencies (Linux):
Terminal window sudo apt-get install -y chromium-browser -
Set Chrome path:
{"env": {"PUPPETEER_EXECUTABLE_PATH": "/usr/bin/google-chrome"}} -
Use Docker for consistent environment
❌ Authentication errors
-
Generate a secure token:
Terminal window openssl rand -hex 32 -
Set in both places:
- Claude config:
PUPPETEER_MCP_AUTH_TOKEN
- Server expects the same token
- Claude config:
-
Test without auth first:
{"env": {"NODE_ENV": "development"}}
Debug Mode
Section titled “Debug Mode”Enable detailed logging:
{ "mcpServers": { "puppeteer": { "command": "npx", "args": ["puppeteer-mcp"], "env": { "DEBUG": "puppeteer:*", "NODE_ENV": "development" } } }}
Advanced Features
Section titled “Advanced Features”Custom Browser Options
Section titled “Custom Browser Options”{ "env": { "PUPPETEER_ARGS": "--no-sandbox --disable-setuid-sandbox", "PUPPETEER_HEADLESS": "false", "DEFAULT_VIEWPORT_WIDTH": "1920", "DEFAULT_VIEWPORT_HEIGHT": "1080" }}
Multiple Instances
Section titled “Multiple Instances”Run different configurations:
{ "mcpServers": { "puppeteer-prod": { "command": "npx", "args": ["puppeteer-mcp"], "env": { "PORT": "3001", "NODE_ENV": "production" } }, "puppeteer-dev": { "command": "npx", "args": ["puppeteer-mcp"], "env": { "PORT": "3002", "NODE_ENV": "development", "PUPPETEER_HEADLESS": "false" } } }}
Security Best Practices
Section titled “Security Best Practices”- Always use authentication tokens in production
- Never expose real credentials to Claude
- Run in headless mode for security
- Limit session timeouts to prevent resource leaks
- Use read-only operations when possible
Next Steps
Section titled “Next Steps”✅ Setup complete! Now you can:
- Explore usage examples - See what’s possible
- Configure advanced settings - Customize behavior
- Read the full API docs - Learn all capabilities
Getting Help
Section titled “Getting Help”- 💬 Ask Claude directly about browser automation
- 📚 Check the MCP Documentation
- 🐛 Report issues on GitHub
Pro Tip: Start with simple tasks like screenshots, then gradually try more complex automations. Claude learns from your usage patterns! 🤖