Back to MCP directory
publicPublicdnsLocal runtime

MCP_SSE_Server

该项目是一个基于Model Context Protocol (MCP)的新闻助手服务器模板,提供使用NewsAPI.org和大型语言模型获取和分析新闻信息的工具。包含Python和TypeScript两种实现方式,支持Docker部署。

article

README

🚀 GenAI新闻助理MCP服务器

GenAI新闻助理MCP服务器提供了用于使用NewsAPI.org和大型语言模型(LLM)获取和分析新闻信息的工具。此仓库包含构建一个模型上下文协议(MCP)服务器的模板,能帮助开发者快速搭建相关服务。

📦 安装指南

先决条件

  • 系统上安装了Docker
  • NewsAPI.org API密钥
  • LLM API密钥(另行提供)

环境变量

需要设置以下环境变量:

  • NEWS_API_KEY:您的NewsAPI.org API密钥
  • LLM_API_KEY:您的LLM API密钥

构建和运行

Python版本

# 构建Docker镜像
cd python
docker build -t news-assistant-python .

# 运行容器
docker run -p 3000:3000 \
  -e NEWS_API_KEY=your_news_api_key \
  -e LLM_API_KEY=your_llm_api_key \
  news-assistant-python

TypeScript版本

# 构建Docker镜像
cd typescript
docker build -t news-assistant-typescript .

# 运行容器
docker run -p 3000:3000 \
  -e NEWS_API_KEY=your_news_api_key \
  -e LLM_API_KEY=your_llm_api_key \
  news-assistant-typescript

测试

您可以在开发环境中使用MCP Inspector验证服务器是否按预期工作:MCP Inspector

📚 详细文档

项目结构

.
├── python/                # Python实现
│   ├── Dockerfile         # Python Docker配置
│   └── src/               # Python源代码
├── typescript/            # TypeScript实现
│   ├── Dockerfile         # TypeScript Docker配置
│   └── src/               # TypeScript源代码
└── README.md              # 本文件

MCP工具

该服务器应实现以下MCP工具:

  1. search_news:搜索匹配特定查询的最近新闻文章
  2. extract_information_from_article:从新闻文章中提取结构化信息
  3. extract_key_info_and_sentiment:分析新闻文章中的关键实体和情感

有关每个工具的详细规格,请参阅任务文档。

开发

根据您的偏好选择Python或TypeScript实现。两种实现都通过MCP接口提供相同的功能。

📄 许可证

此仓库仅用于内部测试任务,为私人用途。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client