Metadata-Version: 2.4
Name: article-scraper-mcp
Version: 1.0.0
Summary: MCP server that fetches article data (title, text, author, date) from a URL using newspaper3k
Project-URL: Homepage, https://github.com/dmitriiweb/article-scraper-mcp
Project-URL: Documentation, https://github.com/dmitriiweb/article-scraper-mcp#readme
Project-URL: Repository, https://github.com/dmitriiweb/article-scraper-mcp
Project-URL: Issues, https://github.com/dmitriiweb/article-scraper-mcp/issues
Project-URL: Changelog, https://github.com/dmitriiweb/article-scraper-mcp/blob/main/CHANGELOG.md
Author-email: Dmitrii K <dmitriik@protonmail.com>
Maintainer-email: Dmitrii K <dmitriik@protonmail.com>
License: MIT
License-File: LICENSE
Keywords: article-extraction,mcp,model-context-protocol,news,newspaper3k,scraper
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content :: News/Diary
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.11
Requires-Dist: loguru>=0.7.2
Requires-Dist: lxml[html-clean]>=4.9.0
Requires-Dist: mcp[cli]>=1.2.0
Requires-Dist: newspaper3k>=0.2.8
Requires-Dist: requests>=2.32.3
Description-Content-Type: text/markdown

# 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:

```bash
uvx article-scraper-mcp
```

## Usage

Add to your MCP client configuration:

```json
{
  "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
