MCP server for searching and retrieving news via News API

MCP server for searching and retrieving news via News API

mcp-newsapi•bymatteoantoci

A Model Context Protocol server that exposes News API endpoints as MCP tools, allowing clients to search articles and fetch top headlines.

License: Not specified•Runtime: Awaiting documentation review•Category: search web

WHAT IT DOES

  • •Provides a search_articles tool that searches news articles using the News API Everything endpoint, with filters for keywords, sources, domains, dates, language and sorting.
  • •Provides a get_top_headlines tool that fetches top headlines filtered by keyword, sources, category, language and country.
  • •Returns status, total results and article details including source, author, title, description, URLs and published date.
  • •Surfaces meaningful error messages from the News API when a call fails, including the API error message and code when available.

BEST FOR

  • •Searching news content by keyword, source, domain and date range through an MCP client.
  • •Retrieving top headlines by category, language or country for a region or topic.
  • •Building news-aware agents that need programmatic, paginated access to news results.

ABOUT MCP-NEWSAPI

MCP server for searching and retrieving news via News API is cataloged as an MCP server attributed to matteoantoci. A Model Context Protocol server that exposes News API endpoints as MCP tools, allowing clients to search articles and fetch top headlines. It is categorized under search web. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP server for searching and retrieving news via News API are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How does the server authenticate with the News API?

It reads the News API key from the NEWSAPI_KEY environment variable, which must be set before running the server.

Can the server be extended with additional News API endpoints?

Yes; new tools can be added by creating a TypeScript file in src/tools, defining a Zod input schema, implementing a handler for the News API SDK, and registering the tool.

上游原版 README

在 GitHub 查看同一版本原文

README.md · ec14ccbc0e5c · 采集于 2026-11-13 11:19:43 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

MCP News API Server

A Model Context Protocol (MCP) server that exposes endpoints from the News API (https://newsapi.org) to search for and retrieve news articles. This server allows programmatic access to news data via the MCP protocol.

Prerequisites

  • Node.js (v18 or later recommended)
  • npm (comes with Node.js)
  • A News API key (get one from https://newsapi.org)
  • (Optional) MCP-compatible client or runner (e.g., VSCode extension, CLI)

Setup

  1. Clone the repository or ensure you are in the project directory.

  2. Install dependencies:

    npm install
    
  3. Build the server:

    npm run build
    

    This will create a build directory with the compiled JavaScript code.

  4. Set your News API Key: The server reads the API key from the NEWSAPI_KEY environment variable. Set this variable in your environment before running the server. Example (Bash/Zsh):

    export NEWSAPI_KEY="YOUR_API_KEY"
    

    Replace "YOUR_API_KEY" with your actual News API key.

Running the Server

  • Directly: Ensure the NEWSAPI_KEY environment variable is set, then run:

    node build/index.js
    

    or, if you have a start script:

    npm run start
    
  • Via MCP runner: Configure your MCP client to run the server using stdio transport. You will also need to configure the environment variable for the API key within your MCP runner's settings. Example MCP settings entry:

    "mcp-newsapi": {
      "transportType": "stdio",
      "command": "node",
      "args": [
        "/path/to/mcp-newsapi/build/index.js"
      ],
      "environment": {
        "NEWSAPI_KEY": "YOUR_API_KEY"
      }
      // ... other optional settings ...
    }
    

    Replace "YOUR_API_KEY" with your actual News API key.

Available Tools

The server exposes the following tools via MCP, corresponding to News API endpoints:

search_articles

  • Description: Searches for news articles using the News API "Everything" endpoint.
  • Input:
    • q (string, required): Keywords or phrases to search for in the article title and body.
    • sources (string, optional): A comma-separated string of identifiers for the news sources or blogs you want headlines from.
    • domains (string, optional): A comma-separated string of domains (e.g. bbc.co.uk, techcrunch.com) to search within.
    • excludeDomains (string, optional): A comma-separated string of domains (e.g. bbc.co.uk, techcrunch.com) to exclude from the search.
    • from (string, optional): A date and optional time for the oldest article allowed. Format: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS (e.g. 2024-01-01 or 2024-01-01T10:00:00).
    • to (string, optional): A date and optional time for the newest article allowed. Format: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS.
    • language (string, optional): The 2-letter ISO 639-1 code of the language you want to get headlines for. Possible options: ar, de, en, es, fr, he, it, nl, no, pt, ru, sv, ud, zh. Default: all languages returned.
    • sortBy (enum: 'relevancy', 'popularity', 'publishedAt', optional): The order to sort the articles in. Possible options: relevancy, popularity, publishedAt. Default: relevancy.
    • pageSize (integer, optional, default 100): The number of results to return per page (request). 20 is the default, 100 is the maximum.
    • page (integer, optional, default 1): Use this to page through the results if the total results found is greater than the pageSize.
  • Output:
    • An object containing status, totalResults, and an array of articles with details like source, author, title, description, URL, image URL, published date, and content.

get_top_headlines

  • Description: Fetches top news headlines using the News API "Top Headlines" endpoint.
  • Input:
    • q (string, optional): Keywords or phrases to search for in the article title and body.
    • sources (string, optional): A comma-separated string of identifiers for the news sources or blogs you want headlines from.
    • category (enum: 'business', 'entertainment', 'general', 'health', 'science', 'sports', 'technology', optional): The category you want to get headlines for. Possible options: business, entertainment, general, health, science, sports, technology.
    • language (string, optional): The 2-letter ISO 639-1 code of the language you want to get headlines for. Possible options: ar, de, en, es, fr, he, it, nl, no, pt, ru, sv, ud, zh. Default: all languages returned.
    • country (string, optional): The 2-letter ISO 3166-1 country code of the country you want to get headlines for. Possible options: ae, ar, at, au, be, bg, br, ca, ch, cn, co, cu, cz, de, eg, fr, gb, gr, hk, hu, id, ie, il, in, it, jp, kr, lt, lv, ma, mx, my, ng, nl, no, nz, ph, pl, pt, ro, rs, ru, sa, se, sg, si, sk, th, tr, tw, ua, us, ve, za. Default: all countries returned.
    • pageSize (integer, optional, default 100): The number of results to return per page (request). 20 is the default, 100 is the maximum.
    • page (integer, optional, default 1): Use this to page through the results if the total results found is greater than the pageSize.
  • Output:
    • An object containing status, totalResults, and an array of articles with details like source, author, title, description, URL, image URL, published date, and content.

Error Handling

The server attempts to provide meaningful error messages based on the News API response. If an API call fails, the tool will throw an error with details about the failure, including the News API error message and code if available.

Extending

To add more News API endpoints as tools, create a new TypeScript file in src/tools/, define its input schema using Zod, implement the handler function to call the News API SDK, and export the tool definition. Then, import and register the new tool in src/tools/index.ts.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP server for searching and retrieving news via News API from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-newsapi)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related search web MCP Servers

Alternative and complementary servers in the same category

View all in search web →

An MCP server that merges Google Search Console history with a live first-party crawl of your site to produce a prioritised, evidence-backed technical SEO audit inside Claude, complete with paste-ready fixes.

Repository stats unavailable
Search & Web Research

An MCP server that offers intelligent web search using OpenAI reasoning models, with support for fast iterations and deep research.

94
Search & Web Research