# News Segmentation MCP

**Count** mentions in **news** instead of returning articles. One tool: `aggregate_webz_news`.

## MCP endpoint

```text
https://seg-news-mcp.webz.io/mcp
```

## How it works

You ask who or what shows up most around a topic. The assistant calls `GET /seg_api/news` with `q`, `field`, and `days`. The reply is **bucket counts**, not excerpts.

Default when `field` is omitted: often **persons** and **organizations** (two API calls).

## Connect your client

Replace `YOUR_WEBZ_TOKEN` with your token.

### Cursor

Add this to `~/.cursor/mcp.json` (`%USERPROFILE%\.cursor\mcp.json` on Windows) and restart Cursor:

```json
{
  "mcpServers": {
    "webz-seg-news": {
      "url": "https://seg-news-mcp.webz.io/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_WEBZ_TOKEN"
      }
    }
  }
}
```

Same **news** token as News MCP. Setup: `https://seg-news-mcp.webz.io/`.

### Claude Desktop

Merge the same `webz-seg-news` entry into your Claude Desktop config file - do not replace the whole file - then restart Claude Desktop:

| OS | Config file |
| --- | --- |
| macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
| Linux | `~/.config/Claude/claude_desktop_config.json` |
| Windows | `%APPDATA%\Claude\claude_desktop_config.json` |

### Claude Code

Run in your project root:

```bash
claude mcp add --transport http webz-seg-news https://seg-news-mcp.webz.io/mcp --header "Authorization: Bearer YOUR_WEBZ_TOKEN"
```

### n8n

Add an **MCP Client Tool** node and connect it to an **AI Agent** node's **Tool** input:

| Field | Value |
| --- | --- |
| Endpoint | `https://seg-news-mcp.webz.io/mcp` |
| Server Transport | `HTTP Streamable` |
| Authentication | `Bearer Auth` |
| Tools to Include | `All` |

Create a **Bearer Auth** credential and paste your Webz.io API token as the bearer token. The agent receives a `aggregate_webz_news` tool.

### Claude.ai and ChatGPT (web)

Add `https://seg-news-mcp.webz.io/mcp` as a custom connector (Claude.ai: Settings > Connectors; ChatGPT: Settings > Apps & Connectors with Developer mode on). Both use OAuth: leave Client ID and Secret empty, then paste your Webz token on the authorize page. Setup instructions for every client are at [seg-news-mcp.webz.io](https://seg-news-mcp.webz.io/).

> [!NOTE]
> Opening the `/mcp` endpoint in a browser returns `401 Unauthorized` by design - browsers do not send your token. Use an MCP client.

## End-to-end example

### 1. What you ask

> In English news this week, who and which companies are mentioned most around climate policy?

### 2. What the assistant calls

Tool: `aggregate_webz_news` (twice if `field` lists both, or one call per field)

| Argument | Value |
|----------|--------|
| `days` | `7` |
| `q` | `"climate policy" language:english` |
| `field` | `persons` then `organizations` (or `persons,organizations`) |

### 3. What the MCP tool returns

```text
Query: "climate policy" language:english
Field: persons
Buckets: 100
- donald trump: 42
- greta thunberg: 28
- joe biden: 19
- ursula von der leyen: 15
- antonio guterres: 12
(... up to 10 buckets per response; use from_offset for more ...)

Query: "climate policy" language:english
Field: organizations
Buckets: 100
- european commission: 37
- united nations: 31
- exxonmobil: 22
- shell: 18
- tesla: 14
```

### 4. What you see from the assistant

> For English news over the past 7 days on "climate policy", the most-mentioned **people** include political leaders and activists (Trump, Thunberg, Biden among the top buckets). The most-mentioned **organizations** include the European Commission, the UN, and several energy companies. These are mention counts, not article lists. I can pull actual articles with the News MCP if you want headlines and links.

## Tool parameters (simple view)

| Parameter | You usually say… | What the tool does |
|-----------|------------------|-------------------|
| `q` | topic, language, country | same boolean language as news search |
| `field` | "by person", "by company" | aggregation dimension |
| `days` | "this week" | lookback (default 7, max 31) |

Each `field` value is one credit. Comma-separated `field` runs multiple calls; wait **1 second** between calls.

## More detail

- [Segmentation API](news-blogs-forums-segmentation)
- [Query syntax](news-blogs-forums-query-syntax)

