newsapi-ai-mcp
MCP server for newsapi.ai (Event Registry): search and read news articles and events from ~150k sources worldwide, with URI resolution, token usage, and a raw API escape hatch.
newsapi_search_articles— search articles by keywords, concepts, categories, sources, locations, language, dates, sentiment, and source importance; supports Advanced Query Language passthrough.newsapi_get_articles— fetch full text and metadata by article URI (up to 100) or original URL (up to 20).newsapi_search_events— search events (cross-language clusters of articles about the same real-world happening), sortable by date, relevance, size, or social score.newsapi_get_event— get one event's details plus its top/central articles.newsapi_suggest— resolve names to the URIs needed by other tools: concepts, sources, source groups, categories, locations, authors.newsapi_usage— check remaining and used API tokens on the current plan.newsapi_raw_request— POST arbitrary parameters to any/api/v1/…endpoint (aggregations, trends, minute stream); API key added automatically.All tools are read-only; results are trimmed to compact JSON to save context unless
response_format: "raw"is passed, and searches can be capped to the last 7 or 31 days to reduce token cost.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@newsapi-ai-mcp find recent news articles about AI regulation in the US"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
newsapi-ai-mcp
MCP server for newsapi.ai (Event Registry): search news articles and events from ~150k sources
worldwide — from Claude (Code, Desktop, claude.ai), Codex, OpenCode, Cursor or any other MCP client.
Ships with an Agent Skill that teaches agents how to query the API well
(and how to fall back to plain curl where no MCP is available).
Tools
Tool | What it does |
| Article search: keywords, concepts, categories, sources, locations, language, dates, sentiment, source rank; Advanced Query Language passthrough |
| Full text + metadata by article URI or original URL |
| Event search (articles clustered by real-world happening, cross-language) |
| Event details + top articles |
| Resolve names → URIs (concepts, sources, source groups, categories, locations, authors) |
| Remaining API tokens |
| Escape hatch: any |
Results are trimmed to compact JSON (snippets instead of full bodies, flattened labels) to save context; pass
response_format: "raw" for the untouched API response.
Related MCP server: AI News MCP
Configuration
Variable | |
| your newsapi.ai API key |
|
|
| API host, default |
| path of the config file, default |
| HTTP mode only: bearer token clients must send |
Instead of environment variables you can use a config file — handy for GUI apps, which on macOS don't see
variables from ~/.zshrc:
mkdir -p ~/.config/newsapi-ai-mcp && chmod 700 ~/.config/newsapi-ai-mcp
echo '{"apiKey": "your-key", "maxDays": 31}' > ~/.config/newsapi-ai-mcp/config.json
chmod 600 ~/.config/newsapi-ai-mcp/config.jsonKey lookup order: plugin settings → NEWSAPI_AI_KEY → config file. Empty values and unexpanded ${…} placeholders are skipped.
Claude Code: one-step plugin (MCP server + skill)
This repo is also a Claude Code plugin marketplace. The plugin installs the MCP server and the skill together:
/plugin install newsapi-ai --marketplace elcamino/newsapi-ai-mcp(older Claude Code: /plugin marketplace add elcamino/newsapi-ai-mcp, then /plugin install newsapi-ai@elcamino)
During installation Claude Code shows a settings dialog:
Setting | |
newsapi.ai API key | stored in the system credential store (macOS Keychain), never in a settings file |
Limit searches to recent news |
|
Change them later with /plugin configure newsapi-ai@elcamino (or /plugin → Installed → newsapi-ai).
From a shell: claude plugin install newsapi-ai@elcamino --config api_key=… --config max_days=31.
Restart the session after changing settings.
Claude Cowork / desktop chat: these don't show plugin settings dialogs. The plugin still loads there; put the key into the config file (see Configuration) instead.
Install — local (stdio)
Alternatives to npx -y newsapi-ai-mcp: npx -y github:elcamino/newsapi-ai-mcp (latest main)
or node /path/to/newsapi-ai-mcp/dist/index.js (after npm install in a checkout).
Claude Code
claude mcp add newsapi-ai -s user -e NEWSAPI_AI_KEY=your-key -- npx -y newsapi-ai-mcpClaude Desktop — claude_desktop_config.json
{
"mcpServers": {
"newsapi-ai": {
"command": "npx",
"args": ["-y", "newsapi-ai-mcp"],
"env": { "NEWSAPI_AI_KEY": "your-key" }
}
}
}Codex CLI — ~/.codex/config.toml
[mcp_servers.newsapi-ai]
command = "npx"
args = ["-y", "newsapi-ai-mcp"]
env = { NEWSAPI_AI_KEY = "your-key" }OpenCode — opencode.json (project) or ~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"newsapi-ai": {
"type": "local",
"command": ["npx", "-y", "newsapi-ai-mcp"],
"environment": { "NEWSAPI_AI_KEY": "{env:NEWSAPI_AI_KEY}" },
"enabled": true
}
}
}Cursor / Windsurf / Cline / Zed / anything else: same command + args + env triple in that client's MCP config.
Install — remote (Streamable HTTP)
For claude.ai custom connectors, Claude mobile, or sharing one server across machines:
NEWSAPI_AI_KEY=your-key MCP_AUTH_TOKEN=$(openssl rand -hex 32) \
npx -y newsapi-ai-mcp --http --host 0.0.0.0 --port 8787Endpoint:
https://your-host/mcp(health check:/health). Stateless, POST only.Auth:
Authorization: Bearer <MCP_AUTH_TOKEN>; clients that can't set headers (e.g. a claude.ai custom connector) can usehttps://your-host/mcp?token=<MCP_AUTH_TOKEN>.Optional per-client API key: header
X-NewsAPI-KeyoverridesNEWSAPI_AI_KEY.Run it behind TLS (Caddy, Traefik, Cloudflare Tunnel).
Docker + Caddy:
docker compose up -d # see docker-compose.yml, put NEWSAPI_AI_KEY / MCP_AUTH_TOKEN in .envnews-mcp.example.com {
reverse_proxy newsapi-ai-mcp:8787
}Then in claude.ai: Settings → Connectors → Add custom connector → URL https://news-mcp.example.com/mcp?token=….
Remote config for other clients, e.g. Claude Code:
claude mcp add --transport http newsapi-ai https://news-mcp.example.com/mcp --header "Authorization: Bearer …"The skill
skills/newsapi-ai/ is a standard SKILL.md folder:
Claude Code: comes with the plugin above; or copy to
~/.claude/skills/newsapi-ai/claude.ai / Desktop: zip the folder and upload it under Settings → Capabilities → Skills (claude.ai skills also sync into Claude Code sessions signed in with a claude.ai account)
Codex / OpenCode / others with Agent Skills support: put it in the client's skills directory; otherwise paste it into
AGENTS.mdor the system prompt
Development
npm install
npm test # builds, then runs an end-to-end test (stdio + HTTP) against a mock APIReleases: bump version in package.json and src/index.ts, push a tag vX.Y.Z — the GitHub
workflow tests and publishes to npm (needs the NPM_TOKEN repo secret).
MIT License.
Available Tools
7 toolsnewsapi_get_articlesGet full articlesARead-onlyIdempotent
Fetch full details (complete body text, authors, concepts, categories) for articles by their newsapi.ai URI (from search results) or by original article URL.
Inputs: uris, urls, body_chars, result_lang, +2 more.
newsapi_get_eventGet event detailsBRead-onlyIdempotent
Details for one event (summary, concepts, location) plus optionally its top articles.
Inputs: event_uri (required), body_chars, result_lang, articles_lang, +3 more.
newsapi_raw_requestRaw newsapi.ai requestARead-only
Escape hatch: POST arbitrary parameters to any newsapi.ai endpoint under /api/v1/ (e.g. /api/v1/article/getArticles with resultType=conceptTrends, /api/v1/minuteStreamArticles, /api/v1/trends). The API key is added automatically. Prefer the dedicated tools when they fit.
Inputs: path (required), params.
newsapi_search_articlesSearch news articlesARead-onlyIdempotent
Search ~150k news/blog/press-release sources worldwide (newsapi.ai / Event Registry). Filter by keywords, concepts, categories, sources, locations, language and date. For entities (companies, people, places) prefer concept_uris over keywords – resolve them first with newsapi_suggest. Each call consumes API tokens; queries older than 31 days cost more. Returns compact results unless response_format=raw.
Inputs: lang, page, count, sort_by, +31 more.
newsapi_search_eventsSearch news eventsARead-onlyIdempotent
Search events: clusters of articles (often across languages) reporting on the same real-world happening. Good for 'what happened around X' and for spotting stories with broad coverage. Same filters as article search.
Inputs: lang, page, count, sort_by, +25 more.
newsapi_suggestResolve names to URIsARead-onlyIdempotent
Autocomplete names to the URIs that the search tools need: concepts (people, organisations, places, topics → Wikipedia URI), sources (news outlets → domain URI), source_groups, categories, locations, authors. Call this BEFORE filtering by entity, source or category.
Inputs: kind (required), prefix (required), lang, count.
newsapi_usageAPI token usageARead-onlyIdempotent
Show how many newsapi.ai API tokens are available and used on the current plan.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a distinct purpose: search_articles vs search_events target articles vs clusters, get_articles vs get_event fetch details for each, and suggest/usage/raw_request are clearly separate meta/helper tools. Boundaries are well-drawn, and raw_request is explicitly labeled as a fallback for cases the dedicated tools don't cover.
All tools share a clean newsapi_ prefix with snake_case and mostly verb_noun structure (search_articles, search_events, get_articles, get_event, suggest, raw_request). newsapi_usage is noun-only and breaks the verb pattern slightly, but overall the convention is predictable.
Seven tools is a well-scoped surface for a news search API, covering search, retrieval, discovery/autocomplete, usage, and an escape hatch without redundancy. Each tool earns its place.
The lifecycle is well covered: query (search_articles/events), retrieve full details (get_articles/get_event), resolve entities/sources (suggest), monitor quota (usage), and extend via raw_request. Some higher-level analytics (e.g. trends, concept trends) require the raw escape hatch rather than dedicated tools, a minor gap.
Maintenance
Related MCP Connectors
The only News based AI MCP your agents will ever need — custom categories, global regions, and time-scoped results in one tool. We use multi-vector & sparse-hybrid search to search through thousands of articles across the world to find the exact news you're looking for.
Give your AI assistant access to the world’s news. Search articles in any language, track coverage over time, and research companies and events.
Managed cloud RSS and Atom feed reader with a remote Model Context Protocol (MCP) endpoint. Zero server setup required — enables AI agents like Claude to instantly subscribe to feeds, search full-text articles, extract readable content, and access curated AI editions ("Your Newspaper") over secure streamable HTTP.
Real-time corroborated news events + 5-year archive, for agents. Free tier, no key.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA Model Context Protocol (MCP) server that provides real-time news intelligence using NewsAPI.ai. This server enables LLMs to search articles, track events, and analyze news through natural conversation.492 npm3MIT
- FlicenseNot gradedqualityDmaintenanceLocal MCP server that ingests and normalizes recent AI, tech, and research news from multiple sources, exposing tools for media agents to query and retrieve article content on demand.-
- AlicenseAqualityCmaintenanceEnables users to query news mention volume time series, growth percentages, and live Google News feeds as an MCP tool, integrating with AI hosts like Claude and Cursor.3MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to query news articles from TheNewsAPI.com through natural-language prompts, exposing search, top stories, headlines, similar articles, article lookup, and source listing as MCP tools.MIT