AllNewsAPI MCP
Enables LLMs to search for news articles, get top headlines, and access comprehensive news data with advanced filtering options through AllNewsAPI.
README
AllNewsAPI MCP
A Model Context Protocol (MCP) server that provides news data capabilities using AllNewsAPI. This server enables LLMs to search for news articles, get top headlines, and access comprehensive news data with advanced filtering options.
Key Features
- Comprehensive news search. Access news articles with advanced filtering by date, language, country, category, and more.
- Real-time headlines. Get the latest top headlines from around the world with customizable parameters.
- LLM-optimized responses. Clean, formatted output designed for easy consumption by language models.
Requirements
- Node.js 18 or newer
- AllNewsAPI key (get one at allnewsapi.com)
- VS Code, Cursor, Windsurf, Claude Desktop, or any other MCP client
Getting started
First, get your API key from AllNewsAPI and install the AllNewsAPI MCP server with your client.
Standard config works in most of the tools:
{
"mcpServers": {
"allnewsapi": {
"command": "npx",
"args": [
"allnewsapi-mcp@latest",
"--apikey",
"YOUR_API_KEY_HERE"
]
}
}
}
<details> <summary>Claude Desktop</summary>
Follow the MCP install guide, use the standard config above, or configure with environment variable:
{
"mcpServers": {
"allnewsapi": {
"command": "npx",
"args": ["allnewsapi-mcp@latest"],
"env": {
"ALLNEWSAPI_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
</details>
<details> <summary>Cursor</summary>
Go to Cursor Settings -> MCP -> Add new MCP Server. Name it "AllNewsAPI", use command type with the command npx allnewsapi-mcp@latest --apikey YOUR_API_KEY_HERE. You can also verify config or add command arguments via clicking Edit.
</details>
<details> <summary>VS Code</summary>
Follow the MCP install guide, use the standard config above. You can also install the AllNewsAPI MCP server using the VS Code CLI:
# For VS Code
code --add-mcp '{"name":"allnewsapi","command":"npx","args":["allnewsapi-mcp@latest","--apikey","YOUR_API_KEY_HERE"]}'
After installation, the AllNewsAPI MCP server will be available for use with your GitHub Copilot agent in VS Code.
</details>
<details> <summary>Windsurf</summary>
Follow Windsurf MCP documentation. Use the standard config above.
</details>
Configuration
The AllNewsAPI MCP server supports the following configuration options:
API Key Configuration
You can provide your AllNewsAPI key in two ways:
- Command-line argument (recommended for most setups):
npx allnewsapi-mcp@latest --apikey YOUR_API_KEY_HERE
- Environment variable:
export ALLNEWSAPI_KEY=YOUR_API_KEY_HERE
npx allnewsapi-mcp@latest
Local Installation
If you want to install and run the server locally:
# Clone the repository
git clone https://github.com/AllNewsAPI/mcp-server.git
cd mcp-server
# Install dependencies
npm install
# Build the project
npm run build
# Run the server
node build/index.js --apikey YOUR_API_KEY_HERE
Tools
<details> <summary><b>News search and headlines</b></summary>
-
search-news
- Title: Search news articles
- Description: Search for news articles using various parameters including keywords, date ranges, and filters
- Parameters:
q(string, optional): Keywords to search for in news articlesstartDate(string, optional): Filter articles published on or after this date (YYYY-MM-DD format)endDate(string, optional): Filter articles published on or before this date (YYYY-MM-DD format)content(boolean, optional): Whether to retrieve full article content (default: false)lang(string, optional): Language code(s) of the articles (e.g., 'en', 'fr', 'de')country(string, optional): Country code(s) of publication (e.g., 'us', 'gb', 'ca')region(string, optional): Region(s) to filter by (e.g., 'americas', 'europe', 'asia')category(string, optional): Category/categories to filter by (e.g., 'business', 'technology', 'sports')max(number, optional): Number of articles to return, 1-100 (default: 5)attributes(string, optional): Where to search for keywords: 'title', 'description', 'content' (default: 'title,description')page(number, optional): Page number for pagination (default: 1)sortby(string, optional): Sort results by 'publishedAt' or 'relevance' (default: 'publishedAt')publisher(string, optional): Filter by specific publisher(s)
- Read-only: true
-
headlines
- Title: Get top headlines
- Description: Get top headlines with optional filtering by country, category, and language
- Parameters:
country(string, optional): Country code(s) of publication (e.g., 'us', 'gb', 'ca')category(string, optional): Category to filter by (e.g., 'business', 'technology', 'sports')max(number, optional): Number of articles to return, 1-100 (default: 5)lang(string, optional): Language code of the articles (e.g., 'en', 'fr', 'de')
- Read-only: true
</details>
Supported Parameters
<details> <summary><b>Languages</b></summary>
The following language codes are supported:
ar, zh, nl, en, fr, de, el, he, hi, it, ja, ml, mr, no, pt, ro, ru, es, sv, ta, te, uk
</details>
<details> <summary><b>Categories</b></summary>
The following categories are supported:
adult, autos, beauty, business, communities, crime, cryptocurrency, electronics, entertainment, finance, food, games, health, hobbies, lifestyle, internet, jobs, law, literature, pets, politics, realty, science, sensitive, shopping, society, sports, technology, travel
</details>
<details> <summary><b>Regions</b></summary>
The following regions are supported:
africa, americas, antarctic, asia, europe, oceania
</details>
<details> <summary><b>Countries</b></summary>
The API supports numerous country codes including:
us(United States)gb(United Kingdom)ca(Canada)au(Australia)de(Germany)fr(France)jp(Japan)in(India)- And many more...
The server validates all country codes against the official list from AllNewsAPI.
</details>
Example Usage
Once you have connected your MCP client to the AllNewsAPI server, you can ask natural language queries like:
- "Get me the latest technology news from the US"
- "Find news articles about climate change from European sources"
- "Show me top business headlines from the past week"
- "Search for cryptocurrency news in English from the last month"
- "Get sports headlines from Canada and Australia"
The server will validate all parameters, connect to the AllNewsAPI, and return formatted results that are easy to read and understand.
Error Handling
The server includes comprehensive error handling:
- API Key validation: Clear error messages if no API key is provided
- Parameter validation: All parameters are validated against official AllNewsAPI supported values
- Network error handling: Graceful handling of API connection issues
- Rate limit handling: Proper error messages for API rate limits
Technical Implementation
The server is built with TypeScript and the Model Context Protocol SDK. Key features include:
- ES module support with top-level await
- Comprehensive error handling with informative messages
- Parameter validation against official supported values
- Clean formatting of API responses for LLM consumption
- Flexible configuration supporting multiple API key methods
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.