# MCP Server

Connect your AI client - Cursor, Claude, or ChatGPT - 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
```

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

## Step 1: 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"
```

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

## 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-50) |
| days | 7 | How many days back to search |
| allow_all_dates | false | Search the full coverage window instead of `days` |
| language, country, sentiment, category | - | Same values as [Filters](news-search-api-filters); country codes are ISO-2 uppercase (US, GB) |

Each result returns the article title, URL, publish date, and the matching text excerpt.

## 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

- Add the [Agent Skill](news-search-api-skill) so your agent knows when and how to search
- Review [Filters](news-search-api-filters) for all filter values

