> 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>`.

# MCP Server

Connect your AI client - Cursor, Claude, ChatGPT, or n8n - to Webz.io News Search. The client gets a `news_search_by_webz` tool and can search global news by itself.

```
https://news-search-mcp.webz.io/mcp
```

## Step 1: Get your API token

Don't have an account? [Sign up for free](https://app.webz.io/login/signup) to get your API token.

Log in at [webz.io](https://webz.io) and copy the API token from your dashboard. It is the same token you use for the News Search API.

## Step 2: 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-news-search": {
      "url": "https://news-search-mcp.webz.io/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_WEBZ_TOKEN"
      }
    }
  }
}
```

### Claude Desktop

Merge the same `webz-news-search` 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-news-search https://news-search-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://news-search-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. For the community node, standalone workflows, and ready-made templates, see the [n8n integration](https://docs.webz.io/docs/webz/news-search-api-n8n).

### Claude.ai and ChatGPT (web)

Add `https://news-search-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. Full step-by-step walkthroughs: [news-search-mcp.webz.io](https://news-search-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.

### Frameworks

Packages for LangChain, LlamaIndex, CrewAI, AG2 and Vercel AI SDK wrap this server, and Groq can call it directly. See [Framework SDKs](https://docs.webz.io/docs/webz/news-search-api-framework-sdks).

## Step 3: Try it

Ask your AI client naturally - mentioning "news" or "Webz" helps it pick the tool:

- "Search Webz news for recent developments on EU AI regulation and summarize with sources."
- "Use the Webz news tool to find coverage of trade agreements between Israel and Greece from the past week."
- "Call news_search_by_webz for 'renewable energy investments' with k=10 and days=30, then summarize."

## Tool reference

`news_search_by_webz`

| Parameter | Default | Description |
| --- | --- | --- |
| query | required | Natural-language topic or question |
| k | 10 | Articles to return (1-100) |
| days | 7 | How many days back to search |
| allow_all_dates | false | Search the full coverage window instead of `days` |
| score_gte | 4 | Minimum match score, 0-10 (set 0 to disable the floor) |
| score_lte | - | Maximum match score, 0-10 |
| domain | - | Only these source domains, e.g. cnn.com, yahoo.com |
| exclude_domain | - | Skip these source domains; a domain cannot be in both lists |
| language, country, sentiment, category | - | Same values as [Filters](https://docs.webz.io/docs/webz/news-search-api-filters); country codes are ISO-2 uppercase (US, GB) |
| topic | - | Topic tags (case-insensitive) |
| person, organization, location | - | Entity names (case-insensitive) |
| ticker | - | Stock ticker symbols, e.g. AAPL (case-insensitive) |
| political_bias | - | Source political bias: left, center, right |
| domain_rank_gte, domain_rank_lte | - | Source domain rank range (integers) |
| allow_multiple_chunks_per_article | false | When true, return more than one relevant chunk from the same article |

Each result returns the article title, URL, publish date, matching text excerpt, and metadata (`topic`, `person`, `organization`, `location`, `ticker`, `political_bias`, `domain_rank`).

Every tool call runs a regular News Search request with your token - the same credits and rate limits apply. See [Errors, Rate Limits & Credits](https://docs.webz.io/docs/webz/news-search-api-errors-limits).

## 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-news-search` skill](https://docs.webz.io/docs/webz/skill-webz-news-search), or read what it tells the agent:

### When to use

- The user asks about news, recent events, announcements, or coverage of a topic.
- Fresh, sourced information matters more than general knowledge.

### How to call

- `query`: a natural-language topic or question ("EU AI regulation progress"), not keyword syntax.
- The default window is the last 7 days. For older news pass `days` (up to 37) or `allow_all_dates: true` for the full indexed coverage window.
- `k`: articles to return - default 10, max 100. Raise it for broad research, lower it for a quick answer.
- `sort_by`: best_score (default), similarity, date_desc, or date_asc.
- `min_similarity`: optional semantic similarity floor, 0.4-1.0 (default 0.4).
- `trust_gte`: optional minimum source trust score, 0.0-1.0.
- `score_gte`: minimum match score, 0-10. Default 4. Set 0 to disable the floor.
- `score_lte`: optional maximum match score, 0-10.
- `allow_multiple_chunks_per_article`: default false. Set true only when the user wants more than one relevant excerpt from the same article.

### Filters (optional, values are case-insensitive)

- `language`: full names - english, chinese, hebrew, french, spanish, german, arabic, russian, japanese, korean.
- `country`: ISO-2 uppercase codes - "US", "GB", "DE", "IL".
- `sentiment`: positive, negative, neutral.
- `domain`: include only these sources - "cnn.com", "yahoo.com".
- `exclude_domain`: skip these sources - never put the same domain in both lists.
- `category`: one of 17 values - Arts, Culture and Entertainment; Crime, Law and Justice; Disaster and Accident; Economy, Business and Finance; Education; Environment; Health; Human Interest; Labor; Lifestyle and Leisure; Politics; Religion and Belief; Science and Technology; Social Issue; Sport; War, Conflict and Unrest; Weather.
- `topic`, `person`, `organization`, `location`: entity and topic names, e.g. organization: ["apple"], location: ["england"].
- `ticker`: stock tickers, e.g. ["AAPL"].
- `source_type`: local_news, newsroom, or gov_news. When the user asks for local news, set source_type to ["local_news"] and do not leave that only in the query text.
- `political_bias`: left, center, or right.
- `trust_category`: trust category labels.
- `domain_rank_gte` / `domain_rank_lte`: source domain rank range (integers).

Map the user's topic to the closest category ("stock market crash" -> Economy, Business and Finance). Skip filters the user did not imply. Map source requests too: "only from BBC" -> domain: ["bbc.com"]; "ignore Yahoo" -> exclude_domain: ["yahoo.com"]. "Apple earnings" -> ticker: ["AAPL"] and organization: ["apple"].

### Retry

- If a search with category or sentiment returns 0 results, retry once without those filters before giving up.

### Using results

- Each result has a title, URL, publish date, and text excerpt.
- Cite the article URLs in your answer.
- If results are empty, retry with `days: 37` or `allow_all_dates: true` and fewer filters before reporting nothing found.

## Keep your token safe

> [!WARNING]
> Never commit your token to git or put it in a URL.

Set it once as an environment variable and reference it from the config:

```json
"Authorization": "Bearer ${env:WEBZ_API_TOKEN}"
```

## Next steps

- Use [Framework SDKs](https://docs.webz.io/docs/webz/news-search-api-framework-sdks): [Python client](https://docs.webz.io/docs/webz/news-search-api-python), [LangChain](https://docs.webz.io/docs/webz/news-search-api-langchain), [LlamaIndex](https://docs.webz.io/docs/webz/news-search-api-llamaindex), [CrewAI](https://docs.webz.io/docs/webz/news-search-api-crewai), [AG2](https://docs.webz.io/docs/webz/news-search-api-ag2), [Vercel AI SDK](https://docs.webz.io/docs/webz/news-search-api-vercel-ai-sdk), [Groq](https://docs.webz.io/docs/webz/news-search-api-groq), [n8n](https://docs.webz.io/docs/webz/news-search-api-n8n), [Dify](https://docs.webz.io/docs/webz/news-search-api-dify), or [Apify](https://docs.webz.io/docs/webz/news-search-api-apify).
- Add the [Agent Skill](#agent-skill) so your agent knows when and how to search
- Review [Filters](https://docs.webz.io/docs/webz/news-search-api-filters) for all filter values

