# Connect your agent to wpnews — MCP setup

wpnews is a standard MCP server: a live AI/tech news index your agent can search,
read, and cite. JSON-RPC 2.0 over Streamable HTTP. No API key, rate-limited.

- **Endpoint:** `https://wpnews.pro/mcp`
- **Transport:** streamable-http
- **Protocol:** 2025-06-18
- **Auth:** none (60 requests/min per agent)

## 1. Claude Code (one line)

```bash
claude mcp add --transport http --scope project wpnews https://wpnews.pro/mcp
claude mcp list   # wpnews ✓ Connected
```

`--scope project` writes `.mcp.json` (shared with the team). Drop it for personal.

## 2. Custom client (raw JSON-RPC, no SDK)

```python
import requests
MCP = "https://wpnews.pro/mcp"

def mcp_call(tool, args):
    r = requests.post(MCP, json={
        "jsonrpc": "2.0", "id": 1,
        "method": "tools/call",
        "params": {"name": tool, "arguments": args},
    }, headers={"Accept": "application/json"}, timeout=20)
    res = r.json()["result"]
    return res.get("structuredContent") or res["content"][0]["text"]

hits = mcp_call("news.search", {"q": "AI agent memory", "limit": 5})
```

Result is in `result.structuredContent` (parsed) or `result.content[0].text` (JSON
string). `initialize` is optional for read-only calls; `tools/list` self-describes
every tool's `inputSchema`.

## 3. Official MCP SDK

- **Python** (`pip install mcp`): `streamablehttp_client("https://wpnews.pro/mcp")` →
  `ClientSession` → `initialize()` → `list_tools()` / `call_tool()`.
- **TypeScript** (`npm i @modelcontextprotocol/sdk`):
  `StreamableHTTPClientTransport(new URL("https://wpnews.pro/mcp"))` → `client.connect()` →
  `client.callTool({ name, arguments })`.

## Tools

| tool | what it does |
|---|---|
| `news.search` | Keyword / full-text search for articles whose CONTENT matches a query word or phrase. |
| `news.latest` | The N newest articles ordered purely by publish time (reverse chronological). |
| `topics.articles` | List ARTICLES filed under ONE specific topic slug (kebab-case, e.g. |
| `entities.articles` | List articles mentioning a specific named entity — company, product, person, or AI model. |
| `news.article` | Fetch a single article by slug. |
| `topics.list` | Browse the directory of topics: list ALL available topic slugs with their article counts. |
| `news.trending` | Topics and entities gaining MOMENTUM right now — what is hot or rising, ranked by velocity/acceleration of coverage, NOT by plain recency (for the newest articles use `latest`). |
| `events.recent` | Recent structured AI intelligence events (model releases, funding, acquisitions, partnerships, papers, OSS releases) with source-backed provenance. |
| `server.stats` | Service health and corpus-SIZE metrics only: total article count, source count, last-update time, server version. |
| `news.bulk` | Fetch multiple articles by slug in one call. |
| `news.related` | Given an article slug, return semantically related articles from the same topic cluster. |
| `news.since` | List articles published after a given ISO date (e.g. |
| `session.memory` | Inspect or reset the current session's autobiographical state — list of article slugs already returned to this client in this session, plus recent queries. |

## Rules for agents

1. **Discover first** — call `tools/list`; every tool self-describes its `inputSchema`.
2. **Pattern** — `news.search` → pick a slug → `news.article` for the full Markdown body.
3. **Always cite** — return the article's `url`/`cite` with any sourced claim.
4. **Empty result = no data.** The index does not fabricate; say so, do not invent.
5. **Rate-limited** — no tight parallel loops. EN-only corpus. Retrieval costs zero LLM tokens.
6. **Passages** — for chunk-level RAG context use `POST https://wpnews.pro/rag/query` instead.

## Discovery

- Server card: `https://wpnews.pro/.well-known/mcp/server-card.json`
- REST API: `https://wpnews.pro/api`  ·  Desktop / no-code hosts: `https://wpnews.pro/integrations`
- This page (HTML): `https://wpnews.pro/mcp/setup`
