Skip to main content
Glama
NimbleBrainInc

NewsAPI MCP Server

NewsAPI MCP Server

mpak NimbleBrain Discord License: MIT

A Model Context Protocol (MCP) server that provides news search and headline retrieval using NewsAPI. Get top headlines by country and category, or search articles across thousands of sources.

View on mpak registry | Built by NimbleBrain

Install

Install with mpak:

mpak install @nimblebraininc/newsapi

Configuration

Get your API key from NewsAPI, then configure:

mpak config set @nimblebraininc/newsapi api_key YOUR_API_KEY

Claude Code

claude mcp add newsapi -- mpak run @nimblebraininc/newsapi

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "newsapi": {
      "command": "mpak",
      "args": ["run", "@nimblebraininc/newsapi"]
    }
  }
}

See the mpak registry page for full install options.

Related MCP server: News API MCP Server

Tools

get_top_headlines

Get top news headlines by country and category.

Parameter

Type

Required

Description

query

string

No

Keywords to search in article headlines

country

string

No

2-letter country code (default: "us")

category

string

No

One of: "business", "entertainment", "general", "health", "science", "sports", "technology"

page_size

integer

No

Number of results, max 100 (default: 10)

Example call:

{
  "name": "get_top_headlines",
  "arguments": {
    "country": "us",
    "category": "technology",
    "page_size": 5
  }
}

Example response:

{
  "articles": [
    {
      "title": "New AI breakthrough announced",
      "description": "Researchers have developed a new approach...",
      "url": "https://example.com/article",
      "source": "TechCrunch",
      "author": "Jane Smith",
      "published_at": "2026-02-13T10:00:00Z"
    }
  ],
  "total_results": 5
}

search_news

Search news articles across all sources. Note: Only returns articles from the last 30 days (NewsAPI free tier limitation).

Parameter

Type

Required

Description

query

string

Yes

Search keywords or phrase

sources

string

No

Comma-separated source IDs (e.g. "bbc-news,cnn")

domains

string

No

Comma-separated domains (e.g. "bbc.co.uk,techcrunch.com")

from_date

string

No

Oldest article date, ISO 8601 (e.g. "2026-01-01")

to_date

string

No

Newest article date, ISO 8601 (e.g. "2026-01-31")

language

string

No

2-letter language code (default: "en")

sort_by

string

No

"relevancy", "popularity", or "publishedAt" (default: "publishedAt")

page_size

integer

No

Number of results, max 100 (default: 10)

Example call:

{
  "name": "search_news",
  "arguments": {
    "query": "artificial intelligence",
    "sort_by": "relevancy",
    "page_size": 5
  }
}

Example response:

{
  "query": "artificial intelligence",
  "articles": [
    {
      "title": "The State of AI in 2026",
      "description": "A comprehensive look at how AI has evolved...",
      "url": "https://example.com/ai-2026",
      "source": "Wired",
      "author": "John Doe",
      "published_at": "2026-02-10T14:30:00Z",
      "content": "First 200 characters of the article content..."
    }
  ],
  "total_results": 127
}

Quick Start

Local Development

git clone https://github.com/NimbleBrainInc/mcp-newsapi.git
cd mcp-newsapi

# Install dependencies
uv sync

# Set API key
cp .env.example .env
# Edit .env with your API key

# Run the server (stdio mode)
uv run python -m mcp_newsapi.server

The server supports HTTP transport with:

  • Health check: GET /health

  • MCP endpoint: POST /mcp

Development

# Install with dev dependencies
uv sync --group dev

# Run all checks (format, lint, typecheck, unit tests)
make check

# Run unit tests
make test

# Run with coverage
make test-cov

About

NewsAPI MCP Server is published on the mpak registry and built by NimbleBrain. mpak is an open registry for Model Context Protocol servers.

License

MIT

Available Tools

2 tools
get_top_headlinesGet Top HeadlinesA

Get top news headlines by country and category.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryNoKeywords to search in article headlines.
countryNo2-letter ISO 3166-1 country code (default: "us").us
categoryNoNews category: "business", "entertainment", "general", "health", "science", "sports", or "technology".
page_sizeNoNumber of results to return (default: 10, max: 100).

Output Schema

ParametersJSON Schema
NameRequiredDescription
queryNoThe search query (if provided)
countryYesCountry code used for the request
articlesNoTop headline articles
categoryNoCategory filter (if provided)
total_resultsNoTotal number of results available

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It does not mention that this is a read-only operation, any rate limits, pagination behavior, or what the response format looks like. The description simply restates the name's meaning without adding any behavioral context beyond the obvious.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that front-loads the core purpose. There is zero redundancy or fluff. Every word earns its place, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple with only four parameters, all documented in the schema, and an output schema exists to describe the return structure. The description covers the essential purpose and filters. While it does not mention optional parameters like query, the schema already does. For this low-complexity tool, the description is sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all four parameters (query, country, category, page_size) have descriptions in the schema. The tool description adds no additional parameter context, such as relationships or usage hints. Given the high schema coverage, the baseline of 3 is appropriate; the description does not need to compensate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves top news headlines, specifying the two primary filters (country and category). This distinguishes it from the sibling 'search_news', which implies a different use case (searching for specific articles rather than aggregated headlines). The verb 'get' and resource 'top news headlines' are specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when one wants top headlines by country/category, but it does not explicitly contrast with search_news or state when to prefer one over the other. No exclusions or alternative routing are mentioned, leaving the agent to infer from the tool's name and description. This is adequate but not explicit guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_newsSearch NewsA

Search news articles from the past 30 days.

Note: The free tier of NewsAPI only returns articles from the last 30 days.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch keywords or phrase (required).
domainsNoComma-separated domains to restrict search (e.g. "bbc.co.uk,techcrunch.com").
sort_byNoSort order: "relevancy", "popularity", or "publishedAt" (default: "publishedAt").publishedAt
sourcesNoComma-separated source IDs (e.g. "bbc-news,cnn").
to_dateNoNewest article date in ISO 8601 format (e.g. "2025-01-31").
languageNo2-letter ISO 639-1 language code (default: "en").en
from_dateNoOldest article date in ISO 8601 format (e.g. "2025-01-01").
page_sizeNoNumber of results to return (default: 10, max: 100).

Output Schema

ParametersJSON Schema
NameRequiredDescription
queryYesThe search query
articlesNoMatching news articles
total_resultsNoTotal number of results available

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the burden of behavioral disclosure. It adds a key constraint: the free tier only returns articles from the last 30 days, which is not in the schema. However, it does not mention rate limits, pagination, or other potential behaviors, so it is only partially transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loading the primary purpose and adding a note as a separate clause. It is concise, clear, and contains no redundant information. Every sentence contributes value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (8 parameters, output schema present, no annotations), the description is adequate but not rich. It covers the core function and a key limitation, but it would benefit from explicitly distinguishing when to use this tool versus the sibling get_top_headlines. The output schema covers return values, so that gap is acceptable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All 8 parameters have schema descriptions, providing 100% coverage. The tool description adds no additional parameter-level semantics beyond what the schema already states. The 30-day note is a global constraint, not parameter-specific. Since the schema is complete, a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('search') and resource ('news articles') with a clear time constraint (past 30 days). This distinguishes it from the sibling tool get_top_headlines, which is about current headlines. The purpose is unambiguous and directly actionable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly mention when to use this tool versus the sibling get_top_headlines. It implies a search over past articles, but there is no explicit comparison, exclusion, or alternative routing. The only guidance is the free-tier limitation, which is a behavioral note rather than usage guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv0.1.2
    • First observedget_top_headlines
    • First observedsearch_news

TDQS

A3.9/5.0

Scored across 2 tools

Disambiguation5/5

get_top_headlines and search_news serve clearly distinct purposes: browsing headlines by country/category versus searching articles by keyword. There is no meaningful overlap between the two tools.

Naming Consistency5/5

Both tool names follow a clean verb_noun pattern: get_top_headlines and search_news. The naming style is consistent and immediately indicates the action and resource.

Tool Count4/5

Two tools is minimal but reasonable for the NewsAPI's main headline and search endpoints. It is slightly under the typical 3-15 tool range, but the scope is narrow enough that the count feels sensible.

Completeness4/5

The tool set covers the two core NewsAPI workflows: top headlines and article search. A notable minor gap is the missing sources endpoint, but agents can still accomplish the primary news retrieval tasks without it.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables searching news articles and retrieving top headlines from the GNews API with support for filtering by topic, language, and country.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to search news articles, get top headlines, and browse sources via the NewsAPI.org service.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables searching news, fetching top headlines, listing sources, and generating tech briefings via NewsAPI, with an optional browser frontend.
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables fetching top headlines and searching news archives from NewsAPI.org, allowing AI agents to access current and historical news data.
    539 npm
    MIT