Metadata-Version: 2.4
Name: google-news-trends-mcp
Version: 0.1.7
Summary: An MCP server to access Google News and Google Trends.
Author-email: Jesse Manek <jesse.manek@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/jmanek/google-news-trends-mcp
Project-URL: Repository, https://github.com/jmanek/google-news-trends-mcp
Project-URL: Issues, https://github.com/jmanek/google-news-trends-mcp/issues
Keywords: google,news,trends,mcp,fastmcp,llm,nlp,gnews,newspaper
Requires-Python: >=3.10.18
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: asyncio>=3.4.3
Requires-Dist: click>=8.2.1
Requires-Dist: cloudscraper>=1.2.71
Requires-Dist: fastmcp>=2.9.2
Requires-Dist: gnews>=0.4.1
Requires-Dist: googlenewsdecoder>=0.1.7
Requires-Dist: lxml[html-clean]>=6.0.0
Requires-Dist: newspaper4k>=0.9.3.1
Requires-Dist: nltk>=3.9.1
Requires-Dist: playwright>=1.53.0
Requires-Dist: pydantic>=2.11.7
Requires-Dist: pytest>=8.4.1
Requires-Dist: pytest-asyncio>=1.0.0
Requires-Dist: trendspy>=0.1.6
Dynamic: license-file

# Google News Trends MCP

An MCP server to access Google News and Google Trends.  Does not rely on any paid APIs.  

## Features

- Search Google News articles based on keyword, location, topic
- Get top news stories from Google News
- Google Trends keywords base on location
- Optional NLP to summarize articles and extract keywords

## Installation

### Using uv/uvx (recommended)

When using [`uv`](https://docs.astral.sh/uv/) no specific installation is needed. We will
use [`uvx`](https://docs.astral.sh/uv/guides/tools/) to directly run *google-news-trends-mcp*.

### Using PIP

```bash
pip install google-news-trends-mcp
```
After installation, you can run it as a script using:

```bash
python -m google_news_trends_mcp
```

## Configuration

### Configure for Claude.app

Add to your Claude settings:

<details>
<summary>Using uvx</summary>

```json
{
  "mcpServers": {
    "google-news-trends": {
      "command": "uvx",
      "args": ["google-news-trends-mcp"]
    }
  }
}
```
</details>

<details>
<summary>Using pip installation</summary>

```json
{
  "mcpServers": {
    "google-news-trends": {
      "command": "python",
      "args": ["-m", "google_news_trends_mcp"]
    }
  }
}
```
</details>

### Configure for VS Code

<details>
<summary>Using uvx</summary>

```json
{
  "mcp": {
    "servers": {
      "google-news-trends": {
        "command": "uvx",
        "args": ["google-news-trends-mcp"]
      }
    }
  }
}
```
</details>

<details>
<summary>Using pip installation</summary>

```json
{
  "mcp": {
    "servers": {
      "google-news-trends": {
        "command": "python",
        "args": ["-m", "google_news_trends_mcp"]
      }
    }
  }
}
```
</details>


## Tools

The following MCP tools are available:

| Tool Name                | Description                                                        |
|--------------------------|--------------------------------------------------------------------|
| **get_news_by_keyword**  | Search for news using specific keywords.                           |
| **get_news_by_location** | Retrieve news relevant to a particular location.                   |
| **get_news_by_topic**    | Get news based on a chosen topic.                                  |
| **get_top_news**         | Fetch the top news stories from Google News.                       |
| **get_trending_keywords**| Return trending keywords from Google Trends for a specified location.|

All of the news related tools have an option to summarize the text of the article using NLP (nltk)


## CLI
All tools can be accessed from the command line using `uv`

```bash
uv run google-news-trends
Usage: google-news-trends [OPTIONS] COMMAND [ARGS]...

  Find and download news articles using Google News.

Options:
  --help  Show this message and exit.

Commands:
  keyword   Find articles by keyword using Google News.
  location  Find articles by location using Google News.
  top       Get top news stories from Google News.
  topic     Find articles by topic using Google News.
  trending  Returns google trends for a specific geo location.
```

## Debugging

```bash
npx @modelcontextprotocol/inspector uvx google-news-trends-mcp
```

To run from within locally installed project

```bash
cd path/to/google/news/tends/mcp
npx @modelcontextprotocol/inspector uv run google-news-trends-mcp
```

## Testing

```bash
cd path/to/google/news/tends/mcp
python -m pytest
```
