Reddit Ads MCP

السجل الرسمي التسويق والمبيعات

MCP server for the Reddit Ads API. List accounts, campaigns, ads, and pull reports.

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

NUGET package RedditAdsMcp
Claude Code
claude mcp add reddit-ads-mcp -e 'REDDIT_CLIENT_ID=<REDDIT_CLIENT_ID>' -e 'REDDIT_CLIENT_SECRET=<your reddit_client_secret>' -e 'REDDIT_REFRESH_TOKEN=<your reddit_refresh_token>' -e 'REDDIT_ACCOUNT_ID=<REDDIT_ACCOUNT_ID>' -- dnx RedditAdsMcp@1.1.1 --yes
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "reddit-ads-mcp": {
            "command": "dnx",
            "args": [
                "RedditAdsMcp@1.1.1",
                "--yes"
            ],
            "env": {
                "REDDIT_CLIENT_ID": "<REDDIT_CLIENT_ID>",
                "REDDIT_CLIENT_SECRET": "<your reddit_client_secret>",
                "REDDIT_REFRESH_TOKEN": "<your reddit_refresh_token>",
                "REDDIT_ACCOUNT_ID": "<REDDIT_ACCOUNT_ID>"
            }
        }
    }
}

متغيرات البيئة

  • REDDIT_CLIENT_ID إلزامي Reddit app client ID
  • REDDIT_CLIENT_SECRET إلزامي سري Reddit app client secret
  • REDDIT_REFRESH_TOKEN إلزامي سري OAuth refresh token
  • REDDIT_ACCOUNT_ID إلزامي Default Reddit ad account ID

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. RedditAdsMcp
  2. Available Tools
  3. Prerequisites
  4. Install
  5. Setup
  6. Development
  7. License

RedditAdsMcp

A C# MCP (Model Context Protocol) server for the Reddit Ads API. Provides read-only tools for listing accounts, campaigns, ad groups, ads, and pulling performance reports.

Built with .NET 10 and the official ModelContextProtocol SDK.

Available Tools

ToolDescription
ListAccountsList all Reddit ad accounts accessible with current credentials
ListCampaignsList campaigns for an account
ListAdGroupsList ad groups, optionally filtered by campaign
ListAdsList ads, optionally filtered by ad group
GetPerformanceReportGet a performance report with custom date range, fields, and breakdowns
GetDailyPerformanceConvenience wrapper — last N days of impressions, clicks, spend, CTR, CPC, eCPM

All tools accept an optional accountId parameter. If omitted, the default account from REDDIT_ACCOUNT_ID is used.

Prerequisites

  1. A Reddit account with an active Reddit Ads advertiser account
  2. .NET 10 SDK

Install

dotnet tool install -g RedditAdsMcp

Then configure Claude Code (see Step 5b below).

Option B: Clone and build from source
git clone https://github.com/mkerchenski/RedditAdsMcp.git
cd RedditAdsMcp
dotnet build

Then configure Claude Code (see Step 5a below).

Setup

1. Create a Reddit Ads API App
  1. Go to ads.reddit.com
  2. In the left sidebar, click Developer Applications (under your account/business settings)
  3. Click Create a new app and fill in:
FieldValue
App nameReddit Ads MCP
DescriptionMCP server for Reddit Ads reporting
About urlhttps://github.com/mkerchenski/RedditAdsMcp (or leave blank)
Redirect URIhttps://hurrah.dev/oauth/reddit

Reddit requires a public HTTPS redirect URI (localhost won't work). The URL above is a simple callback page maintained by the package author that displays the authorization code for you to copy — it does not store any data. You can use any HTTPS URL you control instead; just update the redirect URI in Steps 2–3 to match.

  1. Click Create app
  2. Copy your App ID and Secret — you'll need both in the next steps
2. Authorize the App

Open this URL in your browser, replacing YOUR_APP_ID with the App ID from Step 1:

https://www.reddit.com/api/v1/authorize?client_id=YOUR_APP_ID&response_type=code&state=mcp&redirect_uri=https%3A%2F%2Fhurrah.dev%2Foauth%2Freddit&duration=permanent&scope=adsread

Click Allow. You'll be redirected to a page that displays your authorization code — click Copy.

3. Exchange the Code for a Refresh Token

Run this command, replacing the three placeholders with your App ID, Secret, and authorization code:

curl -X POST https://www.reddit.com/api/v1/access_token \
  -u "YOUR_APP_ID:YOUR_SECRET" \
  -A "ads-mcp/1.0" \
  -d "grant_type=authorization_code&code=YOUR_AUTHORIZATION_CODE&redirect_uri=https://hurrah.dev/oauth/reddit"

The redirect_uri must match exactly what you entered in Step 1.

The response JSON contains a refresh_token field. Save it — it's permanent until revoked.

4. Find Your Account ID
  1. Go to ads.reddit.com and click All accounts (top-left dropdown)
  2. Select your business on the left — your ad account appears on the right
  3. The account ID is the value under the account name (e.g. a2_eaf73mplhhps)
5a. Configure Claude Code (from source)

Add to your Claude Code MCP settings (.mcp.json in your project, or ~/.claude/settings.json), replacing the four placeholder values:

"reddit-ads": {
  "type": "stdio",
  "command": "dotnet",
  "args": ["run", "--project", "/path/to/RedditAdsMcp", "--no-build"],
  "env": {
    "REDDIT_CLIENT_ID": "your_app_id",
    "REDDIT_CLIENT_SECRET": "your_secret",
    "REDDIT_REFRESH_TOKEN": "your_refresh_token",
    "REDDIT_ACCOUNT_ID": "your_account_id"
  }
}
5b. Configure Claude Code (dotnet tool)
"reddit-ads": {
  "type": "stdio",
  "command": "reddit-ads-mcp",
  "env": {
    "REDDIT_CLIENT_ID": "your_app_id",
    "REDDIT_CLIENT_SECRET": "your_secret",
    "REDDIT_REFRESH_TOKEN": "your_refresh_token",
    "REDDIT_ACCOUNT_ID": "your_account_id"
  }
}

Verify with /mcp in Claude Code — the reddit-ads server should appear with 6 tools.

Development

dotnet build    # compile
dotnet run      # start MCP server on stdio
dotnet pack     # create NuGet package

License

MIT

الأسئلة الشائعة

ما هو Reddit Ads MCP؟

MCP server for the Reddit Ads API. List accounts, campaigns, ads, and pull reports.

كيف أثبّت Reddit Ads MCP؟

يعمل على جهازك. في Claude Code: claude mcp add reddit-ads-mcp -e 'REDDIT_CLIENT_ID=<REDDIT_CLIENT_ID>' -e 'REDDIT_CLIENT_SECRET=<your reddit_client_secret>' -e 'REDDIT_REFRESH_TOKEN=<your reddit_refresh_token>' -e 'REDDIT_ACCOUNT_ID=<REDDIT_ACCOUNT_ID>' -- dnx RedditAdsMcp@1.1.1 --yes. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج Reddit Ads MCP إلى مفتاح API؟

نعم. يتطلب REDDIT_CLIENT_ID, REDDIT_CLIENT_SECRET, REDDIT_REFRESH_TOKEN, REDDIT_ACCOUNT_ID، وتضبطها في إعداداته.

هل Reddit Ads MCP مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون Reddit Ads MCP؟

ينشره mkerchenski. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.