mcp-newsapi

v1.0.2
io.github.nubiia-dev/mcp-newsapi Checked 3 days ago Published 1 month ago

NewsAPI.ai (Event Registry): 10 read-only MCP tools for news articles, events, autosuggest, trends

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

search_articles

Search news articles (NewsAPI.ai / Event Registry). Cost: 1 token per call (measured live) when limited to the last 31 days (the default); querying the historical archive (allow_archive=true) costs extra tokens per year touched. At least one of keyword / concept_uris / category_uris / source_uris / location_uris is required. Prefer concept_uris (from suggest_concepts, which is free) over free-text keyword for any company, person, place or organisation: keyword is for free terms/topics and is noisy with common words (e.g. "Telefónica" also matches the Spanish adjective "telefónica"), so resol…

ParameterTypeDescription
allow_archivebooleanDefault false: search only the last 31 days (cheapest). Set true to reach the historical archive, which costs extra tokens per year queried; requires date_start and a range of at most 1 year.
body_lenintegerMax body characters per article, 0-5000 (default 300; 0 = no body).
category_urisCategory URIs, e.g. "news/Business" (use suggest_categories). OR-ed. Accepts a single string or an array of strings.
concept_urisConcept URIs for entities: companies, people, places, organisations. PREFERRED over keyword for any named entity: first call suggest_concepts (free) to resolve the name, then pass the returned `uri` h…
countintegerArticles per page, 1-100 (default 10). Keep small to save context.
data_typesContent types to include (default: all). Accepts a single string or an array of strings.
date_endstringLatest date, YYYY-MM-DD (inclusive); must be >= date_start. With allow_archive the date_start → date_end (default today) span may be at most 1 year.
date_startstringEarliest date, YYYY-MM-DD (inclusive). Must be within the last 31 days unless allow_archive=true, which makes date_start mandatory.
ignore_keywordstringExclude articles mentioning this.
ignore_source_urisExclude these news sources. Accepts a single string or an array of strings.
include_duplicatesbooleanInclude duplicate/syndicated articles (default false).
keywordstringFree-text keyword or phrase, for topics and general terms (e.g. "inflation", "wildfire"). Do NOT use it for companies, people, places or organisations: common words double as names (e.g. "Telefónica"…
keyword_locstringWhere to look for the keyword (default: the API default, body).
keyword_search_modestringHow to match the keyword: simple (any word), exact, or phrase.
lang3-letter ISO 639-3 language codes, e.g. "spa" or ["eng", "spa"]. OR-ed. Accepts a single string or an array of strings.
location_urisLocation URIs where the news happened (use suggest_locations). OR-ed. Accepts a single string or an array of strings.
max_sentimentnumberMaximum sentiment, -1 to 1 (English articles only).
min_sentimentnumberMinimum sentiment, -1 to 1 (English articles only).
pageintegerResult page, starting at 1 (default 1).
sort_ascbooleanAscending order (default false).
sort_bystringSort order (default date). "rel" ranks by relevance to the query.
source_urisNews source URIs, e.g. "bbc.co.uk" (use suggest_sources). OR-ed. Accepts a single string or an array of strings.

get_article

Get one article by its URI (the `uri` returned by search_articles), with a longer body (body_len, default 3000 chars). Cost: 1 token per call. Use after search_articles when you need to read the article rather than just its headline.

ParameterTypeDescription
article_uri *stringArticle URI as returned by search_articles (e.g. "8512345678").
body_lenintegerMax body characters, 0-20000 (default 3000).

search_events

Search news EVENTS: clusters of articles about the same real-world happening, with a title, summary, date, location, key concepts and article count. Best for "what is happening with X" — one event replaces dozens of near-duplicate articles. Cost: 5 tokens (measured live) per call within the last 31 days (default); allow_archive=true costs extra per year touched. At least one of keyword / concept_uris / category_uris / source_uris / location_uris is required. Defaults to 10 events, newest first; use sort_by="size" for the biggest stories. Use get_event for details on one. For companies, peopl…

ParameterTypeDescription
allow_archivebooleanDefault false: search only the last 31 days (cheapest). Set true to reach the historical archive, which costs extra tokens per year queried; requires date_start and a range of at most 1 year.
category_urisCategory URIs, e.g. "news/Business" (use suggest_categories). OR-ed. Accepts a single string or an array of strings.
concept_urisConcept URIs for entities: companies, people, places, organisations. PREFERRED over keyword for any named entity: first call suggest_concepts (free) to resolve the name, then pass the returned `uri` h…
countintegerEvents per page, 1-50 (default 10).
date_endstringLatest date, YYYY-MM-DD (inclusive); must be >= date_start. With allow_archive the date_start → date_end (default today) span may be at most 1 year.
date_startstringEarliest date, YYYY-MM-DD (inclusive). Must be within the last 31 days unless allow_archive=true, which makes date_start mandatory.
keywordstringFree-text keyword or phrase, for topics and general terms (e.g. "inflation", "wildfire"). Do NOT use it for companies, people, places or organisations: common words double as names (e.g. "Telefónica"…
lang3-letter ISO 639-3 language codes, e.g. "spa" or ["eng", "spa"]. OR-ed. Accepts a single string or an array of strings.
location_urisLocation URIs where the news happened (use suggest_locations). OR-ed. Accepts a single string or an array of strings.
min_articles_in_eventintegerOnly events covered by at least this many articles (filters noise).
pageintegerResult page, starting at 1 (default 1).
sort_ascbooleanAscending order (default false).
sort_bystringSort order (default date). "size" = most articles first.
source_urisNews source URIs, e.g. "bbc.co.uk" (use suggest_sources). OR-ed. Accepts a single string or an array of strings.
summary_lenintegerMax summary characters per event, 0-2000 (default 300).

get_event

Get one event by URI (the `uri` from search_events, e.g. "eng-1234567"). Returns its summary info by default; set include_articles=true to instead list the articles covering it (paginated, default 5 per page, body truncated to body_len). Cost: 5 tokens (info view) or 1 (articles view), measured live.

ParameterTypeDescription
event_uri *stringEvent URI, e.g. "eng-1234567".
articles_countintegerArticles per page when include_articles=true, 1-50 (default 5).
articles_pageintegerArticles page, from 1 (default 1).
body_lenintegerMax body characters per article, 0-5000 (default 300).
include_articlesbooleanReturn the event’s articles instead of its info (default false).

suggest_concepts

Resolve a name to concept URIs (people, organisations, places, Wikipedia topics). Pass the returned `uri` as concept_uris to search_articles / search_events — much more precise than a keyword. Does not consume search tokens. Sorted by prominence in the news; check `type` and `label` to pick the right homonym.

ParameterTypeDescription
prefix *stringText typed so far (a name or the start of one), e.g. "Telef" or "bbc".
countintegerMax suggestions, 1-50 (default 10).
langstringLanguage of the prefix, ISO 639-3 (default eng).
pageintegerResult page, from 1 (default 1).
typesRestrict to these concept kinds (default: all). Accepts a single string or an array of strings.

suggest_categories

Resolve a topic name to category URIs (e.g. "news/Business", "dmoz/Sports/Soccer"). Pass the `uri` as category_uris to search_articles / search_events. Does not consume search tokens.

ParameterTypeDescription
prefix *stringText typed so far (a name or the start of one), e.g. "Telef" or "bbc".
countintegerMax suggestions, 1-50 (default 10).
pageintegerResult page, from 1 (default 1).

suggest_sources

Resolve a publication name or domain to news source URIs (e.g. "bbc.co.uk"). Pass the `uri` as source_uris to search_articles / search_events. Does not consume search tokens.

ParameterTypeDescription
prefix *stringText typed so far (a name or the start of one), e.g. "Telef" or "bbc".
countintegerMax suggestions, 1-50 (default 10).
data_typesRestrict to sources of these content types (default: all). Accepts a single string or an array of strings.
pageintegerResult page, from 1 (default 1).

suggest_locations

Resolve a city or country name to a location URI. Pass the `uri` as location_uris to search_articles / search_events to find news that happened there. Does not consume search tokens.

ParameterTypeDescription
prefix *stringText typed so far (a name or the start of one), e.g. "Telef" or "bbc".
countintegerMax suggestions, 1-50 (default 10).
langstringLanguage of the prefix, ISO 639-3 (default eng).
pageintegerResult page, from 1 (default 1).

get_usage

Get the token budget of this NewsAPI.ai account: tokens available, used and remaining for the current period. Call it before a batch of searches (measured costs: search_articles and get_article 1 token, search_events and get_event info 5, get_trending_concepts 10). Free: does not consume tokens itself. Suggest tools are free too. Also reports this server’s session budget (NEWSAPI_AI_MAX_TOKENS_PER_SESSION, default 200): calls that would exceed it fail locally without reaching the API.