unofficial-reddit-ads-mcp

unofficial-reddit-ads-mcp

Read-only MCP server for the Reddit Ads API v3, enabling AI assistants to analyze ad performance, campaigns, reports, and targeting without modifying anything.

Category
访问服务器

README

Reddit Ads MCP (Unofficial + Read-Only)

Read-only, analysis-first MCP server for the Reddit Ads API v3. Ask your AI assistant about your Reddit Ads performance — campaigns, subreddit-level breakdowns, reports, targeting — with a server that cannot modify anything.

Unofficial community project. Not affiliated with, endorsed, certified, or supported by Reddit, Inc. "Reddit" is a trademark of Reddit, Inc. You are responsible for your own compliance with Reddit's Ads API Terms and Developer Terms.

Why this exists

  • Permanently read-only. Requests only the adsread OAuth scope, and every outgoing API call must match a version-controlled allowlist of read operations (all 99 spec operations are explicitly classified; CI fails if a write becomes reachable). There is no write mode to misconfigure.
  • Single advertiser per deployment. You deploy it in your own Google Cloud project (or run it locally); your credentials never touch anyone else's infrastructure. A mandatory account allowlist blocks cross-account access.
  • Built for analysis. Flexible reports across ~450 metrics with up to 3 breakdown dimensions (COMMUNITY — i.e. subreddit — DATE, HOUR, COUNTRY, PLACEMENT, KEYWORD, and more), plus safety ceilings so an AI client loop can't burn your rate limits or your wallet.
  • Personal-use cost profile. Scale-to-zero Cloud Run, max 1 instance; normal personal use lands at ~$0/month.

Tools (15)

Structure: list_ad_accounts · list_campaigns · list_ad_groups · list_ads

Reporting: get_report · get_daily_performance

Analysis: compare_periods · rank_performance · analyze_trends · analyze_pacing · analyze_conversions · analyze_video · analyze_creatives · get_creative_context · get_account_history

Resources: reddit-ads://report-fields, reddit-ads://capabilities. Phase 3 (diagnostics + targeting intelligence) is planned — see PLAN.md; live-API quirks are documented in docs/API_NOTES.md.

Getting started — pick your path

🟢 Path A: "I've never installed an MCP server or used Google Cloud"

Follow docs/BEGINNER_GUIDE.md — a complete, copy-paste walkthrough from zero to asking Claude about your ads (~40 min, ~$0/month). It assumes nothing and explains what you should see at every step.

🔵 Path B: Advanced (you know your way around a terminal)

  1. Reddit credentials (~10 min): create a developer app in Reddit Ads Manager (Developer Applications, redirect URI http://localhost:8912/callback), authorize with scope=adsread

    • duration=permanent, exchange the code for a refresh token — condensed steps in docs/AUTHENTICATION.md. Grab your a2_… ad account ID from the Ads Manager account switcher.
  2. Deploy to your own Cloud Run (~15 min): follow docs/DEPLOY_GCP.md — Secret Manager for the four secrets, dedicated least-privilege service account, gcloud builds submit + gcloud run deploy with the personal-use cost profile (scale-to-zero, max 1 instance), and a billing alert.

  3. Or run locally over stdio (no cloud at all):

    pip install .
    

    Claude Code / Claude Desktop config:

    "reddit-ads": {
      "type": "stdio",
      "command": "reddit-ads-mcp",
      "env": {
        "REDDIT_CLIENT_ID": "…",
        "REDDIT_CLIENT_SECRET": "…",
        "REDDIT_REFRESH_TOKEN": "…",
        "REDDIT_USER_AGENT": "desktop:unofficial-reddit-ads-mcp:0.2.1 (by /u/you)",
        "ALLOWED_ACCOUNT_IDS": "a2_youraccount"
      }
    }
    
  4. Connect: claude.ai custom connector (secret-path mode URL) or any header-capable MCP client (bearer mode). Details below.

Before you rely on the numbers, read docs/API_NOTES.md — the live API differs from its own spec in ways that matter (unit scaling, keyword-report lookback, pagination semantics). This server compensates for all of them, with formulas returned alongside every derived value.

Remote authentication (pick exactly one)

Mode Use when How
bearer (default) Your MCP client can send headers (Claude Code, API) Authorization: Bearer <MCP_ACCESS_TOKEN> on /mcp
secret_path Client cannot send custom headers (claude.ai custom connectors) Endpoint served at /<MCP_PATH_SECRET>/mcp; /mcp returns 404

Secret-path mode treats the URL as the credential: it can appear in client settings, browser history, and infrastructure logs. Generate it with python3 -c "import secrets; print(secrets.token_urlsafe(32))", rotate it periodically, and prefer bearer mode when possible.

Safety & privacy properties

  • Only adsread; startup fails if the token grant includes write scopes.
  • Exact-match operation allowlist; pagination URLs are validated (HTTPS, host, path family) before being followed.
  • Mandatory ALLOWED_ACCOUNT_IDS; every tool call re-checks the account.
  • Rate/loop safeguards: 60 tool calls per rolling hour, 20 upstream requests per call, duplicate-call suppression, 90-day report ceiling, bounded rows, pages, and response size.
  • No database, no persistent cache, no payload logging. Report rows and entity names never appear in logs.

Data disclosure note: this server returns your advertising metrics to the MCP client you connect — typically a hosted AI assistant. Review your AI provider's data handling and your own obligations under Reddit's terms before connecting a production account. Do not share one deployment across unrelated advertisers, and do not use returned data to train models without the necessary permissions.

Development

pip install -e ".[dev]"
python3 -m unittest discover tests      # or: pytest
python3 scripts/check_openapi_drift.py  # spec/registry drift gate

The pinned OpenAPI spec lives in openapi/ with its checksum. Any spec update requires reclassifying changed operations and regenerating the registry in the same commit — CI enforces this.

License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选