kevinwatt
MCP Serverkevinwattpublic

playwright fetch mcp

一个使用 Playwright 抓取网页内容的工具,支持 JSON、纯文本和 Markdown 格式。

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
TypeScript
Language
-
License

About This Server

一个使用 Playwright 抓取网页内容的工具,支持 JSON、纯文本和 Markdown 格式。

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

Playwright Fetch MCP Server

This MCP server provides functionality to fetch web content in various formats, including JSON, plain text, and Markdown.

Installation

Prerequisites

Before using this tool, you need to install Playwright and its browser dependencies:

Windows

npm install -g playwright
npx playwright install chromium

macOS

npm install -g playwright
npx playwright install chromium

Linux

npm install -g playwright
npx playwright install chromium

Installation Methods

Via npm

npm install @kevinwatt/playwright-fetch-mcp

From source code

git clone https://github.com/kevinwatt/playwright-fetch-mcp.git
cd playwright-fetch-mcp
npm install
npm run build

Components

Tools

  • fetch_json

    • Fetches JSON content from a URL
    • Input:
      • url (string, required): The URL of the JSON resource to fetch
      • headers (object, optional): Custom headers to include in the request
    • Returns the parsed JSON content
  • fetch_txt

    • Fetches a website and returns plain text content (HTML tags removed)
    • Input:
      • url (string, required): The URL of the website to fetch
      • headers (object, optional): Custom headers to include in the request
    • Returns the plain text content of the webpage with HTML tags, scripts, and styles removed
  • fetch_markdown

    • Fetches a website and converts its content to Markdown format
    • Input:
      • url (string, required): The URL of the website to fetch
      • headers (object, optional): Custom headers to include in the request
    • Returns the webpage content converted to Markdown format

Resources

This server does not provide any persistent resources. It is designed to fetch and transform web content on demand.

Quick Start

  1. Clone this repository
  2. Install dependencies: npm install
  3. Build the server: npm run build

Usage

Run the server directly:

npm start

This will start the Fetch MCP server in stdio mode.

Integration with Desktop Applications

To integrate this server with a desktop application, add the following to your server configuration:

Using local installation

{
  "mcpServers": {
    "playwright-fetch": {
      "command": "node",
      "args": [
        "/path/to/your/dist/index.js"
      ],
      "enabled": true
    }
  }
}
{
  "mcpServers": {
    "playwright-fetch": {
      "command": "npx",
      "args": [
        "-y",
        "@kevinwatt/playwright-fetch-mcp"
      ],
      "enabled": true
    }
  }
}

Features

  • Uses Playwright to fetch web content, supporting modern websites and dynamic content
  • Supports custom headers in requests
  • Provides content in multiple formats: JSON, plain text, and Markdown
  • Uses JSDOM to parse HTML and extract text
  • Uses TurndownService to convert HTML to Markdown
  • Supports redirects, with a maximum of 3 redirect levels
  • Implements retry mechanism, with up to 2 retries
  • Automatically installs Chromium browser on package installation

Development

  • Run npm run dev to start the TypeScript compiler in watch mode
  • Use npm test to run the test suite

License

This project is licensed under the MIT License.

Quick Start

1

Clone the repository

git clone https://github.com/kevinwatt/playwright-fetch-mcp
2

Install dependencies

cd playwright-fetch-mcp
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerkevinwatt
Repoplaywright-fetch-mcp
LanguageTypeScript
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation