|
|
1 miesiąc temu | |
|---|---|---|
| config | 1 miesiąc temu | |
| news_mcp | 1 miesiąc temu | |
| prompts | 1 miesiąc temu | |
| scripts | 1 miesiąc temu | |
| .env.example | 1 miesiąc temu | |
| .gitignore | 1 miesiąc temu | |
| OUTLOOK.md | 1 miesiąc temu | |
| PROJECT.md | 1 miesiąc temu | |
| README.md | 1 miesiąc temu | |
| killserver.sh | 1 miesiąc temu | |
| live_tests.sh | 1 miesiąc temu | |
| requirements.txt | 1 miesiąc temu | |
| restart.sh | 1 miesiąc temu | |
| run.sh | 1 miesiąc temu | |
| test_embedding_support.py | 1 miesiąc temu | |
| test_news_mcp.py | 1 miesiąc temu | |
| tests.sh | 1 miesiąc temu |
FastMCP-based MCP server that turns news feeds into deduplicated, enriched clusters.
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/sseHealth:
http://127.0.0.1:8506/healthNEWS_FEED_URL / NEWS_FEED_URLS)1) get_latest_events(topic, limit, include_articles=false)
topic is a coarse category: crypto | macro | regulation | ai | otherinclude_articles=true, includes articles[].url + minimal fields per returned cluster2) get_events_for_entity(entity, limit, include_articles=false)
entitiesinclude_articles=true, includes articles[].url + minimal fields per returned cluster3) get_event_summary(event_id, include_articles=false)
cluster_idinclude_articles=true, includes the underlying articles list (with url) from the stored cluster4) detect_emerging_topics(limit)
5) get_news_sentiment(entity, timeframe)
6) get_related_entities(subject, timeframe, limit)
count, avg_importance, and sentimentThe server keeps a conservative alias map in config/entity_aliases.json for obvious shorthands
like btc -> Bitcoin, eth -> Ethereum, and ether -> Ethereum. Keep this map tight; it is meant
to reduce false misses, not to rewrite every possible name variant.
See news-mcp/.env.
Key variables:
NEWS_EXTRACT_PROVIDER, NEWS_EXTRACT_MODELNEWS_SUMMARY_PROVIDER, NEWS_SUMMARY_MODELGROQ_API_KEY, OPENAI_API_KEYENTITY_BLACKLIST (comma-separated, case-insensitive exact entity match)NEWS_PROMPTS_DIR (override prompt directory)NEWS_ENTITY_ALIASES_FILE (override entity alias JSON file)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_HOURSGROQ_ENRICH_OTHER_ONLY (default false; set true for cost control)Run a standardized, fabricated extraction test against the currently configured provider/model:
./live_tests.sh
The script reads ./.env, selects OpenAI or Groq based on the configured keys, and checks that the core expected entities are extracted.
Use your existing config path:
CONFIG=/home/lucky/.openclaw/workspace/config/mcporter.json
Inspect server + tools:
mcporter --config "$CONFIG" list news --schema
mcporter --config "$CONFIG" call news.get_latest_events topic=crypto limit=10
mcporter --config "$CONFIG" call news.get_latest_events topic=macro limit=5
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
# 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=<cluster_id>
mcporter --config "$CONFIG" call news.detect_emerging_topics limit=10
mcporter --config "$CONFIG" call news.get_news_sentiment entity=Bitcoin timeframe=24h
mcporter --config "$CONFIG" call news.get_news_sentiment entity=Ethereum timeframe=72h
mcporter --config "$CONFIG" call news.get_related_entities subject=iran timeframe=24h limit=8
mcporter --config "$CONFIG" call news.get_related_entities subject="iran war" timeframe=3d limit=8
If you change ENTITY_BLACKLIST, existing clusters in news.sqlite may still
contain entities/keywords that would now be filtered at extraction time.
For one-off cleanup, run:
./.venv/bin/python scripts/enforce_news_blacklist.py --dry-run --limit 200
./.venv/bin/python scripts/enforce_news_blacklist.py --limit 1000
This enforces ENTITY_BLACKLIST inside stored clusters by removing matching
entries from payload.entities and payload.keywords and (if needed) setting
payload.topic = "other".
```