create new mcp server for news api
Description
Added a new MCP server for the News API that enables Claude to search and retrieve news articles. The server provides three main tools: news search, top headlines, and news sources.
Server Details
- Server: newsapi
- Changes to: New server implementation with three tools:
news_search: Search for news articles by keywords, date range, and filtersnews_top_headlines: Get top headlines by country, category, or sourcesnews_sources: Get available news sources with filtering options
Motivation and Context
This server enables LLMs to access real-time news data through the News API, allowing them to provide up-to-date information and news-related assistance to users. It's particularly useful for applications requiring current events awareness and news analysis capabilities.
How Has This Been Tested?
- Tested with Claude Desktop client
- Verified all three tools work as expected:
- News search with various query parameters
- Top headlines retrieval with different categories
- Source listing with filters
- Tested error handling for invalid API keys and rate limits
Breaking Changes
No breaking changes. This is a new server implementation.
Types of changes
- [x] New feature (non-breaking change which adds functionality)
- [x] Documentation update
Checklist
- [x] I have read the MCP Protocol Documentation
- [x] My changes follows MCP security best practices
- [x] I have updated the server's README accordingly
- [x] I have tested this with an LLM client
- [x] My code follows the repository's style guidelines
- [x] I have added appropriate error handling
- [x] I have documented all environment variables and configuration options
Additional context
The server requires a News API key to function. Users need to:
- Sign up at NewsAPI.org to get an API key
- Set the
NEWS_API_KEYenvironment variable - Configure their MCP client (e.g., Claude Desktop) to use the server
The implementation follows the TypeScript MCP SDK patterns and includes comprehensive error handling for API rate limits and invalid responses.