Metadata-Version: 2.4
Name: clearview-politics-mcp
Version: 0.1.0
Summary: MCP server for the Clearview Politics API — real-time, nonpartisan political news for AI agents
License-Expression: MIT
Keywords: mcp,politics,news,ai,clearview
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: mcp>=1.0.0
Requires-Dist: httpx>=0.28.0
Requires-Dist: pydantic>=2.0.0

# Clearview Politics MCP Server

An MCP (Model Context Protocol) server that exposes the [Clearview Politics API](https://clearviewpolitics.com/api) as tools for AI agents. Connect any MCP-compatible client — Claude Desktop, Cursor, Windsurf, or your own agent — to real-time, nonpartisan political news synthesized from 26+ sources, complete with bias auditing, cross-source analysis, deep story analysis with falsifiable predictions, legislation tracking, and an on-demand political analyst you can query in natural language.

---

## Installation

### From source (development)

```bash
cd /path/to/clearview-politics/mcp-server
pip install .
```

This installs the `clearview-mcp` CLI entry point.

### From PyPI (when published)

```bash
pip install clearview-politics-mcp
```

---

## Configuration

### Required

| Variable | Description |
|---|---|
| `CLEARVIEW_API_KEY` | Your Clearview Politics API key. Get one at [clearviewpolitics.com/api](https://clearviewpolitics.com/api). |

### Optional

| Variable | Default | Description |
|---|---|---|
| `CLEARVIEW_BASE_URL` | `https://clearviewpolitics.com` | Override the API base URL (useful for staging environments). |

---

## Claude Desktop

Add the following to your `claude_desktop_config.json` (usually at `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):

```json
{
  "mcpServers": {
    "clearview-politics": {
      "command": "clearview-mcp",
      "env": {
        "CLEARVIEW_API_KEY": "your_key_here"
      }
    }
  }
}
```

Restart Claude Desktop after saving.

---

## Cursor

In Cursor, open **Settings → MCP** and add a new server entry:

```json
{
  "clearview-politics": {
    "command": "clearview-mcp",
    "env": {
      "CLEARVIEW_API_KEY": "your_key_here"
    }
  }
}
```

---

## Other MCP Clients

Any client that supports the MCP stdio transport can use this server. Point your client at the `clearview-mcp` command and pass `CLEARVIEW_API_KEY` in the environment.

If you need to run it directly without the installed entry point:

```bash
CLEARVIEW_API_KEY=your_key_here python -m clearview_mcp.server
```

---

## Available Tools

### `get_daily_brief`

Get today's Daily Brief — an AI-synthesized editorial overview, key bullet points, and story summaries pulled from 26+ nonpartisan sources. No input required.

---

### `list_stories`

List the latest synthesized political stories. Stories are cross-referenced across multiple outlets and bias-audited before publication.

**Parameters:**

| Name | Type | Description |
|---|---|---|
| `category` | string (optional) | Filter by category: `congress`, `white_house`, `scotus`, `economy`, or `foreign_policy` |
| `page` | integer (optional, 1–10) | Page number. Default: 1 |
| `per_page` | integer (optional, 1–50) | Results per page. Default: 10 |

---

### `get_story`

Retrieve the full details of a specific story — summary, analysis, multiple political perspectives, ripple effects and downstream implications, and a full source breakdown with bias ratings.

**Parameters:**

| Name | Type | Description |
|---|---|---|
| `story_id` | string (required) | UUID of the story (from `list_stories`) |

---

### `get_story_analysis`

Deep-dive political analysis for a story. Returns historical context, power dynamics between key actors, and falsifiable predictions with confidence levels and timeframes.

**Parameters:**

| Name | Type | Description |
|---|---|---|
| `story_id` | string (required) | UUID of the story to analyze |

---

### `search_legislation`

Search tracked federal and state legislation. Returns matching bills with current status, sponsor information, impact scores, and AI-generated plain-language impact analysis.

**Parameters:**

| Name | Type | Description |
|---|---|---|
| `q` | string (optional) | Search query — bill title, number, or keywords |
| `level` | string (optional) | `federal` or `state` |
| `page` | integer (optional) | Page number. Default: 1 |

---

### `ask_analyst`

Ask the Clearview Analyst a question about current political developments. The analyst has full access to all stories from the past 7 days and answers in a nonpartisan, fact-based style. Supports multi-turn conversations via an optional `session_id`.

**Parameters:**

| Name | Type | Description |
|---|---|---|
| `question` | string (required) | Your question for the analyst |
| `session_id` | string (optional) | Reuse a session ID to continue a prior conversation |

---

## Rate Limits

Rate limits depend on your API plan. The server does not implement client-side throttling — if you hit a rate limit, the API will return a `429` status and the tool will surface a clear error message. Check your plan details at [clearviewpolitics.com/api](https://clearviewpolitics.com/api).

---

## Links

- API documentation: [https://clearviewpolitics.com/api](https://clearviewpolitics.com/api)
- MCP specification: [https://modelcontextprotocol.io](https://modelcontextprotocol.io)
