SuperAPI AI Directory

fetch

General & other

View repository

Updated 10-15 17:17

About this skill

MCP Fetch Skill

This skill allows the Agent to use a Python script to call the fetch server of the Model Context Protocol (MCP) to scrape web page content. It is especially suitable for retrieving web page content and providing it as context to AI.

Core Features

  • Automated scraping: Automatically starts and connects to the @smithery/mcp-fetch server.
  • Content extraction: Able to retrieve text content from a specified URL.
  • No additional Python dependencies: Implemented using the Python standard library, with no need to install additional pip packages (only requires node/npx and python)。

Usage Instructions

  1. Determine the target URL: Identify the web address whose content the user needs to retrieve.
  2. Call the script: In the project root directory, run the following command in the terminal:
    python fetch/fetch.py "https://example.com"
    
  3. Process the output: The script will print the text of the web page content directly to standard output.

Technical Details

  • Communication protocol: Uses JSON-RPC 2.0 to communicate with the MCP server via standard input/output (stdio).
  • Server startup: Use npx -y @smithery/mcp-fetch to start the server.
  • Initialization process: The script sends the initialize request and processes the notifications/initialized notification to establish a connection compliant with the MCP specification.
  • Tool invocation: Call the tools/call method to invoke the fetch tool, supporting the maxLength and raw parameters (the script uses maxLength: 20000)。