Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

article_scraper_mcp-1.0.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

article_scraper_mcp-1.0.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file article_scraper_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: article_scraper_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.16

File hashes

Hashes for article_scraper_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8472faf8b417bb922458b1fb0b68f5c488b476ab932092227656c38a744d37ef
MD5 2da083cc93e0beb282dd5bfed9260d7e
BLAKE2b-256 30f1d87ac63cc6e0b433a5d5c062cef230cf07f55b637d1ad6eaa1b9d0c384aa

See more details on using hashes here.

File details

Details for the file article_scraper_mcp-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for article_scraper_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a5eb3fb01b6a8eaf8aa24604ed34de973768012a1aab9227f20542b73e5d87b
MD5 d7ba52be1cf3632eadbdb9bf2be07015
BLAKE2b-256 4c327b43817cf157701438f0815339c755182690a3f05a9be1ccb9ae98b6ac64

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page