さまざまな RSS フィードからコンテンツを検出、取得、要約できる FastMCP ベースの RSS ニュース集約および処理エージェント。
特徴
- あらゆるウェブサイトからRSSフィードを見つける
- RSSフィードからエントリを取得する
- フィードエントリからコンテンツを抽出してフォーマットする
- 任意の URL から Web コンテンツを抽出して処理します
- キーワードでニュース記事を検索
- ニュース記事の要約を生成する
- カテゴリーと国別にトップニュースを入手
インストール
- リポジトリをクローンする
- 必要な依存関係をインストールします。
pip install -r requirements.txt
- 環境変数が必要な場合は
.env
ファイルを作成します(オプション)
使用法
MCPサーバーを起動する
これにより、さまざまな RSS 関連ツールを公開する MCP サーバーが起動します。
利用可能なツール
- get_rss_feed_entries : RSSフィードURLからエントリを取得します
- discover_rss_feeds : ウェブサイトで利用可能なRSSフィードを検索します
- download_feed_content : フィードエントリのコンテンツをダウンロードして処理します
- fetch_webpage : 高度な技術を使用して任意の Web ページ URL からメイン コンテンツを抽出します (新機能)
- search_news_by_keyword : キーワードを使用して複数のフィードにわたるニュース記事を検索します
- create_news_summary : ニュース記事の要約を作成します
- get_top_news_from_category : 特定のカテゴリと国からのトップニュースを取得します
例
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']}")
キーワードでニュース記事を取得する
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()
あらゆるウェブページからコンテンツを抽出
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]}...")
カテゴリからトップニュースを取得する
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']})")
クライアントの例
このプロジェクトには、すべての MCP サーバー ツールに簡単にアクセスできるコマンドライン クライアント ( client_example.py
) が含まれています。
# 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
貢献
貢献を歓迎します!お気軽にプルリクエストを送信してください。
ライセンス
このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。