article-scraper-mcp

v1.0.0
article-scraper-mcp Checked 3 days ago Published 1 year ago

MCP server that fetches article data (title, text, author, date) from a URL using newspaper3k

A Model Context Protocol (MCP) server that fetches article data from URLs using newspaper3k. Fetches and parses a news article from the given URL.

Summary extracted from the README.

Article Scraper MCP

A Model Context Protocol (MCP) server that fetches article data from URLs using newspaper3k.

Features

  • Extract article title, text, author, and publication date
  • Robust error handling and URL validation
  • Structured data output
  • Built with FastMCP for easy integration

Installation

Install directly from PyPI:

uvx article-scraper-mcp

Usage

Add to your MCP client configuration:

{
  "mcpServers": {
    "article-scraper": {
      "command": "uvx",
      "args": ["article-scraper-mcp"]
    }
  }
}

API

fetch_article(url: str) -> dict[str, Any]

Fetches and parses a news article from the given URL.

Parameters:

  • url: The URL of the news article to fetch

Returns: A dictionary containing:

  • title: Article title
  • text: Article content text
  • author: Author name(s) (may be None)
  • date: Publication date in ISO format (may be None)

Raises:

  • ValueError: If URL is invalid or article cannot be parsed
  • requests.RequestException: If HTTP request fails

Requirements

  • Python 3.11+
  • newspaper3k
  • requests
  • loguru
  • mcp[cli]

License

MIT