# 📰 News MCP Server FastMCP-based MCP server that turns news feeds into **deduplicated, enriched clusters**. ## Quick start ```bash cd news-mcp source .venv/bin/activate pip install -r requirements.txt ./run.sh ``` Default SSE mount (FastMCP): - `http://127.0.0.1:8506/mcp/sse` Health: - `http://127.0.0.1:8506/health` ## What this server provides - Fetches from one or more configured news feeds (`NEWS_FEED_URL` / `NEWS_FEED_URLS`) - Deduplicates articles into clusters (v1 fuzzy title similarity) - Enriches clusters with Groq (topic/entities/sentiment/keywords) - Caches clusters + Groq fields in SQLite ## Tools (MCP) 1) `get_latest_events(topic, limit)` - `topic` is a coarse category: `crypto | macro | regulation | ai | other` 2) `get_events_for_entity(entity, limit)` - substring, case-insensitive match over extracted `entities` 3) `get_event_summary(event_id)` - Groq-written compressed narrative for a given `cluster_id` 4) `detect_emerging_topics(limit)` - derives “emerging” signals from recent cached clusters 5) `get_news_sentiment(entity, timeframe)` - aggregates sentiment around an entity from cached enriched clusters ## Configuration See `news-mcp/.env`. Key variables: - `GROQ_API_KEY`, `GROQ_MODEL`, `GROQ_DEBUG` - `NEWS_FEED_URL` (single feed fallback) - `NEWS_FEED_URLS` (comma-separated feed URLs; overrides `NEWS_FEED_URL`) - `NEWS_REFRESH_INTERVAL_SECONDS` (default 900) - `NEWS_BACKGROUND_REFRESH_ON_START` (default true) - `NEWS_BACKGROUND_REFRESH_ENABLED` (default true) - `NEWS_CLUSTERS_TTL_HOURS` - `GROQ_ENRICH_OTHER_ONLY` (default false; set true for cost control) ## mcporter examples (all news-mcp calls) Use your existing config path: ```bash CONFIG=/home/lucky/.openclaw/workspace/config/mcporter.json ``` Inspect server + tools: ```bash mcporter --config "$CONFIG" list news --schema ``` ### 1) Latest events ```bash mcporter --config "$CONFIG" call news.get_latest_events topic=crypto limit=10 mcporter --config "$CONFIG" call news.get_latest_events topic=macro limit=5 ``` ### 2) Events for an entity ```bash mcporter --config "$CONFIG" call news.get_events_for_entity entity=Bitcoin limit=10 mcporter --config "$CONFIG" call news.get_events_for_entity entity=ETH limit=10 mcporter --config "$CONFIG" call news.get_events_for_entity entity=ETF limit=10 ``` ### 3) Event summary (by cluster_id) ```bash # First fetch an event id mcporter --config "$CONFIG" call news.get_latest_events topic=crypto limit=1 # Then summarize it mcporter --config "$CONFIG" call news.get_event_summary event_id= ``` ### 4) Emerging topics ```bash mcporter --config "$CONFIG" call news.detect_emerging_topics limit=10 ``` ### 5) Sentiment for an entity ```bash mcporter --config "$CONFIG" call news.get_news_sentiment entity=Bitcoin timeframe=24h mcporter --config "$CONFIG" call news.get_news_sentiment entity=Ethereum timeframe=72h ```