MCP server for the NewsData.io REST API (latest/archive/crypto/market news, source discovery, aggregate counts).
Project description
NewsData MCP Server
An MCP server for NewsData.io that exposes real-time, historical, crypto, market, source-discovery, and aggregate-count tools to any MCP-compatible client.
Available Tools
| Tool | Endpoint | Description |
|---|---|---|
get_latest_news |
/api/1/latest |
Recent and breaking news (last 48h) |
get_archive_news |
/api/1/archive |
Historical news, filterable by from_date / to_date |
get_crypto_news |
/api/1/crypto |
Crypto and blockchain-focused coverage |
get_market_news |
/api/1/market |
Stock, financial, and market-related news |
get_news_sources |
/api/1/sources |
Source discovery by country, category, or language |
get_news_counts |
/api/1/count |
Aggregate article counts over a date range (hour / day buckets or single all total) |
get_crypto_counts |
/api/1/crypto/count |
Aggregate crypto article counts over a date range |
get_market_counts |
/api/1/market/count |
Aggregate market article counts over a date range |
All tools are read-only and idempotent; the MCP-protocol annotations let compatible clients (Claude Code, MCP Inspector, etc.) cache and parallelize calls.
Installation
The server is published on PyPI as newsdata-mcp. The recommended path is to let your MCP client launch it via uvx — no clone, no uv sync, no virtualenv to manage. The package is downloaded and cached on first launch.
# verify uvx + the server work end-to-end (optional)
uvx newsdata-mcp --version
Then add the server to your MCP client (see Editor & Client Integrations below). Every client config uses the same launch command:
"command": "uvx",
"args": ["newsdata-mcp"]
For a local development checkout, see Development below.
Configure environment
Set NEWSDATA_API_KEY in your client config's env block (per the per-client examples below). When running the server outside an MCP client (development, Docker, streamable-http), use a .env file:
cp .env.example .env
# then edit .env
| Variable | Default | Notes |
|---|---|---|
NEWSDATA_API_KEY |
(required) | NewsData.io credential. Missing key returns an error envelope on every call. |
REQUEST_TIMEOUT |
30 |
Per-request timeout in seconds. |
NEWSDATA_BASE_URL |
https://newsdata.io/api/1 |
Override for staging or a local mock. |
NEWSDATA_MAX_RETRIES |
5 |
Maximum attempts for transient failures (network, 5xx, 429). |
NEWSDATA_RETRY_BACKOFF |
2.0 |
Base for exponential backoff (base * 2^(attempt-1)). Seconds. |
NEWSDATA_RETRY_BACKOFF_MAX |
60.0 |
Cap on a single retry sleep, seconds. |
NEWSDATA_INTEGRATION_KEY |
(unset) | Used only by pytest -m integration. Without it, live-API tests skip. |
All values are read at module import time; restart the server after changing them.
Docker
docker build -t newsdata-mcp .
docker run --rm -p 8000:8000 -e NEWSDATA_API_KEY=your_newsdata_api_key newsdata-mcp
Run in stdio mode:
docker run --rm -i -e NEWSDATA_API_KEY=your_newsdata_api_key newsdata-mcp --transport stdio
Pass a .env file:
docker run --rm -p 8000:8000 --env-file .env newsdata-mcp
The image is a multistage build: dependencies are installed from uv.lock in a python:3.12-slim builder, then the resulting venv plus LICENSE is copied into a fresh python:3.12-slim runtime. The container runs as a non-root app user.
Editor & Client Integrations
The simplest way is to add the server to your MCP client's JSON config. Each client picks up the config on restart. All examples use uvx, which downloads + caches the published package — no local clone required.
Claude Code
Either edit ~/.claude/mcp.json (global) or .claude/mcp.json (per-project):
{
"mcpServers": {
"newsdata-mcp": {
"command": "uvx",
"args": ["newsdata-mcp"],
"env": {
"NEWSDATA_API_KEY": "your_newsdata_api_key"
}
}
}
}
Then restart Claude Code.
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows) — same JSON block as above. Restart Claude Desktop.
Cursor
Create or edit .cursor/mcp.json in your project root (or ~/.cursor/mcp.json globally) — same JSON block. Restart Cursor; the server appears under Cursor Settings → MCP.
VS Code (GitHub Copilot)
Create .vscode/mcp.json in your workspace (or add an mcp key to user settings):
{
"servers": {
"newsdata-mcp": {
"type": "stdio",
"command": "uvx",
"args": ["newsdata-mcp"],
"env": {
"NEWSDATA_API_KEY": "your_newsdata_api_key"
}
}
}
}
Reload VS Code. Picked up by Copilot Chat in agent mode.
Windsurf
Edit ~/.codeium/windsurf/mcp_config.json — same JSON block as the Claude Code example. Restart Windsurf.
ChatGPT Desktop (OpenAI)
Run the server in HTTP mode locally:
NEWSDATA_API_KEY=your_key uvx newsdata-mcp \
--transport streamable-http --host 127.0.0.1 --port 8000
Then in ChatGPT → Settings → Connectors → Add custom connector, register http://127.0.0.1:8000/mcp as the connector endpoint.
Example Tool Calls
get_latest_news(
q="((pizza OR burger) AND healthy)",
country=["us", "gb"],
language="en",
size=10
)
get_archive_news(
q="ukraine war",
from_date="2025-01-01",
to_date="2025-01-31",
language="en"
)
get_crypto_news(
coin=["btc", "eth"],
sentiment="positive"
)
get_market_news(
symbol=["AAPL", "NVDA"],
country="us"
)
get_news_sources(
language="en",
priority_domain="top"
)
get_news_counts(
from_date="2024-01-01",
to_date="2024-01-31",
q="bitcoin",
interval="day"
)
get_market_counts(
from_date="2024-01-01",
to_date="2024-03-31",
symbol=["AAPL", "NVDA"],
interval="hour"
)
get_latest_news(
q="elections",
sentiment="positive",
sentiment_score=70
)
Notes on parameter shapes:
- CSV-style filters accept either a Python list (preferred) or a comma-separated string.
- Boolean flags accept
True/Falseor1/0. timeframeaccepts an integer for hours (e.g.24) or a string withmsuffix for minutes (e.g.90m).interval(count tools only) acceptshour,day, orall(allreturns a single aggregate count instead of buckets).sentiment_scoreis a 0–100 minimum confidence percentage and requiressentimentto also be set — e.g.sentiment="positive", sentiment_score=70returns only articles whose positive-sentiment score is at least 70.
Notes
- Latest, crypto, and market endpoints return recent coverage — typically up to 48 hours.
- Free plan results are delayed relative to paid plans.
- Result
sizeis capped by plan tier: commonly 10 results on free, up to 50 on paid plans. - The count endpoints return aggregate buckets (one per
intervalslot) rather than article content. - Every tool returns plain text (the MCP-protocol return type). Errors come back as
Error (HTTP 4xx): …with the status code and a friendly message; HTTP 429 errors include aretry after Nshint when the upstreamRetry-Afterheader was parseable.
Full API reference: https://newsdata.io/documentation.
Development
git clone https://github.com/newsdataapi/newsdata.io-mcp.git
cd newsdata.io-mcp
uv sync --all-groups # install runtime + dev deps
uv run pytest # unit tests only (default)
NEWSDATA_INTEGRATION_KEY=<key> uv run pytest -m integration # live-API tests
uv run pytest --cov=newsdata_mcp --cov-report=term-missing # with coverage
uv run ruff check src/ tests/
uv run mypy
CI (.github/workflows/ci.yml) runs the same four commands on every push/PR to main.
Releasing
- Bump
__version__insrc/newsdata_mcp/__init__.py. - Commit and tag:
git tag vX.Y.Z && git push --tags. .github/workflows/release.ymlbuilds the sdist + wheel, publishes to PyPI via Trusted Publishing (no token), and creates a GitHub Release with auto-generated notes.
One-time PyPI setup: configure a Trusted Publisher on the newsdata-mcp project pointing at newsdataapi/newsdata.io-mcp, workflow release.yml, environment pypi.
License
MIT. See the LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file newsdata_mcp-0.1.0.tar.gz.
File metadata
- Download URL: newsdata_mcp-0.1.0.tar.gz
- Upload date:
- Size: 97.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53c1fcace3bfd6a2671e7a6d3b5361e6039819d081bcc7f550e2599096eb78f6
|
|
| MD5 |
171e992701b5fdca6fba1dee7e4fd896
|
|
| BLAKE2b-256 |
c24001d8fe6440f375b3704bb33b90e4ea6eb4b137200223efac6baf5f76d1ce
|
Provenance
The following attestation bundles were made for newsdata_mcp-0.1.0.tar.gz:
Publisher:
release.yml on newsdataapi/newsdata.io-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
newsdata_mcp-0.1.0.tar.gz -
Subject digest:
53c1fcace3bfd6a2671e7a6d3b5361e6039819d081bcc7f550e2599096eb78f6 - Sigstore transparency entry: 1715570359
- Sigstore integration time:
-
Permalink:
newsdataapi/newsdata.io-mcp@dbd6268675395c9e2c02039440d7ec414d38d583 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/newsdataapi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@dbd6268675395c9e2c02039440d7ec414d38d583 -
Trigger Event:
push
-
Statement type:
File details
Details for the file newsdata_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: newsdata_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 37.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28bcd126727a50eda62deb60a308df721050c41e76097cf6e276c91d84cae5c8
|
|
| MD5 |
33d6720878c51490981557d93dd5d663
|
|
| BLAKE2b-256 |
2d673a0ee4e9c1bb9527a68e711d8099d8b5e9745e25551ad1719f16f0510dc1
|
Provenance
The following attestation bundles were made for newsdata_mcp-0.1.0-py3-none-any.whl:
Publisher:
release.yml on newsdataapi/newsdata.io-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
newsdata_mcp-0.1.0-py3-none-any.whl -
Subject digest:
28bcd126727a50eda62deb60a308df721050c41e76097cf6e276c91d84cae5c8 - Sigstore transparency entry: 1715570472
- Sigstore integration time:
-
Permalink:
newsdataapi/newsdata.io-mcp@dbd6268675395c9e2c02039440d7ec414d38d583 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/newsdataapi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@dbd6268675395c9e2c02039440d7ec414d38d583 -
Trigger Event:
push
-
Statement type: