Metadata-Version: 2.4
Name: iflow-mcp_ltejedor-newsfeed-mcp
Version: 1.0.0
Summary: A Model Context Protocol server that provides news information from various RSS feeds
Requires-Python: >=3.10
Requires-Dist: feedparser>=6.0.0
Requires-Dist: mcp>=1.2.0
Requires-Dist: python-dotenv>=1.0.0
Description-Content-Type: text/markdown

# News MCP Server

A Model Context Protocol (MCP) server that provides news information from various RSS feeds, designed to integrate with AI assistants like Claude.

## Features

- Get the latest news from various categories (tech, business, science, etc.)
- Search for news articles matching specific terms
- View articles from specific feeds
- Get detailed information about individual articles
- Caching to improve performance and reduce load on RSS sources
- Configurable via environment variables

## Installation

### Prerequisites

- Python 3.10 or higher
- MCP SDK 1.2.0 or higher

### Setup

1. Clone this repository:

```bash
git clone https://github.com/ltejedor/newsfeed-mcp.git
cd news-mcp
```

2. Create a virtual environment and install dependencies:

```bash
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
```

3. Run the server:

```bash
python news_mcp.py
```

### Docker Installation

To run the server using Docker:

```bash
docker-compose up -d
```

## Configuration

The server can be configured using environment variables:

- `NEWS_MCP_CUSTOM_FEEDS`: Additional RSS feeds in the format `name1:url1;name2:url2`
- `LOG_LEVEL`: Set logging level (INFO, DEBUG, WARNING, ERROR)

## Usage with Claude for Desktop

1. Make sure you have Claude for Desktop installed and updated.
2. Open your Claude for Desktop App configuration:
   - On macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
   - On Windows: `%APPDATA%\Claude\claude_desktop_config.json`

3. Add your news server to the configuration:

```json
{
    "mcpServers": {
        "news": {
            "command": "python",
            "args": [
                "/ABSOLUTE/PATH/TO/news_mcp.py"
            ]
        }
    }
}
```

4. Restart Claude for Desktop.

5. Look for the hammer icon (🔨) in Claude for Desktop to access your tools.

## Available Tools

The server provides the following tools:

### `health_check()`
Check if the server is running properly and get basic stats.

### `list_available_feeds()`
Get a list of all available feeds and categories.

Example usage in Claude:
```
What news feeds do you have available?
```

### `get_latest_news(category, limit)`
Get recent news articles, optionally filtered by category.

Parameters:
- `category`: Optional - Filter by category (tech, general, business, science, travel, politics)
- `limit`: Optional - Maximum number of articles to return (default: 5, max: 20)

Example usage in Claude:
```
Show me the latest tech news
```

### `search_news(query, limit)`
Search for news articles matching a specific term.

Parameters:
- `query`: Search term to look for in news articles
- `limit`: Optional - Maximum number of articles to return (default: 5, max: 20)

Example usage in Claude:
```
Search for news about climate change
```

### `get_feed_content(feed_name, limit)`
Get articles from a specific feed.

Parameters:
- `feed_name`: Name of the feed to fetch
- `limit`: Optional - Maximum number of articles to return (default: 5, max: 20)

Example usage in Claude:
```
Get articles from the NASA feed
```

### `get_article_details(url)`
Get detailed information about an article by URL.

Parameters:
- `url`: The URL of the article to retrieve details for

Example usage in Claude:
```
Tell me more about this article: https://www.example.com/article
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License - see the LICENSE file for details.