OpenAds MCP
# OpenAds MCP
Provider-agnostic advertising intelligence for Claude, built on the Model Context Protocol.
Amazon Ads first. Google Ads and Meta Ads next. No platform-specific logic in the core.
## Status
Milestone 2: data layer. `sync_campaigns` stores a daily snapshot of campaigns in any
SQLAlchemy database. `get_campaigns` still reads mock data.
| Tool | What it does |
|---|---|
| `get_campaigns` | List campaigns for an account (mock data) |
| `sync_campaigns` | Snapshot today's campaigns into the database. Idempotent per UTC day |
## Configure
Copy `.env.example` to `.env`. The only setting today is `DATABASE_URL`:
| Database | URL |
|---|---|
| SQLite (default) | `sqlite:///./openads.db` |
| Local Postgres | `postgresql+psycopg://openads:PASSWORD@localhost:5432/openads` |
| Neon / Supabase | `postgresql+psycopg://user:pass@host/db?sslmode=require` |
Tables are created on first start.
## Run
```bash
pip install uv
uv sync
uv run pytest
OPENADS_TEST_POSTGRES_URL=postgresql+psycopg://... uv run pytest # also runs the Postgres test
uv run openads # starts the MCP server over stdio
```
## Architecture
```
Claude -> MCP tools (src/openads/mcp) -> analytics (src/openads/analytics)
-> provider adapters (src/openads/providers) -> Amazon / Google / Meta APIs
data layer (src/openads/data) persists snapshots
```
## Layout
One module per domain in every layer. Import from the package, never the module.
```
src/openads/
core/models/ Pydantic domain models
common.py Provider, Money
campaigns.py Campaign, CampaignMetrics
data/models/ SQLAlchemy tables (every module must be imported in __init__.py)
base.py Base and portability rules
campaigns.py CampaignSnapshot
data/repositories/ domain <-> row translation
campaigns.py CampaignSnapshotRepository
```
Adding a domain such as keywords: create `keywords.py` in each of the three
packages and export its classes from each `__init__.py`. `tests/test_structure.py`
fails if a table is not registered.
## License
MIT
TDQS
Scored across 2 tools
Both tools fetch campaigns for an account, so an agent must read descriptions carefully to know which to call. The distinction (read-only listing vs. persisting a daily snapshot) is stated but not strongly signposted in the names themselves.
Both tools follow a clean verb_noun snake_case pattern (get_campaigns, sync_campaigns). The verbs differ meaningfully, reinforcing the read vs. write distinction.
Two tools is thin for an advertising platform server, leaving little room for the read/write operations a campaign workflow typically needs. The pair is coherent but the surface feels under-scoped.
Only listing and snapshotting campaigns are covered; there is no create/update/delete for campaigns, no ad sets/ads/insights, and no account-level operations. Agents will hit dead ends for most real ad-management tasks.