News MCP Server
# š° News MCP Server
[](https://opensource.org/licenses/Apache-2.0)
[](https://www.typescriptlang.org/)
[](https://modelcontextprotocol.io/)
A smart news search MCP (Model Context Protocol) server with **automatic API switching** for reliable news fetching. Never worry about API limits again!
<a href="https://glama.ai/mcp/servers/@guangxiangdebizi/news-mcp">
<img width="380" height="200" src="https://glama.ai/mcp/servers/@guangxiangdebizi/news-mcp/badge" alt="News Server MCP server" />
</a>
## ⨠Features
- š **Smart API Switching**: Automatically switches between multiple news APIs when one reaches its limit
- š **Multiple Free APIs**: Supports 5+ free news APIs with generous daily quotas
- š **Quota Management**: Intelligent tracking of daily API usage limits
- š **Multi-language Support**: Search news in 20+ languages
- ā” **Fast & Reliable**: Failover mechanism ensures you always get results
- š ļø **Easy Setup**: Simple configuration with environment variables
## š Quick Start
### 1. Installation
```bash
# Clone the repository
git clone https://github.com/guangxiangdebizi/news-mcp.git
cd news-mcp
# Install dependencies
npm install
# Copy environment template
cp .env.example .env
```
### 2. API Configuration
Get free API keys from any of these services (you only need one, but more = better reliability):
| Service | Daily Limit | Sign Up Link | Priority |
|---------|-------------|--------------|----------|
| **TheNewsAPI** | Unlimited* | [Get Key](https://www.thenewsapi.com/) | š„ Highest |
| **NewsData.io** | ~200 requests | [Get Key](https://newsdata.io/) | š„ High |
| **NewsAPI.org** | 100 requests | [Get Key](https://newsapi.org/register) | š„ Medium |
| **GNews** | 100 requests | [Get Key](https://gnews.io/) | š
Medium |
| **Twingly** | Trial available | [Get Key](https://www.twingly.com/news-api/) | šļø Low |
*\*Claimed unlimited for free tier*
### 3. Configure Environment
Edit `.env` file and add your API keys:
```env
# Add at least one API key (more is better for reliability)
THE_NEWS_API_KEY=your_api_key_here
NEWSDATA_IO_KEY=your_api_key_here
NEWSAPI_ORG_KEY=your_api_key_here
GNEWS_API_KEY=your_api_key_here
TWINGLY_API_KEY=your_api_key_here
```
### 4. Build & Run
```bash
# Build the project
npm run build
# Start the MCP server
npm start
# Or run in development mode
npm run dev
```
## š§ Usage
### With Claude Desktop
Add to your Claude Desktop configuration:
**Stdio Mode** (Local Development):
```json
{
"mcpServers": {
"news-mcp": {
"command": "node",
"args": ["path/to/news-mcp/build/index.js"]
}
}
}
```
**SSE Mode** (Web Access):
```bash
# Start SSE server
npm run sse
```
```json
{
"mcpServers": {
"news-mcp": {
"type": "sse",
"url": "http://localhost:3100/sse",
"timeout": 600
}
}
}
```
### Available Tools
#### `search_news`
Search for news articles with automatic API switching.
**Parameters:**
- `query` (required): Search keywords or topics
- `language` (optional): Language code (default: "en")
- `limit` (optional): Number of articles (1-10, default: 5)
**Example:**
```typescript
// Search for technology news
{
"query": "artificial intelligence",
"language": "en",
"limit": 5
}
// Search for Chinese news
{
"query": "ē§ęę°é»",
"language": "zh",
"limit": 3
}
```
## š§ How Smart Switching Works
1. **Priority Order**: APIs are tried in order of reliability and quota limits
2. **Quota Tracking**: System tracks daily usage for each API
3. **Automatic Failover**: When an API fails or reaches limit, automatically tries the next one
4. **Success Guarantee**: Continues until successful response or all APIs exhausted
```
TheNewsAPI (ā) ā NewsData.io (200) ā NewsAPI.org (100) ā GNews (100) ā Twingly (50)
```
## š Supported Languages
- **English** (en) - All APIs
- **Chinese** (zh) - Most APIs
- **Spanish** (es) - Most APIs
- **French** (fr) - Most APIs
- **German** (de) - Most APIs
- **And 15+ more languages**
## š ļø Development
### Project Structure
```
src/
āāā index.ts # MCP server entry point
āāā config.ts # API configuration management
āāā tools/
āāā newsSearch.ts # Smart news search tool
```
### Scripts
```bash
npm run build # Build TypeScript
npm run dev # Development mode with watch
npm start # Start built server
npm run sse # Start SSE server on port 3100
```
### Adding New APIs
1. Add API configuration to `src/config.ts`
2. Implement API-specific request logic in `src/tools/newsSearch.ts`
3. Add environment variable to `.env.example`
## š¤ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
## š License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
## šØāš» Author
**Xingyu Chen**
- š Website: [GitHub Profile](https://github.com/guangxiangdebizi/)
- š§ Email: guangxiangdebizi@gmail.com
- š¼ LinkedIn: [Xingyu Chen](https://www.linkedin.com/in/xingyu-chen-b5b3b0313/)
- š¦ NPM: [@xingyuchen](https://www.npmjs.com/~xingyuchen)
## š Acknowledgments
- [Model Context Protocol](https://modelcontextprotocol.io/) for the amazing MCP framework
- All the news API providers for their generous free tiers
- The open-source community for inspiration and support
---
**ā If this project helped you, please give it a star!**TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined as searching for news articles, and no other tools exist to cause confusion.
A single tool inherently has perfect naming consistency, as there are no other tools to compare against. The tool name 'search_news' follows a clear verb_noun pattern, which is appropriate for its function.
A single tool is too few for a server named 'News MCP Server', which implies a broader scope for news-related operations. While the tool is well-described, the server lacks basic operations like fetching headlines, categories, or article details, making it feel incomplete and under-scoped.
The server is severely incomplete for a news domain. It only provides search functionality, missing essential operations such as retrieving top headlines, filtering by category or source, or accessing full article content. This will likely cause agent failures when trying to perform common news-related tasks.