TheNewsAPI MCP Server
Click on "Install 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., "@TheNewsAPI MCP ServerWhat are today's top headlines about artificial intelligence?"
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.
TheNewsAPI MCP Server
An MCP server that exposes the read endpoints of TheNewsAPI.com as tools, so an AI assistant (Claude Code, Claude Desktop, or any MCP client) can query news articles from natural-language prompts.
This targets TheNewsAPI.com (
https://api.thenewsapi.com/v1/) — not the unrelatednewsapi.orgservice.
npm package: @trifecta/thenewsapi-mcp-server (not yet published).
Tools
Tool | Endpoint | Purpose |
|
| Full-archive keyword/boolean search across all articles. |
|
| Current top / trending stories, optionally by |
|
| Current headlines grouped by category. |
|
| Other coverage of the same story as a given article. |
|
| Fetch one article by its UUID. |
|
| Enumerate indexed publishers and their |
Boolean search syntax (search param)
search_news and get_top_stories accept a boolean query:
Operator | Meaning | Example |
| term is required (AND) |
|
| either term (OR) |
|
| exclude term |
|
| exact phrase |
|
| group |
|
Bare space-separated words are treated as OR.
Requirements
Node.js 18 or newer (the MCP SDK and the native
fetchused for HTTP calls both require it). Check withnode --version; upgrade via nvm (nvm install 20 && nvm use 20) or nodejs.org.A free or paid TheNewsAPI account.
Getting an API token
Register at https://www.thenewsapi.com/register.
Open your dashboard: https://www.thenewsapi.com/account/dashboard.
Copy the API Token.
Free-plan notes: the free tier caps limit at 3 articles per request and has a low
monthly quota; some endpoints/parameters are paid-only and will return
endpoint_access_restricted.
The token is supplied by each user at runtime via the NEWS_API_TOKEN environment
variable. It is never bundled into the package and never logged by the server.
Install & configure — published package (for end users, once on npm)
No clone or build needed. Point your MCP client at the package via npx.
Claude Code
claude mcp add thenewsapi \
--env NEWS_API_TOKEN=your_token_here \
-- npx -y @trifecta/thenewsapi-mcp-serverThen run claude, check /mcp — thenewsapi should be connected with 6 tools.
Claude Desktop
Edit claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"thenewsapi": {
"command": "npx",
"args": ["-y", "@trifecta/thenewsapi-mcp-server"],
"env": { "NEWS_API_TOKEN": "your_token_here" }
}
}
}Restart Claude Desktop.
Global install alternative
npm install -g @trifecta/thenewsapi-mcp-server
# then use command "thenewsapi-mcp-server" instead of "npx -y @trifecta/..."Local development setup (while unpublished)
git clone https://github.com/stature/trifecta-thenewsapi-mcp-server.git
cd trifecta-thenewsapi-mcp-server
npm install
cp .env.example .env
# edit .env and set NEWS_API_TOKEN=...
npm run build.env is gitignored — keep the real token there, never in .env.example.
Quick check that it starts:
npm start
# -> "[thenewsapi-mcp] server ready (stdio)" on stderr, then Ctrl-CPoint Claude Code at your local build:
claude mcp add thenewsapi \
--env NEWS_API_TOKEN=your_token_here \
-- node /absolute/path/to/newsapi-mcp/dist/index.jsOr the config JSON directly (~/.claude.json, or .mcp.json in a project):
{
"mcpServers": {
"thenewsapi": {
"command": "node",
"args": ["/absolute/path/to/newsapi-mcp/dist/index.js"],
"env": { "NEWS_API_TOKEN": "your_token_here" }
}
}
}Remote deployment — Streamable HTTP (SecureAI / HatzAI and other HTTP MCP clients)
Two entrypoints ship in this package:
Entrypoint | Transport | Use with |
| stdio | Claude Code / Claude Desktop (client spawns it locally) |
| Streamable HTTP | SecureAI / HatzAI, or any client that takes a Server URL |
The HTTP server keeps NEWS_API_TOKEN entirely server-side; remote clients authenticate
with a separate shared secret (MCP_AUTH_TOKEN) and never see the TheNewsAPI token.
Configuration (env vars)
Var | Required | Default | Purpose |
| yes | — | TheNewsAPI token (server-side only). |
| recommended | (none) | Shared secret clients must send. Unset = no auth. |
| no |
| Header accepted for "API Key" style auth. |
| no |
| Listen port ( |
| no |
| Bind address — keep on loopback behind a TLS proxy. |
| no |
| Route the MCP endpoint is served on. |
| no | (none) | Set to an origin or |
GET /healthz is an unauthenticated liveness probe.
Point SecureAI / HatzAI at it
In the custom connection form:
Field | Value |
Server URL |
|
Transport | Streamable HTTP |
Authentication Method |
|
or | |
or |
Try it locally first
cp .env.example .env
# set NEWS_API_TOKEN=... and MCP_AUTH_TOKEN=some-long-random-string
npm run dev:http
# -> [thenewsapi-mcp] Streamable HTTP listening on http://127.0.0.1:3000/mcp (auth: required)# handshake check
curl -sD- http://127.0.0.1:3000/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
-H 'authorization: Bearer some-long-random-string' \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"0"}}}'
# 200 + an `mcp-session-id` response header + the server capabilitiesDeploy on an Oracle Cloud "Always Free" VM + Caddy
The recommended host: a free, always-on VM with Caddy terminating TLS (automatic Let's Encrypt certs) and reverse-proxying to the Node process managed by systemd.
Config templates live in deploy/:
deploy/Caddyfile→/etc/caddy/Caddyfiledeploy/thenewsapi-mcp.service→/etc/systemd/system/deploy/env.production.example→/opt/thenewsapi-mcp/.env
Full step-by-step (VM creation, both Oracle firewalls, DNS, TLS, verification):
deploy/README.md. Outline:
Create an Ubuntu 22.04
VM.Standard.A1.Flex(Ampere) instance; reserve its public IP.Open TCP 80 + 443 in both the VCN Security List and the instance
iptables.Install Node 20 (NodeSource) and Caddy (apt).
Point a domain's A record at the VM.
Clone to
/opt/thenewsapi-mcp,npm ci && npm run build, create.env(with anopenssl rand -hex 32value forMCP_AUTH_TOKEN),chmod 600.Install the systemd unit:
systemctl enable --now thenewsapi-mcp.Install the Caddyfile (swap in your domain),
systemctl restart caddy.Verify
https://your-domain/mcpwith thecurlhandshake above, then add it to SecureAI.
No domain? deploy/README.md Appendix A covers a free DuckDNS hostname.
Scaling note: sessions are held in memory in one process — perfect for a single always-on VM. Multiple instances would need sticky-session routing.
Example prompts
"Search the news for articles about the EU AI Act from the last two weeks, English only."
"What are the top business stories in the US right now?"
"Give me a news briefing — headlines across tech, business, and science."
"Find coverage of
+\"interest rate\" +\"Federal Reserve\" -cryptosorted by relevance.""Get everything from nytimes.com and bbc.com about the Mars sample return mission."
"Here's an article UUID
abc-123— find other outlets covering the same story.""List the news sources you can access in the
techcategory.""Fetch the full article with UUID
abc-123."
Error handling
TheNewsAPI's documented error codes are surfaced back to the assistant with guidance and a retryable flag:
Code | Retryable | Meaning |
| no | Bad parameter name/format — fix and retry. |
| no |
|
| no | Monthly quota exhausted. |
| no | Not available on current plan. |
| no | UUID / resource does not exist. |
| yes | Per-second rate limit — wait and retry. |
| yes | Transient upstream error. |
| yes | API temporarily down. |
Project layout
src/
index.ts stdio entrypoint (Claude Code / Desktop)
http.ts Streamable HTTP entrypoint (SecureAI / remote clients) + auth
server.ts shared McpServer factory used by both entrypoints
client.ts API client wrapper: base URL, auth, query building, error mapping
errors.ts NewsApiError + documented error-code translation
schemas.ts Shared zod schema fragments (filters, pagination, search help)
tools/
shared.ts safeHandler wrapper + JSON result formatter
search-news.ts
get-top-stories.ts
get-headlines.ts
get-similar-articles.ts
get-article-by-uuid.ts
list-sources.tsCompiled output goes to dist/. Only dist/, README.md, and LICENSE are included
in the published package (see files in package.json).
Scripts
Script | Action |
| Compile TypeScript to |
| Recompile on change. |
| Type-check without emitting. |
| Remove |
| Run the compiled stdio server. |
| Run the compiled Streamable HTTP server. |
| Build then run (stdio). |
| Build then run (HTTP). |
| Auto-runs |
Publishing
npm run typecheck
npm publish # scoped package; publishConfig.access is already "public"Before the first publish: make sure you're a member of the @trifecta npm org. Repo:
https://github.com/stature/trifecta-thenewsapi-mcp-server.
Versioning: starts at 0.1.0 (pre-1.0 — the tool surface may still change). Follow semver
afterwards.
Out of scope (this phase)
No database, caching, webhooks, or downstream integrations — just the read endpoints as MCP tools.
License
MIT — see LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
NewsData.io MCP — wraps the NewsData.io global news API (newsdata.io)
Mediastack MCP — wraps Mediastack API (api.mediastack.com/v1)
Currents MCP — wraps the Currents API (currentsapi.services)
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/stature/trifecta-thenewsapi-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server