Skip to content

RunStack-AI/rss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSS Feed Reader MCP Server

A Model Context Protocol (MCP) server that provides tools for reading and discovering RSS and Atom feeds. This server supports RSS 2.0, Atom 1.0, and RSS 1.0 (RDF) feed formats.

Features

Feed Reading

  • Parse RSS 2.0, Atom 1.0, and RSS 1.0 (RDF) feeds
  • Filter items by publication date
  • Limit number of items returned
  • HTTP Basic Authentication support for protected feeds
  • Automatic content truncation (3000 chars per item)
  • Extract metadata: titles, links, descriptions, authors, dates, categories, enclosures

Feed Discovery

  • Scan websites for RSS/Atom feed links
  • Discover multiple feeds from a single site
  • Extract feed titles and types from HTML
  • HTTP Basic Authentication support

Installation

Prerequisites

  • Python 3.10+
  • pip or uv package manager

Setup

  1. Clone the repository:
git clone <repository-url>
cd rss
  1. Install dependencies:
pip install -r requirements.txt

Or with uv:

uv pip install -r requirements.txt
  1. Set up environment variables (for the agent):
cp .env.example .env
# Edit .env and add your OPENROUTER_API_KEY and LOGFIRE_API_KEY

Usage

Testing with the Agent

The included PydanticAI agent provides an interactive CLI for testing:

python agent.py

With a custom model:

python agent.py --model anthropic/claude-3-opus

Example Prompts

Discovering feeds:

> Can you find RSS feeds on https://example.com?

Reading a feed:

> Read the latest 5 items from https://example.com/feed.xml

Filtering by date:

> Show me items from https://example.com/rss published after 2024-01-01

Authenticated feeds:

> Read https://protected.example.com/feed with username 'user' and password 'pass'

Using the MCP Server Directly

The MCP server can be run standalone:

python mcp_server.py

Or installed in Claude Desktop by adding to your MCP config:

{
  "mcpServers": {
    "rss": {
      "command": "python",
      "args": ["/path/to/rss/mcp_server.py"]
    }
  }
}

Project Structure

rss/
├── src/
│   └── rss_client.py       # Core RSS/Atom parsing client
├── agents/
│   └── rss.md              # Agent system prompt
├── mcp_server.py           # FastMCP server implementation
├── agent.py                # PydanticAI agent for testing
├── requirements.txt        # Python dependencies
└── README.md              # This file

Tools

read_feed

Read and parse an RSS or Atom feed.

Parameters:

  • url (required): URL of the RSS/Atom feed
  • max_items (default: 10): Maximum number of items to return (1-100)
  • since_date (optional): Filter items after this date (ISO 8601 format)
  • username (optional): Username for HTTP Basic Auth
  • password (optional): Password for HTTP Basic Auth
  • include_content (default: true): Include full content/description

Returns:

  • Feed metadata (title, link, description, language, type)
  • List of feed items with:
    • Title, link, description, content
    • Author, publication date, update date
    • GUID, categories, enclosures
  • Total items count and returned items count

discover_feeds

Discover RSS/Atom feeds from a website.

Parameters:

  • url (required): URL of the website to scan
  • username (optional): Username for HTTP Basic Auth
  • password (optional): Password for HTTP Basic Auth

Returns:

  • List of discovered feeds with:
    • Feed URL
    • Feed title (from HTML)
    • Feed type (MIME type)
  • Total number of feeds found

Development

Running Tests

Use the agent CLI for interactive testing:

python agent.py

Logging

Logs are written to logs/rss_mcp_server.log with automatic rotation (10MB max, 5 backups).

Adding Features

  1. Update the client in src/rss_client.py
  2. Add or modify tools in mcp_server.py
  3. Update the agent prompt in agents/rss.md if needed
  4. Test with agent.py

Error Handling

The server handles errors gracefully:

  • Network failures (timeouts, connection errors)
  • Invalid XML/feed format
  • Missing or moved feeds
  • Authentication failures

Errors are returned as dictionaries with error and details fields rather than raising exceptions.

Limitations

  • Content truncated to 3000 characters per item
  • Maximum 100 items per request
  • No support for feed polling/subscriptions (read-only)
  • Basic HTML parsing for feed discovery (no JavaScript execution)

Dependencies

  • httpx - Async HTTP client
  • pydantic - Data validation and serialization
  • mcp - Model Context Protocol SDK
  • pydantic-ai - Agent framework (for testing)
  • logfire - Logging and observability (for testing)

License

MIT License

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test with the agent
  5. Submit a pull request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages