> For the complete documentation index, see [llms.txt](https://docs.webz.io/llms.txt). Any docs page is also available as markdown at `https://docs.webz.io/markdown/<environment>/<slug>`.

# 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) |
| `include_syndicated` | include wire copies | default false |
| `webz_reporter` | include Webz Reporter posts | default false. A tool argument, not part of `q` |

Each `field` value is one credit. Comma-separated `field` runs multiple calls; wait **0.4 seconds** between calls. Webz allows 3 requests per second per endpoint on your token through this server.

## Agent skill

A skill is a short instruction file your AI agent reads so it knows when to call this tool, how to fill its arguments and how to read the results, without being told each time. [Install the `webz-seg-news` skill](https://docs.webz.io/docs/webz/skill-webz-seg-news), or read what it tells the agent:

### When to use

- The user asks who or what is mentioned most, which outlets covered a topic, or how sentiment splits.
- A list of headlines would not answer the question. For the articles themselves, use `search_webz_news`.

### How to call

- `q`: required Boolean query, same language as news search. A space means AND. `AND`, `OR`, and `NOT` are uppercase. Quote phrases (`"climate policy"`).
- `field`: what to count. Default `persons,organizations` runs both, as two requests. One field is one credit.
- `days`: lookback. Default 7. Maximum 31.
- `from_offset`: next page of buckets. A response has at most 10 buckets, up to 100 total.
- `include_syndicated`: default false.
- `webz_reporter`: default false. Its own argument. A `webz_reporter:` clause inside `q` does not include those posts.

### Fields

Pick the field the user asked about. Leave the default when they ask who and which companies.

- People and companies: `persons`, `organizations`. Sentiment splits: `person.positive`, `person.negative`, `person.neutral`, and the same three suffixes for `organization`.
- Places and markets: `locations`, `trading_symbol.ticker`, `trading_symbol.exchange`.
- Sources: `thread.site`, `thread.site_section`, `thread.country`, `author`, `language`.
- News-only buckets: `sentiment`, `category`, `topic`, `trust.bias`, `trust.category`, `trust.source.type`.

Language names inside `q` are lowercase (`language:english`). Country codes are ISO-2 (`country:US`).

"Who and which companies show up in English news about climate policy this week" -> `q`: `"climate policy" language:english`, `field`: `persons,organizations`, `days`: `7`.

### Using results

- Report the bucket name and its count. Say these are mention counts, not article counts, and name the query and the day window.
- Each comma-separated field is a separate call and costs 1 credit. Wait at least 0.4 seconds between calls. Do not call this tool in parallel.
- Ask for another page with the same `q`, `field`, and `days` plus the returned `from_offset` when the user wants more than the first 10 buckets.
- Zero buckets is a successful empty count. Retry once with a broader `q` or a different `field` before reporting that the topic has no counts.

## More detail

- [Segmentation API](https://docs.webz.io/docs/webz/news-blogs-forums-segmentation)
- [Query syntax](https://docs.webz.io/docs/webz/news-blogs-forums-query-syntax)

