documentation/docs/mcp/puppeteer-mcp.md
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import YouTubeShortEmbed from '@site/src/components/YouTubeShortEmbed'; import GooseDesktopInstaller from '@site/src/components/GooseDesktopInstaller';
<YouTubeShortEmbed videoUrl="https://youtube.com/embed/rms0wVGnlXA" />Server archived
This tutorial covers how to add the Puppeteer MCP Server as a goose extension, enabling goose to interact with websites - navigating pages, filling forms, clicking buttons, taking screenshots, and executing JavaScript in a real browser environment.
:::tip Quick Install <Tabs groupId="interface"> <TabItem value="ui" label="goose Desktop" default> Launch the installer </TabItem> <TabItem value="cli" label="goose CLI"> Command
npx -y @modelcontextprotocol/server-puppeteer
:::info
Note that you'll need Node.js installed on your system to run this command, as it uses npx.
:::
Command-line Extension ┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension (Connect to a new extension)
│
◆ What type of extension would you like to add?
│ ○ Built-in Extension
// highlight-start
│ ● Command-line Extension (Run a local command or script)
// highlight-end
│ ○ Remote Extension (Streamable HTTP)
└
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension (Connect to a new extension)
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
// highlight-start
◆ What would you like to call this extension?
│ Puppeteer
// highlight-end
└
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension (Connect to a new extension)
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ Puppeteer
│
// highlight-start
◆ What command should be run?
│ npx -y @modelcontextprotocol/server-puppeteer
// highlight-end
└
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension (Connect to a new extension)
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ Puppeteer
│
◇ What command should be run?
│ npx -y @modelcontextprotocol/server-puppeteer
│
// highlight-start
◆ Please set the timeout for this tool (in secs):
│ 300
// highlight-end
└
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension (Connect to a new extension)
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ Puppeteer
│
◇ What command should be run?
│ npx -y @modelcontextprotocol/server-puppeteer
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
// highlight-start
◇ Would you like to add a description?
│ No
// highlight-end
└
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension (Connect to a new extension)
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ Puppeteer
│
◇ What command should be run?
│ npx -y @modelcontextprotocol/server-puppeteer
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◇ Would you like to add a description?
│ No
│
// highlight-start
◆ Would you like to add environment variables?
│ No
│
// highlight-end
└ Added puppeteer extension
In this example, I’ll show you how to use goose with the Puppeteer Extension to perform an accessibility audit on a website. By automating browser interactions, goose can navigate the site, test keyboard navigation, check color contrast, analyze ARIA attributes, and generate a detailed report with recommendations and code fixes.
This allows you to quickly identify and resolve accessibility issues without manually inspecting each page.
<Tabs groupId="interface"> <TabItem value="ui" label="goose Desktop" default> 1. Open a new session in goose Desktop </TabItem> <TabItem value="cli" label="goose CLI"> 1. Open a terminal and start a new goose session:goose session
Can you check if my website is accessible? Please conduct a full accessibility audit, focusing on the following:
1. Keyboard Navigation: Test all interactive elements (links, buttons, dropdowns, etc.) to ensure they are accessible without a mouse.
2. Color Contrast Analysis: Verify that all text and UI elements meet WCAG contrast ratio standards.
3. Screen Reader Compatibility: Test whether a screen reader can properly interpret content and navigation.
4. ARIA & Semantic HTML Validation: Identify any missing or misused ARIA attributes and ensure proper semantic structure.
5. Error Identification & Screenshots: Provide a comprehensive report with identified issues, along with screenshots if necessary.
6. Fixes & Code Recommendations: Suggest HTML, CSS, or JavaScript changes to resolve any compliance issues.
Here is the website to test: https://broken-workshop.dequelabs.com/. I want to ensure that our documentation meets accessibility standards. Please generate a detailed report with steps to fix any issues found.
:::note Desktop I'll help you conduct a comprehensive accessibility audit of the website. I'll use a combination of automated and manual testing approaches to evaluate different accessibility aspects.
1. First, let's navigate to the site
2. Take screenshots and perform keyboard navigation testing
3. Run accessibility audits including color contrast analysis
4. Document findings
Let's begin:
`─── Puppeteer Navigate ──────────────────────────`
Let's take a screenshot of the homepage for reference:
`─── Puppeteer Screenshot ────────────────────────`
I'll conduct a detailed accessibility audit of the recipe dashboard website. From the initial view, I can already identify several accessibility concerns. Let me break down the findings by category:
1. Keyboard Navigation Issues:
2. Color Contrast Issues:
3. Semantic Structure Problems:
4. ARIA and Screen Reader Issues:
Let me run some additional tests to verify these issues:
`─── Puppeteer Evaluate ──────────────────────────`
Let me capture some specific sections for detailed analysis:
`─── Puppeteer Screenshot ──────────────────────────`
Based on my analysis, here's a detailed report with recommendations:
ACCESSIBILITY AUDIT REPORT
1. Structural Issues:
<!-- Current -->
<div class="recipe-title">Chocolate Cake</div>
<!-- Recommended -->
<h2 class="recipe-title">Chocolate Cake</h2>
2. Interactive Elements:
<!-- Current -->
<button class="cook-button">COOK CHOCOLATE CAKE</button>
<!-- Recommended -->
<button
class="cook-button"
aria-label="Cook Chocolate Cake recipe"
tabindex="0">
COOK CHOCOLATE CAKE
</button>
3. Image Accessibility:
<!-- Current -->
<!-- Recommended -->
4. Chart Accessibility:
<!-- Recommended addition -->
<div class="yumminess-chart"
role="region"
aria-label="Monthly yumminess ratings">
<table class="sr-only">
<!-- Add hidden table for screen readers -->
</table>
</div>
5. Color Contrast Fixes:
/* Current */
.difficulty-beginner {
color: #90EE90;
}
/* Recommended */
.difficulty-beginner {
color: #2E7D32; /* Darker green for better contrast */
}
6. Focus Management:
/* Add to CSS */
:focus {
outline: 3px solid #2196F3;
outline-offset: 2px;
}
.cook-button:focus {
box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.4);
}
Priority Fixes Needed:
1. High Priority:
2. Medium Priority:
3. Low Priority:
Additional Recommendations:
1. Add a skip link:
<a href="#main-content" class="skip-link">
Skip to main content
</a>
2. Implement proper form labels:
<label for="prep-time">Preparation Time</label>
<input id="prep-time" type="text" value="20 min">
3. Add ARIA live regions for dynamic updates:
<div aria-live="polite" role="status">
<!-- Dynamic content updates -->
</div>
Testing Tools Recommended:
This audit reveals several critical accessibility issues that should be addressed to ensure WCAG 2.1 compliance. The most urgent concerns are the lack of proper semantic structure, insufficient color contrast, and missing ARIA attributes. Would you like me to provide more specific details about implementing any of these fixes? :::
You can take this accessibility audit a step further by combining the GitHub Extension with the Puppeteer Extension. With this setup, goose doesn’t just find issues and apply fixes, it can also handle the entire Git workflow for you. The GitHub Extension allows goose to commit changes, create a pull request, and even generate a PR description, so all you have to do is review and merge.
:::tip Ensure your GitHub Personal Access Token has the necessary permissions for repository access and pull request creation when using this combined approach. :::
Ask goose to:
Can you create a new branch called 'accessibility-improvements', apply the accessibility fixes you suggested, and open a pull request with these changes?
goose will then:
accessibility-improvements