Playwright MCP Cursor
Provides browser automation capabilities to interact with Amazon web pages, including navigating search results and handling pagination.
Enables interaction with GitHub's GraphQL API to fetch repository data and paginate through results using cursors.
Allows executing GraphQL queries against APIs, with a built-in example for cursor-based pagination against the GitHub GraphQL API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Playwright MCP Cursorscrape the first 3 pages of GitHub search results for Playwright repos"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Playwright MCP Cursor
This repository demonstrates how to use Playwright with the Model Context Protocol (MCP). MCP is a standard that exposes browser automation capabilities as structured tool calls so that large‑language models can interact with websites and APIs. The included example shows how to perform cursor‑based pagination against the GitHub GraphQL API, but you can adapt the test to any site with pagination (for example, Amazon product listings).
Project structure
package.json – defines the npm dependencies and test scripts.
playwright.config.ts – Playwright configuration (baseURL, test directory, reporter, etc.).
tsconfig.json – TypeScript configuration for the project.
tests/mcp-cursor.spec.ts – automated test demonstrating how to page through API results using cursors.
Related MCP server: Playwright MCP Server
Prerequisites
Node.js (version 16 or higher).
npm or yarn.
A GitHub personal access token set as the environment variable
GITHUB_TOKEN(only required when running the GraphQL API test).
Installation
Clone this repository and install dependencies:
npm installRunning the tests
Execute the tests locally:
npx playwright testPlaywright will run in headless mode by default and produce an HTML report. To open the report after the run:
npx playwright show-reportRunning with MCP
To expose this project to an MCP client, you'll need to start an MCP server. For instructions on installing and running the MCP server, refer to the official Playwright MCP documentation. Once the server is running, point your client to the configured endpoint to send tool calls and drive Playwright under the hood.
Customizing the pagination example
The test in tests/mcp-cursor.spec.ts fetches repositories from the GitHub GraphQL API and paginates over the results using the endCursor and hasNextPage properties. If you prefer to test pagination on a web page such as Amazon, you can modify the test to navigate a search results page, click the "Next" button and assert that the correct items are loaded. Playwright's rich locator and browser APIs make it straightforward to adapt the pattern to any paginated data source.
Continuous integration
A GitHub Actions workflow is included in .github/workflows/playwright.yml to run the tests automatically on each push or pull request. The workflow installs dependencies, downloads the necessary browsers, and executes npm test on Ubuntu. It also passes through the GITHUB_TOKEN secret so the GraphQL test can authenticate against the GitHub API.
Feel free to fork this repository and experiment with other targets and protocols to expand your test coverage.
This server cannot be deployed
Maintenance
Related MCP Connectors
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
AI code review for GitHub PRs with an MCP autofix loop for Claude Code and Cursor
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Provides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to i…
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA Model Context Protocol server that provides browser automation capabilities using Playwright, enabling LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment.18Apache 2.0
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides browser automation capabilities using Playwright, enabling LLMs to interact with web pages, take screenshots, generate test code, scrape web content, and execute JavaScript in real browser environments.3115,344 npmMIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that provides browser automation capabilities using Playwright, enabling LLMs to interact with web pages through structured accessibility snapshots without requiring screenshots or visually-tuned models.225,046,799 npmApache 2.0
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides browser automation capabilities using Playwright, enabling LLMs to interact with web pages, take screenshots, generate test code, scrape web content, and execute JavaScript in a real browser environment.3215,344 npmMIT