LinkedIn Ads MCPのロゴ

LinkedIn Ads MCP

コミュニティ
danielpopamd

LinkedIn Ads MCP server with full write access: 25 tools across campaigns, creatives, audiences, conversions, and analytics. Create, update, and delete from Claude, ChatGPT, or Cursor. Self-hosted and free. Hosted version at adplug.app.

公開者danielpopamd
リポジトリlinkedin-ads-mcp
言語TypeScript
フォーク
11
スター
35
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    LinkedIn Ads MCPは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには35件のスターと11件のフォークがあります。

LinkedIn Ads MCP Server

License: MIT Node.js Version MCP Compatible

An MCP (Model Context Protocol) server that enables Claude AI to access and analyze your LinkedIn Ads data. Built for marketers, founders, and growth teams who want to leverage AI for campaign optimization, performance reporting, and data-driven advertising decisions.

[!TIP] Want this without any setup? From the same author: AdPlug is the hosted LinkedIn Ads MCP. Sign in with OAuth (no LinkedIn developer app, no credentials to manage), connect Claude, ChatGPT, or Cursor in about two minutes, and get Google Ads and Microsoft Ads on the same connector. Read tools are free; every write is previewed before it runs. This open-source server stays free and self-hosted.


Quick Install (No Coding Required!)

Don't want to deal with technical stuff? Just copy one of the prompts below and paste it into Claude. The AI will do everything for you!


Option 1: Install with Claude Code (Recommended)

If you have Claude Code installed, just copy and paste this entire prompt:

I want you to install the LinkedIn Ads MCP server so I can analyze my LinkedIn advertising data. Please do the following:

1. FIRST, check if Node.js is installed by running `node --version`. If not installed, tell me to install it from https://nodejs.org first.

2. Clone the repository to my home directory:
   - cd ~
   - git clone https://github.com/danielpopamd/linkedin-ads-mcp.git
   - cd linkedin-ads-mcp

3. Install dependencies and build:
   - npm install
   - npm run build

4. Create the .env file with placeholder values:
   - cp .env.example .env

5. NOW IMPORTANT - Ask me for my LinkedIn API credentials:
   - Ask: "Please provide your LinkedIn Client ID (from https://www.linkedin.com/developers/apps)"
   - Ask: "Please provide your LinkedIn Client Secret"

6. Update the .env file with the credentials I provide.

7. Set up Claude Desktop configuration:
   - Read the current Claude Desktop config file:
     - macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
     - Windows: %APPDATA%/Claude/claude_desktop_config.json
   - Add the linkedin-ads MCP server to mcpServers (merge with existing config if any):
     {
       "mcpServers": {
         "linkedin-ads": {
           "command": "node",
           "args": ["<FULL_PATH_TO>/linkedin-ads-mcp/dist/index.js"],
           "env": {
             "LINKEDIN_CLIENT_ID": "<MY_CLIENT_ID>",
             "LINKEDIN_CLIENT_SECRET": "<MY_CLIENT_SECRET>"
           }
         }
       }
     }
   - Replace <FULL_PATH_TO> with the actual path (e.g., /Users/username)
   - Replace the env values with my actual credentials

8. Run the authentication flow:
   - npm run auth
   - This will open my browser - tell me to authorize the app with LinkedIn

9. Tell me to restart Claude Desktop to activate the MCP server.

10. After restart, confirm setup by telling me to ask Claude: "List my LinkedIn ad accounts"

If you don't have my LinkedIn API credentials yet, first explain how to get them:
- Go to https://www.linkedin.com/developers/apps
- Create a new app (need a LinkedIn Company Page)
- Go to Products tab and request "Advertising API" access
- Go to Auth tab and add redirect URL: http://localhost:3000/callback
- Copy the Client ID and Client Secret

Start now!

Option 2: Install with Claude Desktop (Chat-Based)

If you're using Claude Desktop directly (without Claude Code), copy this prompt to start a guided setup:

I want to install the LinkedIn Ads MCP server to analyze my LinkedIn advertising data with Claude. I'm not technical, so please guide me step by step with simple instructions.

Please walk me through:

1. **Check Prerequisites**
   - Do I have Node.js installed? (Tell me how to check and where to download if needed)
   - Do I have a LinkedIn Developer App? (If not, guide me through creating one at https://www.linkedin.com/developers/apps)

2. **Get LinkedIn API Access**
   Walk me through:
   - Creating a LinkedIn Developer App
   - Requesting Advertising API access (Products tab)
   - Adding the redirect URL: http://localhost:3000/callback (Auth tab)
   - Finding my Client ID and Client Secret

3. **Download and Install**
   Give me the exact commands to run in my terminal (one at a time):
   - How to open Terminal (Mac) or Command Prompt (Windows)
   - Clone the repository
   - Install dependencies
   - Build the project

4. **Configure Claude Desktop**
   - Tell me exactly where the config file is located
   - Give me the exact JSON to add (with placeholders for my credentials)
   - Show me how to edit the file

5. **Authenticate with LinkedIn**
   - What command to run
   - What to do when the browser opens

6. **Test the Setup**
   - Tell me to restart Claude Desktop
   - Give me a test question to ask

Please start with step 1 and wait for my response before moving to the next step. Use simple language and assume I've never used a terminal before.

What You'll Need Before Installing

Before using either installation method, you'll need:

  1. Node.js (version 18 or higher) - Download here
  2. A LinkedIn Company Page - Required to create a developer app
  3. LinkedIn Developer App with Advertising API access - Create one here

Getting LinkedIn API Credentials (5-10 minutes)

  1. Go to LinkedIn Developer Portal
  2. Click "Create App"
  3. Fill in:
    • App name: "My LinkedIn Ads Analytics" (or anything you want)
    • LinkedIn Page: Select your company page
    • App logo: Upload any square image
  4. After creating, go to "Products" tab → Request "Advertising API" (approval takes 1-5 days)
  5. Go to "Auth" tab → Add redirect URL: http://localhost:3000/callback
  6. Copy your Client ID and Client Secret - you'll need these!

Created By

Daniel Popa - Performance Marketing Consultant & AI Automation Specialist

I help ambitious startups scale profitably through paid ads, conversion rate optimization, and data-driven growth strategies. With 10+ years in performance marketing and $100M+ in managed ad budgets, I now focus on implementing AI workflows and automation to improve marketing efficiency and performance.

This tool was built to bridge the gap between LinkedIn's advertising data and AI-powered analysis, making it easier for marketers to get actionable insights through natural language conversations with Claude.

  • Website: danielpopa.me
  • Focus: Performance Marketing, AI Automation, Growth Strategy

Manual Installation (For Developers)

If you prefer to install manually or want more control, follow the instructions below.


What This Does

This MCP server connects Claude Desktop (or any MCP-compatible client) to the LinkedIn Marketing API, allowing you to:

  • Query campaign performance using natural language
  • Analyze audience demographics to understand who's engaging with your ads
  • Track conversions and leads across your LinkedIn campaigns
  • Compare performance between time periods, campaigns, or campaign groups
  • Get AI-powered insights on your advertising data

Example Conversations with Claude

"Show me campaign performance for the last 30 days"
"Which job functions are responding best to my ads?"
"Compare this week's performance vs last week"
"What's my cost per lead for the lead gen campaigns?"
"Which creatives have the best CTR?"
"Show me the daily trend for conversions"

Features

  • 25 Specialized Tools - Covering accounts, campaigns, creatives, audiences, conversions, analytics, and full campaign management (create, update, delete)
  • Comprehensive Metrics - Every report includes: Spend, Impressions, Clicks, CTR, Reach, Frequency, Engagements, Engagement Rate, CPM, CPC, Conversions, Conversion Rate, Cost per Conversion, Audience Penetration, and Average Dwell Time
  • Single OAuth Authentication - Authenticate once and access all your LinkedIn ad accounts
  • Automatic Token Refresh - Tokens refresh automatically before expiration
  • Rate Limit Handling - Built-in exponential backoff for API rate limits
  • Human-Readable Names - Demographic data shows actual names (not IDs) for seniorities, job functions, industries, and more

Prerequisites

1. LinkedIn Developer App

Before using this MCP server, you need to set up a LinkedIn Developer application:

  1. Go to LinkedIn Developer Portal
  2. Click "Create App"
  3. Fill in your app details:
    • App name: e.g., "My LinkedIn Ads Analytics"
    • LinkedIn Page: Select your company page
    • App logo: Upload a logo (required)
  4. Note your Client ID and Client Secret

2. Request Advertising API Access

  1. In your app, go to the "Products" tab
  2. Select "Advertising API"
  3. Submit the request form with your business justification
  4. Wait for approval (typically 1-5 business days)

3. Configure OAuth

  1. Go to the "Auth" tab in your app
  2. Add this redirect URL: http://localhost:3000/callback
  3. Verify these OAuth 2.0 scopes are available:
    • r_ads - Read ad accounts
    • r_ads_reporting - Read reporting data
    • rw_ads - Create and manage campaigns, creatives, and ads
    • r_organization_social - Read organization posts (for creative content)

Installation

bash
# Clone the repository
git clone https://github.com/danielpopamd/linkedin-ads-mcp.git
cd linkedin-ads-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Create your environment file
cp .env.example .env

Edit .env with your LinkedIn credentials:

env
LINKEDIN_CLIENT_ID=your_client_id
LINKEDIN_CLIENT_SECRET=your_client_secret

Authentication

Run the authentication flow to get your access tokens:

bash
npm run auth

This will:

  1. Open your browser to LinkedIn's OAuth page
  2. Ask you to authorize the application
  3. Store your tokens locally in ~/.linkedin-ads-mcp/tokens.json
  4. Tokens are valid for 60 days and auto-refresh

Claude Desktop Setup

Add this to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

json
{
  "mcpServers": {
    "linkedin-ads": {
      "command": "node",
      "args": ["/full/path/to/linkedin-ads-mcp/dist/index.js"],
      "env": {
        "LINKEDIN_CLIENT_ID": "your_client_id",
        "LINKEDIN_CLIENT_SECRET": "your_client_secret"
      }
    }
  }
}

Important: Replace /full/path/to/linkedin-ads-mcp with the actual path where you cloned this repository.

After updating the config, restart Claude Desktop for the changes to take effect.


Available Tools

Account Management

ToolDescription
list_ad_accountsList all accessible LinkedIn ad accounts
get_account_detailsGet detailed account configuration and settings

Campaign & Creative Performance

ToolDescription
get_campaign_performanceCampaign metrics with all standard KPIs including audience penetration and average dwell time
get_creative_performanceAd-level metrics with engagement, video stats, and average dwell time
get_campaign_groupsList campaign groups with aggregated performance
list_campaignsList all campaigns including drafts and paused with zero impressions

Audience & Demographics

ToolDescription
get_audience_demographicsPerformance by job function, industry, seniority, company size, country, region
get_audience_reachUnique member reach, frequency, and native audience penetration metrics
list_saved_audiencesView matched and lookalike audiences

Conversions & Lead Generation

ToolDescription
get_conversion_performanceConversion metrics by conversion action
list_conversionsView conversion tracking rules and configuration
get_lead_gen_performanceLead form submissions and cost per lead
list_lead_formsView lead gen form configurations

Advanced Analytics

ToolDescription
compare_performanceCompare metrics between time periods or entities
get_daily_trendsDaily time-series data for trend analysis

Campaign Management (Write Operations)

ToolDescription
create_campaign_groupCreate a new campaign group for organizing campaigns
update_campaign_groupUpdate campaign group status, budget, name, or end date
delete_campaign_groupDelete a campaign group
create_campaignCreate a new campaign with targeting, budget, and objective
update_campaignUpdate campaign status, budget, targeting, or bid amount
delete_campaignDelete a campaign
create_creativeCreate a creative from an existing post/share
create_inline_adCreate an ad with inline content (text, image, CTA) in one call
update_creative_statusActivate, pause, or archive a creative
upload_imageUpload an image for use in ads (PNG, JPG, GIF)

Standard Metrics

Every performance report includes these metrics:

MetricDescription
SpendTotal cost in USD
ImpressionsNumber of times ads were shown
ClicksTotal clicks on ads
CTRClick-through rate (%)
ReachApproximate unique members reached
FrequencyAverage impressions per unique member
EngagementsTotal engagements (likes, comments, shares, etc.)
Engagement RateEngagements / Impressions (%)
CPMCost per 1,000 impressions
CPCCost per click
ConversionsTotal conversion events
Conversion RateConversions / Clicks (%)
Cost per ConversionSpend / Conversions
Audience PenetrationNative LinkedIn metric: unique members reached / total target audience size (%). Uses API-native value when available (≤92 day range), with client-side fallback
Average Dwell TimeAverage seconds users spent with >50% of ad pixels visible in viewport

API Limits & Best Practices

LinkedIn API Limits

  • Rate Limit: 45 million metric values per 5-minute window
  • Response Limit: Max 15,000 elements per response
  • Metrics per Request: Max 20 metrics
  • Demographic Data Delay: 12-24 hours
  • Reach Data: Max 92-day date range

Best Practices

  1. Start with account listing - Always list accounts first to get valid account IDs
  2. Use reasonable date ranges - Shorter ranges return faster; use 30 days for regular reporting
  3. Be specific with campaigns - Filter by campaign IDs when you know which campaigns to analyze
  4. Leverage comparisons - Use the compare tool to quickly identify performance changes

Project Structure

linkedin-ads-mcp/
├── src/
│   ├── index.ts              # MCP server entry point
│   ├── auth-cli.ts           # OAuth CLI tool
│   ├── auth/
│   │   ├── oauth.ts          # OAuth 2.0 flow
│   │   └── token-store.ts    # Secure token storage
│   ├── lib/
│   │   ├── linkedin-api.ts   # LinkedIn Marketing API client
│   │   └── types.ts          # TypeScript type definitions
│   └── tools/
│       ├── accounts.ts       # Account management tools
│       ├── performance.ts    # Campaign & creative performance
│       ├── demographics.ts   # Audience demographics tools
│       ├── conversions.ts    # Conversion & lead gen tools
│       ├── analytics.ts      # Advanced analytics tools
│       └── campaign-management.ts  # Campaign CRUD & image upload tools
├── dist/                     # Compiled JavaScript output
├── package.json
├── tsconfig.json
└── .env.example

Development

bash
# Build the project
npm run build

# Run the server (for testing)
npm run dev

# Run authentication flow
npm run auth

Troubleshooting

"Not authenticated" error

Run npm run auth to authenticate with LinkedIn.

"Rate limited" responses

The server automatically handles rate limits with exponential backoff. If you're hitting limits frequently, reduce the frequency of your requests.

Token expired

Tokens auto-refresh. If you're still having issues, delete ~/.linkedin-ads-mcp/tokens.json and re-authenticate with npm run auth.

API access denied

Ensure your LinkedIn Developer app has:

  1. The "Advertising API" product approved
  2. The correct OAuth scopes enabled (r_ads, r_ads_reporting)
  3. Your user account has access to the ad accounts you're trying to query

Campaign names showing as "Unknown"

This typically means the campaign ID from analytics doesn't match any campaign in your account. This can happen with archived campaigns or if there's a sync delay.


Tech Stack


Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


License

MIT License - see LICENSE file for details.


Acknowledgments

Built with the Model Context Protocol SDK by Anthropic.


Made with AI-powered workflows by Daniel Popa

LinkedIn Ads MCPのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度LinkedIn Ads MCPに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

LinkedIn Ads MCPをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. LinkedIn Ads MCPのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "linkedin-ads-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてLinkedIn Ads MCPのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. LinkedIn Ads MCPのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
LinkedIn Ads MCPを使ってこのタスクを手伝ってもらえますか?
LinkedIn Ads MCP
はい、読みました。
LinkedIn Ads MCPで調べた結果をお伝えします。

よくある質問

LinkedIn Ads MCP MCPサーバーは何に使いますか?

LinkedIn Ads MCPは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでLinkedIn Ads MCP MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでLinkedIn Ads MCPを利用できます。

TypingMindでLinkedIn Ads MCP MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。LinkedIn Ads MCPを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

LinkedIn Ads MCP MCPをTypingMindに接続するにはどうすればよいですか?

LinkedIn Ads MCPはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでLinkedIn Ads MCP MCPのどのようなツールを利用できますか?

LinkedIn Ads MCPはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

LinkedIn Ads MCP MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。LinkedIn Ads MCPで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇