新闻聚合服务器

一个提供新加坡主要新闻源实时新闻订阅的服务器。

  • by chakarai1234
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 chakarai1234/news_mcp

使用说明

新加坡新闻MCP服务器

提供来自新加坡主要新闻来源的实时新闻馈送的服务器。

特性

  • 通过服务器发送事件(SSE)实时更新新闻
  • 支持多个新加坡新闻来源:
    • 海峡时报
    • 商业时报
    • 亚洲新闻频道(CNA)

先决条件

安装

# Clone the repository
git clone <repository-url>
cd news_mcp

# Install dependencies using uv
uv sync

用法

使用Python运行

# Start the MCP server
uv run news_mcp

# Individual news retrievers
uv run straits     # Straits Times
uv run business    # Business Times
uv run cna         # Channel News Asia

使用Docker运行

# Build and run using docker-compose
docker compose up --build

或

# You can run using the run.sh file
# This command is only for MacOS or Linux
# For MacOs required Docker Desktop

# Give permissions for run.sh in unix
chmod +x ./run.sh # (sudo chmod) if super user required

./run.sh #For MacOS it will spin up the docker desktop builds and run the docker container in the background

配置

  1. 创建一个 .env 包含所需环境变量的文件:
MCP_PORT=8000
  1. 对于Claude Desktop集成,请使用提供的 claude_desktop_config.json:
{
	"mcpServers": {
		"news_streamable": {
			"command": "/opt/homebrew/bin/uv",
			"args": [
				"tool",
				"run",
				"mcp-proxy",
				"--transport",
				"streamablehttp",
				"http://127.0.0.1:8080/mcp"
			]
		}
	}
}

依赖项

  • bs4-网页抓取
  • dateparser-日期解析
  • httpx-HTTP客户端
  • mcp代理-mcp代理支持
  • python dotenv-环境变量管理

许可证

麻省理工学院