# Influ2 MCP Server

MCP server for the [Influ2](https://www.influ2.com) Person-Based Advertising platform — manage campaigns, audiences, and creatives through natural language via Claude.

## What You Can Do

- **List & manage clients** — see your Influ2 accounts
- **Create campaigns** — set up cohort bundles with targets and creatives in one call
- **Manage audiences** — add, update, or remove specific people (targets) from campaigns
- **Upload creatives** — images and videos via URL, base64, or file upload
- **Create ads** — social (single-image, carousel, video), native, and display banner ads
- **Track performance** — get impressions, clicks, CTR, reached targets, and buying group metrics
- **Monitor operations** — check async job status for long-running operations

## Quick Start

### 1. Get Your API Key

Get your Influ2 API key from your account settings.

### 2. Configure Claude Desktop

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "influ2": {
      "command": "uvx",
      "args": ["influ2-mcp"],
      "env": {
        "INFLU2_API_KEY": "your-api-key-here",
        "INFLU2_CLIENT_ID": "optional-default-client-id"
      }
    }
  }
}
```

### 3. Start Using

Ask Claude things like:
- "What clients do I have in Influ2?"
- "Show me my active campaigns"
- "How is my ABM campaign performing?"
- "Add these people to the enterprise cohort"
- "Upload this image and create a social ad"

## Tools

| Tool | Description |
|------|-------------|
| `influ2_list_clients` | List all accessible client accounts |
| `influ2_create_client` | Create a new client account (admin) |
| `influ2_list_cohorts` | List campaign audience segments |
| `influ2_get_cohort_details` | Get full campaign details + metrics + content |
| `influ2_create_cohort` | Create a complete campaign (cohort + targets + content) |
| `influ2_manage_targets` | Add, update, or remove people in campaigns |
| `influ2_list_contents` | List and inspect ad creatives |
| `influ2_add_content` | Add new ads to campaigns |
| `influ2_list_asset_templates` | See required image/video specifications |
| `influ2_upload_asset` | Upload images or videos for use in ads |
| `influ2_check_job` | Check status of async operations |

## Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `INFLU2_API_KEY` | Yes | Bearer token for the Influ2 API |
| `INFLU2_CLIENT_ID` | No | Default client ID (skips discovery) |
| `INFLU2_BASE_URL` | No | API base URL (default: `https://v2-api.influ2.com`) |
| `INFLU2_POLL_TIMEOUT` | No | Async job poll timeout in seconds (default: 120) |

## Development

```bash
git clone <repo-url>
cd influ2-mcp
uv sync --extra dev
INFLU2_API_KEY=your-key uv run fastmcp dev src/influ2_mcp/server.py
```

## License

MIT
