新闻检索API服务

mcp-newsapi 是一个基于 NewsAPI 的 MCP 服务器,提供获取头条新闻、搜索新闻文章和列出新闻源的功能,适用于需要在应用中集成实时新闻数据检索的场景。

  • by PetrefiedThunder
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 PetrefiedThunder/mcp-newsapi

使用说明

mcp-newsapi

Get top headlines, search news articles, and list sources via NewsAPI.

Tools

Tool Description
get_headlines Get top headlines.
search_news Search news articles.
get_sources List available news sources.

Configuration

Variable Required Description
NEWSAPI_KEY Yes NewsAPI key (free at newsapi.org/register)

Installation

git clone https://github.com/PetrefiedThunder/mcp-newsapi.git
cd mcp-newsapi
npm install
npm run build

Usage with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "newsapi": {
      "command": "node",
      "args": ["/path/to/mcp-newsapi/dist/index.js"],
      "env": {
        "NEWSAPI_KEY": "your-newsapi-key"
      }
    }
  }
}

Usage with npx

npx mcp-newsapi

License

Apache-2.0