What the News Sentiment API MCP server does
The News Sentiment API MCP server provides access to Trends API measurements for the news sentiment source. It lets an agent request a sentiment time series for a keyword, compare sentiment growth across time windows, and retrieve top-trend results. Example keywords can be phrases such as nvidia, but the API accepts any phrase supported by the upstream service.
Time-series responses contain dated values on a 0–100 index for the requested series. Each point includes the queried keyword and date, while absolute volume and pipeline labels may be available depending on the result. Growth responses identify the search term and source, then return one result for each requested period with growth, direction, dates, and values.
The News Sentiment API MCP server is intended for trend analysis rather than article-level classification. It does not provide per-article sentiment labels or an outlet breakdown. A negative growth result means that the measured tone declined compared with the earlier period; it does not mean the company or topic is inherently negative.
How it works
Requests are sent to the Trends API endpoint at https://api.trendsapi.ai/api as JSON POST requests. Authentication uses a bearer token supplied through TRENDSAPI_KEY. The news sentiment history operations use the news sentiment source and either the get_time_series or get_growth mode.
Growth comparisons can use presets such as 7D, 30D, 3M, 12M, YTD, and 5Y. A custom comparison can instead provide a name, recent date, and baseline date. Multiple comparison windows count as one request. Each successful asynchronous call counts as one billed request.
The documented Python package exposes synchronous and asynchronous clients. Python responses use typed objects and dataclasses, so time-series values are accessed with properties such as .date and .value, while growth results use properties such as .results[0].growth and .results[0].direction.
Setup and configuration
Install the documented Python package with pip install trendsapi-news-sentiment, then set TRENDSAPI_KEY to a key obtained from trendsapi.ai. Python 3.9 or newer is required. The same key is used by the HTTP API and the Python client; alternatively, the client can receive the key directly as an argument.
The News Sentiment API MCP server uses lowercase news sentiment for the source. Requests using an incorrect source or an incompatible type can return HTTP 400. A missing or invalid key produces HTTP 401, while HTTP 404 indicates that no series exists for the keyword and should not be retried.
Tools and capabilities
- Retrieve a keyword sentiment history with
get_time_series.
- Compare sentiment across preset or custom periods with
get_growth.
- Request top-trend data with
get_top_trends.
- Run equivalent requests through the asynchronous Python client.
- Convert returned time-series dataclasses into pandas data for date parsing and resampling.
- Call the underlying REST endpoint directly with a bearer token and JSON payload.
Limitations and notes
The News Sentiment API MCP server depends on the Trends API key, quota, and upstream response availability. HTTP 429 indicates that the quota was exceeded. Server-side 5xx errors are retried by the documented client before it raises an error; raw HTTP callers must handle failures themselves.
The raw HTTP response places the body field in a JSON string, so direct curl users must decode that field separately. The SDKs perform that decoding. The material documents the Trends API, its Python package, and HTTP contract, but does not specify an MCP transport, client-specific setup, or a separate MCP installation command.