NewsAPI MCP Server

NewsAPI MCP Server

Enables news search and headline retrieval using NewsAPI. Supports getting top headlines by country and category, and searching articles across thousands of sources.

Category
访问服务器

README

NewsAPI MCP Server

mpak NimbleBrain Discord License: MIT

A Model Context Protocol (MCP) server that provides news search and headline retrieval using NewsAPI. Get top headlines by country and category, or search articles across thousands of sources.

View on mpak registry | Built by NimbleBrain

Install

Install with mpak:

mpak install @nimblebraininc/newsapi

Configuration

Get your API key from NewsAPI, then configure:

mpak config set @nimblebraininc/newsapi api_key YOUR_API_KEY

Claude Code

claude mcp add newsapi -- mpak run @nimblebraininc/newsapi

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "newsapi": {
      "command": "mpak",
      "args": ["run", "@nimblebraininc/newsapi"]
    }
  }
}

See the mpak registry page for full install options.

Tools

get_top_headlines

Get top news headlines by country and category.

Parameter Type Required Description
query string No Keywords to search in article headlines
country string No 2-letter country code (default: "us")
category string No One of: "business", "entertainment", "general", "health", "science", "sports", "technology"
page_size integer No Number of results, max 100 (default: 10)

Example call:

{
  "name": "get_top_headlines",
  "arguments": {
    "country": "us",
    "category": "technology",
    "page_size": 5
  }
}

Example response:

{
  "articles": [
    {
      "title": "New AI breakthrough announced",
      "description": "Researchers have developed a new approach...",
      "url": "https://example.com/article",
      "source": "TechCrunch",
      "author": "Jane Smith",
      "published_at": "2026-02-13T10:00:00Z"
    }
  ],
  "total_results": 5
}

search_news

Search news articles across all sources. Note: Only returns articles from the last 30 days (NewsAPI free tier limitation).

Parameter Type Required Description
query string Yes Search keywords or phrase
sources string No Comma-separated source IDs (e.g. "bbc-news,cnn")
domains string No Comma-separated domains (e.g. "bbc.co.uk,techcrunch.com")
from_date string No Oldest article date, ISO 8601 (e.g. "2026-01-01")
to_date string No Newest article date, ISO 8601 (e.g. "2026-01-31")
language string No 2-letter language code (default: "en")
sort_by string No "relevancy", "popularity", or "publishedAt" (default: "publishedAt")
page_size integer No Number of results, max 100 (default: 10)

Example call:

{
  "name": "search_news",
  "arguments": {
    "query": "artificial intelligence",
    "sort_by": "relevancy",
    "page_size": 5
  }
}

Example response:

{
  "query": "artificial intelligence",
  "articles": [
    {
      "title": "The State of AI in 2026",
      "description": "A comprehensive look at how AI has evolved...",
      "url": "https://example.com/ai-2026",
      "source": "Wired",
      "author": "John Doe",
      "published_at": "2026-02-10T14:30:00Z",
      "content": "First 200 characters of the article content..."
    }
  ],
  "total_results": 127
}

Quick Start

Local Development

git clone https://github.com/NimbleBrainInc/mcp-newsapi.git
cd mcp-newsapi

# Install dependencies
uv sync

# Set API key
cp .env.example .env
# Edit .env with your API key

# Run the server (stdio mode)
uv run python -m mcp_newsapi.server

The server supports HTTP transport with:

  • Health check: GET /health
  • MCP endpoint: POST /mcp

Development

# Install with dev dependencies
uv sync --group dev

# Run all checks (format, lint, typecheck, unit tests)
make check

# Run unit tests
make test

# Run with coverage
make test-cov

About

NewsAPI MCP Server is published on the mpak registry and built by NimbleBrain. mpak is an open registry for Model Context Protocol servers.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选