Handles environment variable configuration for API keys and server settings through the .env file.
Integration point for cloning the repository and accessing source code for setup and deployment.
Used for package management and running the MCP server, with configuration available for the author's NPM account.
Provides badge integration for displaying license, language, and protocol version information in the README.
Core language used for implementation with version 5.3+ support highlighted in the project badges.
📰 News MCP Server
A smart news search MCP (Model Context Protocol) server with automatic API switching for reliable news fetching. Never worry about API limits again!
✨ 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
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 | 🥇 Highest |
NewsData.io | ~200 requests | Get Key | 🥈 High |
NewsAPI.org | 100 requests | Get Key | 🥉 Medium |
GNews | 100 requests | Get Key | 🏅 Medium |
Twingly | Trial available | Get Key | 🎖️ Low |
*Claimed unlimited for free tier
3. Configure Environment
Edit .env
file and add your API keys:
4. Build & Run
🔧 Usage
With Claude Desktop
Add to your Claude Desktop configuration:
Stdio Mode (Local Development):
SSE Mode (Web Access):
Available Tools
search_news
Search for news articles with automatic API switching.
Parameters:
query
(required): Search keywords or topicslanguage
(optional): Language code (default: "en")limit
(optional): Number of articles (1-10, default: 5)
Example:
🧠 How Smart Switching Works
- Priority Order: APIs are tried in order of reliability and quota limits
- Quota Tracking: System tracks daily usage for each API
- Automatic Failover: When an API fails or reaches limit, automatically tries the next one
- Success Guarantee: Continues until successful response or all APIs exhausted
📊 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
Scripts
Adding New APIs
- Add API configuration to
src/config.ts
- Implement API-specific request logic in
src/tools/newsSearch.ts
- Add environment variable to
.env.example
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
��� License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
👨💻 Author
Xingyu Chen
- 🌐 Website: GitHub Profile
- 📧 Email: guangxiangdebizi@gmail.com
- 💼 LinkedIn: Xingyu Chen
- 📦 NPM: @xingyuchen
🙏 Acknowledgments
- Model Context Protocol 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!
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
A smart news search server that automatically switches between multiple news APIs when one reaches its limit, enabling reliable searching across 20+ languages without worrying about API quotas.
Related MCP Servers
- AsecurityAlicenseAqualityThis server enables users to perform Google News searches with automatic categorization and multi-language support via SerpAPI integration.Last updated -151469JavaScriptMIT License
- AsecurityAlicenseAqualityA server that provides web scraping and intelligent content searching capabilities using the Firecrawl API, enabling AI agents to extract structured data from websites and perform content searches.Last updated -52TypeScriptMIT License
- AsecurityFlicenseAqualityA server providing access to news articles from various categories including tech, data science, cybersecurity, and more, allowing retrieval and summarization of latest content.Last updated -12Python
- AsecurityFlicenseAqualityProvides access to Naver Search APIs, allowing AI agents to search across multiple categories (blogs, news, books, images, shopping items, etc.) with structured responses optimized for LLM consumption.Last updated -133Python