READMEmain
We couldn't render this README. Read it on GitHub
Yle News MCP Server
A Model Context Protocol (MCP) server for fetching news from Yle RSS feeds.
Features
- Fetch news from various Yle RSS feeds
- Support for multiple topics (news, recent, most_read, kotimaa, ulkomaat, etc.)
- Sort news items by publication date
- Easy integration with Claude Desktop
Installation
- Clone this repository:
git clone <repository-url>
cd model-control-protocol-demo
- Create and activate a virtual environment:
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
uv pip install -e ".[test]"
Adding to Claude Desktop
To add this server to Claude Desktop:
- Open the Claude Desktop configuration file:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
- Add the following configuration:
{
"mcpServers": {
"yle-news": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/model-control-protocol-demo",
"run",
"python",
"-m",
"mcp_demo.main"
]
}
}
}
-
Replace
/ABSOLUTE/PATH/TO/model-control-protocol-demowith the actual absolute path to your project directory. -
Save the file and restart Claude Desktop.
Using the Inspector
To debug and test the server using the MCP Inspector:
- Make sure the virtual environment is activated:
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Start the inspector with the server:
npx @modelcontextprotocol/inspector python -m mcp_demo.main
-
The inspector will start and provide a web interface at http://127.0.0.1:6274
-
You can use the inspector to:
- View available tools
- Test tool calls
- Monitor server responses
- Debug any issues
Running Tests
To run the test suite:
- Make sure the virtual environment is activated:
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Run the tests:
pytest -v tests/
The test suite includes:
- Testing valid topic fetching
- Testing invalid topic handling
- Testing limit parameter
- Testing all available topics
- Testing date sorting functionality
Available Topics
The server supports the following topics:
- news: Major headlines
- recent: Recent news
- most_read: Most read articles
- kotimaa: Domestic news
- ulkomaat: Foreign news
- talous: Economy
- politiikka: Politics
- kulttuuri: Culture
- viihde: Entertainment
- tiede: Science
- luonto: Nature
- terveys: Health
- media: Media news
- liikenne: Traffic
- näkökulmat: Perspectives
- urheilu: Sports
- selkouutiset: Easy-to-read news
- english: English news
- sapmi: Sámi news
- novosti: Russian news
- karjalakse: Karelian news
Development
Project Structure
model-control-protocol-demo/
├── pyproject.toml
├── README.md
├── src/
│ └── mcp_demo/
│ ├── __init__.py
│ ├── main.py
│ └── server.py
└── tests/
└── test_server.py
Adding New Features
- Add new RSS feed URLs to the
RSS_FEEDSdictionary inserver.py - Update the
get_newsfunction's topic description - Add corresponding test cases in
test_server.py - Run the test suite to verify changes
License
MIT
