servers icon indicating copy to clipboard operation
servers copied to clipboard

create new mcp server for news api

Open nadeeiiin opened this issue 7 months ago • 0 comments

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 filters
    • news_top_headlines: Get top headlines by country, category, or sources
    • news_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:

  1. Sign up at NewsAPI.org to get an API key
  2. Set the NEWS_API_KEY environment variable
  3. 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.

nadeeiiin avatar May 23 '25 14:05 nadeeiiin