正面新闻筛选服务

MCP Goodnews 是一个基于模型上下文协议(MCP)的应用,通过NewsAPI获取新闻文章并使用Cohere LLM根据积极情绪进行排名,返回最正面的新闻文章。

  • by VectorInstitute
  • Python
  • 本地部署
  • 48 星标
  • 更新于
在 GitHub 查看 VectorInstitute/mcp-goodnews

使用说明

MCP好消息


MCP Goodnews是一个简单的模型上下文协议(MCP)应用程序,其特点是 用于获取好消息、积极消息和令人振奋消息的服务器。此工具获取新闻 文章从 新闻API 并使用Cohere LLM进行排名 并根据积极情绪返回热门新闻文章。

阅读 博客文章 在Medium上!

动机

在一个负面新闻经常占据头条新闻的世界里,Goodnews MCP的目标是 让更多积极和令人振奋的新闻故事大放异彩。这个项目是 受到早期名为GoodnewsFirst的倡议的启发,该倡议带来了积极的影响 每天向电子邮件订阅者发送新闻——这是一个非常棒的项目!虽然好消息第一 早于大型语言模型(LLMs)的最新突破,并依赖于 传统的情绪排名方法,Goodnews MCP利用现代LLM 在零样本环境中进行情绪分析。

示例用法:MCP Goodnews与Claude Desktop

需求

克隆 mcp-goodnews

# Clone the repository
git clone https://github.com/VectorInstitute/mcp-goodnews.git

在下一步中,我们需要提供此位置的绝对路径 克隆存储库。

更新Claude桌面配置以查找mcp好消息

适用于Mac/Linux

# Navigate to the configuration directory
cd ~/Library/Application\ Support/Claude/config

# Edit the claude_desktop_config.json file
nano claude_desktop_config.json

对于Windows

# Navigate to the configuration directory
cd %APPDATA%\Claude\config

# Edit the claude_desktop_config.json file
notepad claude_desktop_config.json

您需要在下面添加一个条目 mcpServers 为了 Goodnews:

{
  "mcpServers": {
    "Goodnews": {
      "command": "<absolute-path-to-bin>/uv",
      "args": [
        "--directory",
        "<absolute-path-to-cloned-repo>/mcp-goodnews/src/mcp_goodnews",
        "run",
        "server.py"
      ],
      "env": {
        "NEWS_API_KEY": "<newsapi-api-key>",
        "COHERE_API_KEY": "<cohere-api-key>"
      }
    }
  }
}

启动或重新启动Claude Desktop

Claude Desktop将使用更新的配置来构建和运行mcp-goodnews服务器。 如果成功,您将在聊天的右下角看到锤子工具 对话窗口。

点击锤子工具图标将打开一个列出可用MCP工具的模式。 你应该看看 fetch_list_of_goodnews 列在那里。

问克劳德好消息

示例提示:

  • “给我看看今天的好消息。”
  • “本周世界上发生了什么积极的事情?”
  • “给我讲一些关于科学的令人振奋的新闻故事。”

运作原理

  1. 当您请求好消息时,应用程序会向NewsAPI查询最近的文章
  2. CohereLLM分析每篇文章的情感
  3. 文章根据积极情绪评分进行排名
  4. 顶级的好消息通过克劳德返回给您

许可证

Apache 2.0


对Goodnews MCP保持积极态度!