MCP RSS News Agent
A FastMCP-based RSS news aggregation and processing agent that can discover, fetch, and summarize content from various RSS feeds.
Features
- Discover RSS feeds from any website
- Fetch entries from RSS feeds
- Extract and format content from feed entries
- Extract and process web content from any URL
- Search news articles by keyword
- Generate summaries for news articles
- Get top news by category and country
Installation
- Clone the repository
- Install the required dependencies:
pip install -r requirements.txt
- Create a
.env file if you need environment variables (optional)
Usage
Start the MCP Server
This will start the MCP server that exposes various RSS-related tools.
Available Tools
- get_rss_feed_entries: Fetches entries from an RSS feed URL
- discover_rss_feeds: Finds RSS feeds available on a website
- download_feed_content: Downloads and processes the content of a feed entry
- fetch_webpage: Extracts main content from any webpage URL using advanced techniques (NEW)
- search_news_by_keyword: Searches news articles across multiple feeds using a keyword
- create_news_summary: Creates summaries for news articles
- get_top_news_from_category: Gets top news from specific categories and countries
Examples
Discover RSS Feeds on a Website
response = mcp.invoke("discover_rss_feeds", {"website_url": "https://www.theguardian.com"})
print(f"Found {response['feeds_count']} feeds")
for feed in response['feeds']:
print(f"- {feed['title']}: {feed['url']}")
Get News Articles by Keyword
response = mcp.invoke("search_news_by_keyword", {
"keyword": "climate change",
"max_results": 5
})
for article in response['results']:
print(f"- {article['title']} ({article['source']})")
print(f" Link: {article['link']}")
print()
Extract Content from Any Webpage
response = mcp.invoke("fetch_webpage", {
"url": "https://example.com/article",
"output_format": "markdown",
"include_images": True
})
print(f"Title: {response['title']}")
print(f"Extraction method: {response['extracted_by']}")
print(f"Content preview: {response['content'][:200]}...")
Get Top News from a Category
response = mcp.invoke("get_top_news_from_category", {
"category": "technology",
"country": "us",
"max_results": 3
})
for article in response['results']:
print(f"- {article['title']} ({article['source']})")
Client Example
The project includes a command-line client (client_example.py) that provides easy access to all the MCP server tools:
# Get feed entries
python client_example.py feed https://www.theguardian.com/international/rss
# Search news by keyword
python client_example.py search "artificial intelligence"
# Extract content from a webpage with advanced extraction
python client_example.py webpage https://example.com/article --format markdown --images --save
# Get news by category
python client_example.py category technology --country us
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.