playwright-mcp-server

jamwalsudip/playwright-mcp-server

3.1

If you are the rightful owner of playwright-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Playwright MCP Server for Render is a cloud-based solution for browser automation, designed to work seamlessly with n8n workflows and other MCP clients.

Playwright MCP Server for Render

This repository contains a ready-to-deploy Playwright MCP (Model Context Protocol) server configured for Render cloud hosting. It enables browser automation capabilities accessible via n8n workflows or any MCP client.

What This Does

  • Runs a Playwright MCP server in the cloud (24/7)
  • Provides 21+ browser automation tools
  • Accessible via HTTP for n8n integration
  • Completely independent of any local machine

Quick Deploy to Render

Prerequisites

  1. A GitHub account
  2. A Render account (free tier available at render.com)

Deployment Steps

Step 1: Push This Repository to GitHub
  1. Create a new repository on GitHub:

    • Go to github.com/new
    • Name it: playwright-mcp-server
    • Make it Public or Private (your choice)
    • Do NOT initialize with README (we already have one)
    • Click "Create repository"
  2. Push this code to GitHub:

    # Navigate to this directory
    cd playwright-mcp-render
    
    # Initialize git
    git init
    
    # Add all files
    git add .
    
    # Commit
    git commit -m "Initial commit: Playwright MCP server for Render"
    
    # Add your GitHub repository as remote
    git remote add origin https://github.com/YOUR-USERNAME/playwright-mcp-server.git
    
    # Push to GitHub
    git push -u origin main
    
Step 2: Deploy to Render
  1. Go to dashboard.render.com

  2. Click "New +" → "Web Service"

  3. Connect your GitHub repository:

    • Click "Connect account" if not already connected
    • Find and select playwright-mcp-server
    • Click "Connect"
  4. Configure the service:

    • Name: playwright-mcp-server (or your preferred name)
    • Region: Choose closest to you
    • Branch: main
    • Runtime: Node
    • Build Command: npm install && npx playwright install --with-deps chromium
    • Start Command: npm start
    • Plan: Free
  5. Click "Create Web Service"

  6. Wait for deployment (5-10 minutes)

    • Render will install dependencies
    • Install Playwright browsers
    • Start the server
    • You'll see logs in real-time
  7. Get your endpoint URL:

    • Once deployed, you'll see a URL like: https://playwright-mcp-server.onrender.com
    • Your MCP endpoint is: https://playwright-mcp-server.onrender.com/mcp
Step 3: Configure n8n
  1. In your n8n workflow:

    • Add an AI Agent node
    • Add MCP Client Tool to the agent
  2. Configure MCP Client Tool:

    • Endpoint: https://playwright-mcp-server.onrender.com/mcp
    • Server Transport: HTTP Streamable
    • Authentication: None
    • Tools to Include: All
  3. Test the connection by running your workflow

Important Notes About Render Free Tier

Limitations

  • Spins down after 15 minutes of inactivity

    • First request after spin-down takes ~30 seconds to wake up
    • Subsequent requests are fast
  • 512 MB RAM

    • Sufficient for most browser automation tasks
    • May struggle with very complex pages or multiple simultaneous requests
  • 750 hours/month free

    • More than enough for testing and development

Upgrading

If you need always-on service:

  • Upgrade to Starter plan ($7/month)
  • Gets you 1GB RAM and no spin-down

Troubleshooting

Deployment Fails

Issue: Build fails with "Out of memory" Solution: This is rare on Render, but if it happens, try:

  • Reduce browser installations to just Chromium (already configured)
  • Upgrade to paid tier for more RAM

Issue: "Port already in use" Solution: The server.js automatically uses Render's PORT environment variable. No action needed.

n8n Connection Issues

Issue: "Cannot connect to MCP server" Solution:

  1. Check if Render service is running (green status in dashboard)
  2. Verify the endpoint URL is correct
  3. Wait 30 seconds if service just spun down
  4. Check Render logs for errors

Issue: "First request is very slow" Solution: This is normal on free tier. The service spins down after 15 minutes of inactivity. First request wakes it up (~30 seconds).

Browser Automation Fails

Issue: "Browser crashed" or "Out of memory" Solution:

  • Free tier has 512MB RAM, which is limited
  • Try simpler automation tasks
  • Upgrade to Starter plan ($7/month) for 1GB RAM

Architecture

User → n8n Workflow → MCP Client Tool → Render (Playwright MCP Server) → Browser → Results

Files in This Repository

  • package.json: Node.js dependencies
  • server.js: Wrapper script that starts MCP server with correct configuration
  • render.yaml: Render deployment configuration (optional, for Blueprint deployment)
  • .gitignore: Files to exclude from Git
  • README.md: This file

Environment Variables

The server automatically uses these environment variables set by Render:

  • PORT: Automatically set by Render (usually 10000)
  • NODE_ENV: Set to production
  • PLAYWRIGHT_BROWSERS_PATH: Cache location for browsers

No manual configuration needed!

Monitoring

Check Server Status

Visit your Render dashboard to see:

  • Service status (running/sleeping)
  • Recent logs
  • Deployment history
  • Resource usage

View Logs

In Render dashboard:

  1. Click on your service
  2. Click "Logs" tab
  3. See real-time server logs

Updating the Server

To update the MCP server version or configuration:

  1. Make changes locally
  2. Commit and push to GitHub:
    git add .
    git commit -m "Update configuration"
    git push
    
  3. Render auto-deploys (if enabled) or click "Manual Deploy" in dashboard

Cost

  • Free tier: $0/month

    • 750 hours/month
    • 512 MB RAM
    • Spins down after 15 min inactivity
  • Starter tier: $7/month

    • Always on
    • 1 GB RAM
    • Better for production

Security Considerations

For Production Use

Currently, the server has no authentication. For production:

  1. Add API key authentication
  2. Use HTTPS (Render provides this automatically)
  3. Restrict access to known IP addresses
  4. Monitor usage to detect abuse

Support

License

MIT

Contributing

Feel free to submit issues or pull requests to improve this deployment configuration.