News AI MCP Server logo

News AI MCP Server

by Mohammadshahzaib007

A Python-based MCP server that fetches and summarizes news headlines from NewsAPI.org. It allows fetching news by country, category, and search query.

View on GitHub

Last updated: N/A

๐Ÿ“ฐ News AI MCP Server

alt text

alt text

A minimal Python-based MCP server that connects to NewsAPI.org to fetch and summarize the latest top headlines by country, category, and search query. Built with python mcp SDK, tested on a cloud desktop client, and initialized using uv for environment management.


๐Ÿš€ Features

  • ๐ŸŒ Fetch top headlines from NewsAPI.org by:
    • Country code (e.g. us, in)
    • Category (e.g. business, technology)
    • Search query (q)
  • ๐Ÿง  Summarizes the news headlines with:
    • Title
    • Short description
    • Author and source attribution
  • ๐Ÿ”ง Includes a test greeting resource for verifying server communication
  • โš™๏ธ Easily integratable into MCP clients

๐Ÿ› ๏ธ Tech Stack

  • Python
  • MCP SDK for Python (FastMCP)
  • NewsAPI.org
  • uv โ€” For dependency and environment management
  • dotenv โ€” For managing secrets like API keys

๐Ÿ“ฆ Setup

1. Clone the repo

git clone https://github.com/your-username/news-ai-mcp-server.git
cd news-ai-mcp-server

2. Install dependencies

Make sure you have uv installed:

3. Create a .env file

API_KEY=your_newsapi_org_api_key

4. Run the MCP server

uv run mcp install main.py

๐Ÿงช Testing

This server was tested using a cloud desktop client connected via the MCP protocol.