NewsAPI MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@NewsAPI MCP Serverget top headlines for technology in the US"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
NewsAPI MCP Server
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/newsapiConfiguration
Get your API key from NewsAPI, then configure:
mpak config set @nimblebraininc/newsapi api_key YOUR_API_KEYClaude Code
claude mcp add newsapi -- mpak run @nimblebraininc/newsapiClaude 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 |
|
| No | Keywords to search in article headlines |
|
| No | 2-letter country code (default: |
|
| No | One of: |
|
| No | Number of results, max 100 (default: |
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 |
|
| Yes | Search keywords or phrase |
|
| No | Comma-separated source IDs (e.g. |
|
| No | Comma-separated domains (e.g. |
|
| No | Oldest article date, ISO 8601 (e.g. |
|
| No | Newest article date, ISO 8601 (e.g. |
|
| No | 2-letter language code (default: |
|
| No |
|
|
| No | Number of results, max 100 (default: |
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.serverThe server supports HTTP transport with:
Health check:
GET /healthMCP 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-covAbout
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 toolsget_top_headlinesGet Top HeadlinesA
Get top news headlines by country and category.
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Keywords to search in article headlines. | |
| country | No | 2-letter ISO 3166-1 country code (default: "us"). | us |
| category | No | News category: "business", "entertainment", "general", "health", "science", "sports", or "technology". | |
| page_size | No | Number of results to return (default: 10, max: 100). |
Output Schema
| Name | Required | Description |
|---|---|---|
| query | No | The search query (if provided) |
| country | Yes | Country code used for the request |
| articles | No | Top headline articles |
| category | No | Category filter (if provided) |
| total_results | No | Total number of results available |
TDQS
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.
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.
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.
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.
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.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search keywords or phrase (required). | |
| domains | No | Comma-separated domains to restrict search (e.g. "bbc.co.uk,techcrunch.com"). | |
| sort_by | No | Sort order: "relevancy", "popularity", or "publishedAt" (default: "publishedAt"). | publishedAt |
| sources | No | Comma-separated source IDs (e.g. "bbc-news,cnn"). | |
| to_date | No | Newest article date in ISO 8601 format (e.g. "2025-01-31"). | |
| language | No | 2-letter ISO 639-1 language code (default: "en"). | en |
| from_date | No | Oldest article date in ISO 8601 format (e.g. "2025-01-01"). | |
| page_size | No | Number of results to return (default: 10, max: 100). |
Output Schema
| Name | Required | Description |
|---|---|---|
| query | Yes | The search query |
| articles | No | Matching news articles |
| total_results | No | Total number of results available |
TDQS
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.
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.
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.
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.
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.
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.
2 tool updates
v0.1.2- First observed
get_top_headlines - First observed
search_news
TDQS
Scored across 2 tools
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.
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.
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.
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
Related MCP Connectors
Search global news in natural language. Filter by language, country, date, sentiment, and domain.
Get access to real-time and historical news data including top headlines from global sources
Google News headlines, sources, and links via the Apify Google News API, hosted MCP.
News search, article lookup, story coverage and save links for hamir's RSS catalogue
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables searching news articles and retrieving top headlines from the GNews API with support for filtering by topic, language, and country.-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to search news articles, get top headlines, and browse sources via the NewsAPI.org service.-
- FlicenseNot gradedqualityDmaintenanceEnables searching news, fetching top headlines, listing sources, and generating tech briefings via NewsAPI, with an optional browser frontend.-
- AlicenseNot gradedqualityBmaintenanceEnables fetching top headlines and searching news archives from NewsAPI.org, allowing AI agents to access current and historical news data.539 npmMIT