Mediastack News Server
内容与创意by rftsngl
通过集成 Mediastack News API 为 MCP 提供新闻检索与来源列表能力,支持灵活筛选最新资讯并查询完整新闻源信息。
什么是 Mediastack News Server?
通过集成 Mediastack News API 为 MCP 提供新闻检索与来源列表能力,支持灵活筛选最新资讯并查询完整新闻源信息。
README
Mediastack News MCP Server
A FastMCP server that exposes the Mediastack News API as MCP (Model Context Protocol) tools. This server can be used as a plug-and-play backend for Smithery.ai or any other MCP-compatible agent platform.
✨ Features
get_latest_news: Fetches the most recent news stories with various filtering options.get_sources: Lists available news sources with filtering capabilities.
🚀 Installation
-
Clone this repository:
bashgit clone <repository-url> cd NewsMCP_with_MediastackAPI -
Install the required Python packages:
bashpip install -r requirements.txt
⚙️ Configuration
This server requires a Mediastack API key to function.
- Get a free API key from mediastack.com.
- Create a file named
.envin the project's root directory. - Add your API key to this file in the following format:
code
MEDIASTACK_API_KEY=your_api_key_here
The server will automatically load this environment variable when a tool is called.
💻 Running Locally
To start the MCP server, run the following command:
python server.py
By default, the server will start on http://0.0.0.0:8080.
🛠️ Available Tools
1. get_latest_news
Fetches the most recent news stories from Mediastack.
Parameters:
keywords(Optional): Search terms to filter news.sources(Optional): News sources, comma-separated (e.g., "cnn,bbc").countries(Optional): Country codes, comma-separated (e.g., "us,gb").languages(Optional): Language codes, comma-separated (e.g., "en,fr").categories(Optional): News categories, comma-separated.date(Optional): A specific date or date range (YYYY-MM-DD).sort(Optional): Sort order (published_desc,published_asc,popularity).limit(Optional): Maximum number of results to return (default: 25, max: 100).offset(Optional): Pagination offset.
2. get_sources
Lists available news sources from Mediastack.
Parameters:
search(Optional): A search term to filter sources.sources(Optional): Specific sources, comma-separated.countries(Optional): Country codes, comma-separated.languages(Optional): Language codes, comma-separated.categories(Optional): News categories, comma-separated.limit(Optional): Maximum number of results to return (default: 25, max: 100).offset(Optional): Pagination offset.
☁️ Deployment on Smithery.ai
- Push this repository to GitHub.
- Connect your GitHub repository to Smithery.ai.
- Smithery will automatically detect the
smithery.yamlconfiguration. - Set your
MEDIASTACK_API_KEYin Smithery's environment variables. - Deploy and start using the MCP tools.
For more information, visit the Smithery.ai Documentation.
📂 Project Structure
.
├── app.py # MCP tool definitions
├── server.py # FastMCP server setup
├── requirements.txt # Python dependencies
├── smithery.yaml # Smithery deployment configuration
├── Dockerfile # Instructions for building a Docker image
├── LICENSE # Project license
├── .env # (Local) Environment variables
└── README.md # This file
📄 License
This project is licensed under the MIT License.
常见问题
Mediastack News Server 是什么?
通过集成 Mediastack News API 为 MCP 提供新闻检索与来源列表能力,支持灵活筛选最新资讯并查询完整新闻源信息。
相关 Skills
文档共著
by anthropics
围绕文档、提案、技术规格、决策记录等写作任务,按上下文收集、结构迭代、读者测试三步协作共创,减少信息遗漏,写出更清晰、经得起他人阅读的内容。
✎ 写文档、方案或技术规格时容易思路散、信息漏,它用结构化共著流程帮你高效传递上下文、反复打磨内容,还能从读者视角做验证。
内部沟通
by anthropics
按公司常用模板和语气快速起草内部沟通内容,覆盖 3P 更新、状态报告、领导汇报、项目进展、事故复盘、FAQ 与 newsletter,适合需要统一格式的团队沟通场景。
✎ 按公司偏好的模板快速产出状态汇报、领导更新和 FAQ,既省去反复改稿,也让内部沟通更统一、更专业。
平面设计
by anthropics
先生成视觉哲学,再落地成原创海报、艺术画面或其他静态设计,输出 .png/.pdf,强调构图、色彩与空间表达,适合需要高完成度视觉成品的场景。
✎ 做海报、插画或静态视觉稿时,用它能快速产出兼顾美感与版式的PNG/PDF成品,原创设计更省心,也更适合规避版权风险。
相关 MCP Server
by nirholas
免费的加密新闻聚合 MCP,汇集 Bitcoin、Ethereum、DeFi、Solana 与 altcoins 资讯源。
by alisaitteke
用于Adobe Photoshop自动化的MCP server,让AI assistants直接控制Photoshop。
by ProfessionalWiki
让 Large Language Model 客户端无缝连接任意 MediaWiki 站点,可创建、更新、搜索页面,并通过 OAuth 2.0 安全管理内容。