# LinkedIn Ads MCP

> LinkedIn Ads MCP Server accesses your professional ad accounts through the LinkedIn REST API. Your AI client uses this server to list campaigns, monitor real-time performance metrics (clicks, impressions, spend), and retrieve conversion data directly from natural language commands. It handles everything from listing ad accounts via `list_ad_accounts` to querying deep analytics with `get_ad_analytics`. This is the single point for all your paid LinkedIn marketing reporting.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** ad-campaigns, performance-reporting, lead-generation, marketing-analytics, conversion-tracking, b2b-marketing

## Description

Look, you don't need to wrestle with the LinkedIn API or write some complicated script just to see what your paid ads are doing. This server handles all that crap for you. It lets your AI client connect directly to your professional ad accounts, acting like a single pane of glass for every dollar you spend on LinkedIn marketing.

First thing's first: You gotta know which accounts we’re talking about. The `list_ad_accounts` tool pulls up every single accessible LinkedIn Ad Account ID and tells you its current status. It gives your agent the full scope, so you don't waste time guessing which account to check.

Once you have an account ID, you can drill down into what’s running inside it. Using `list_ad_campaigns`, your agent queries everything—it lists every active and past campaign group, as well as individual campaigns tied to that specific ad account. This isn't just a list; it gives you the structure of your whole paid marketing effort.

But knowing the campaigns aren't enough. You gotta see what ads are actually running. The `list_ad_creatives` tool pulls up all the actual creative assets—the images, the copy, and all the technical settings for the specific ad variations used across those campaigns. It’s where you check if your team is using outdated graphics or stale messaging.

Now for the money part: performance tracking. You use `get_ad_analytics` to query real-time data on what's happening. This tool lets your agent track total impressions, clicks, and money spent by letting you specify a date range and which metric you want to pivot on. It’s not just 'show me the stats'; it's highly specific—you tell it the period and the numbers, and it spits out the metrics.

To measure if any of this is actually working for your business goals, you need context. The `list_conversion_rules` tool retrieves definitions for the conversion tracking rules. This lets your agent monitor your true return on ad spend (ROAS) by showing exactly what LinkedIn is counting as a successful action.

So, to recap how it works: You'll use **`list_ad_accounts`** first to get all the IDs. Then you’ll run **`list_ad_campaigns`** and **`list_campaign_groups`** to define the scope of campaigns within those accounts. After that, you can inspect the actual content with **`list_ad_creatives`**. When it's time for numbers, you hit **`get_ad_analytics`**, specifying dates and metrics like impressions, clicks, or spend. If you need to know if your money is generating results, **`list_conversion_rules`** gives you the definitions needed to track that ROI. This entire setup treats your whole ad portfolio as one data source for your agent to crunch.

## Tools

### get_ad_analytics
Queries campaign metrics by specifying the date range and reporting pivot (impressions, clicks, spend).

### list_ad_accounts
Lists every accessible LinkedIn Ad Account ID so you know which accounts to track.

### list_ad_campaigns
Retrieves a list of all active and past campaigns tied to an ad account ID.

### list_ad_creatives
Lists the specific creative assets—the actual ads shown—for a given ad account.

### list_campaign_groups
Retrieves groups of campaigns, allowing you to monitor broader marketing objectives within an account.

### list_conversion_rules
Displays the definitions for conversion tracking rules used by your ads to measure true return on ad spend.

## Prompt Examples

**Prompt:** 
```
List all my LinkedIn Ad accounts.
```

**Response:** 
```
I've retrieved your ad accounts. You have 2 active accounts: 'Global Marketing (ID: 500123)' and 'Retargeting EMEA (ID: 500456)'.
```

**Prompt:** 
```
Show performance metrics for account ID '500123' for the year 2024.
```

**Response:** 
```
I've queried the analytics. For the year 2024, account 500123 has generated 1,500,000 impressions and 45,000 clicks, with a total spend of $12,500.00.
```

**Prompt:** 
```
List all campaigns associated with my account.
```

**Response:** 
```
I found 5 campaigns in your account, including 'Brand Awareness Q1', 'Lead Gen Webinar', and 'Product Demo'. Which one would you like to see demographics for?
```

## Capabilities

### List Ad Accounts
The `list_ad_accounts` tool retrieves a complete list of all LinkedIn ad accounts you have access to, providing their IDs and current status.

### View Campaigns
Using `list_ad_campaigns`, your agent queries and lists every campaign group and individual campaign within a specified ad account.

### Inspect Ad Creatives
The `list_ad_creatives` tool pulls up all the specific ad variations (the images, copy, and technical settings) used across your campaigns for review.

### Monitor Performance Metrics
You use `get_ad_analytics` to query real-time performance data—like total impressions, clicks, and money spent—by specifying the date range and metric pivots.

### Check Conversion Rules
The `list_conversion_rules` tool retrieves the definitions for conversion tracking rules, letting you monitor your return on ad spend (ROAS).

## Use Cases

### Quick Quarterly Performance Review
The marketing director needs a summary of Q3 spend across all regions. Instead of exporting 10 CSV files, they prompt their agent: 'Get me the total impressions and clicks for all accounts last quarter.' The agent runs `list_ad_accounts` and then queries `get_ad_analytics` against all IDs, giving one consolidated report.

### Troubleshooting a Poor Campaign
A campaign is spending money but getting zero leads. An engineer asks the agent to check everything: 'Look at the creative for Account X.' The agent uses `list_ad_campaigns` and then `list_ad_creatives`, allowing the team to immediately see if the ad copy or image needs changing.

### Auditing Ad Spend Limits
The finance team wants to confirm which accounts are currently active. They run `list_ad_accounts`. This confirms all required IDs, and then they can use those IDs in `list_campaign_groups` to verify if any group is running campaigns that should be paused.

### Validating Conversion Goals
Before launching a new campaign type, the team must confirm what success looks like. They use `list_conversion_rules` first. This confirms the tracking definitions, ensuring that any metrics pulled by `get_ad_analytics` are based on accurate conversion goals.

## Benefits

- Automated Reporting: Instead of manual exports, you ask for a comparison between two campaigns using `get_ad_analytics`, and the agent provides the summarized answer immediately.
- Full Account Visibility: Use `list_ad_accounts` to get an instant inventory of every ad account you manage without logging into multiple dashboards.
- Deep Campaign Drilldown: Need to know which specific ads are failing? Run `list_ad_campaigns` followed by `list_ad_creatives` to map out the entire content structure.
- ROAS Tracking: Never guess your return. Use `list_conversion_rules` so your agent can accurately report on true conversion-based performance metrics.
- Structured Data Retrieval: The server ensures that all ad data—from accounts to analytics—is structured, making it easy for your AI client to process and act upon.

## How It Works

The bottom line is: your AI client handles the API complexity; you just talk to your agent.

1. First, subscribe to this server and enter your LinkedIn Access Token along with the required API Scope. This gives your agent permission to read your data.
2. Next, tell your AI client what you need—for example: 'Show me all ad accounts' or 'Get performance for last month'.
3. The agent executes the necessary tool (like `list_ad_accounts` or `get_ad_analytics`), pulls the raw data, and formats it into a clear, natural language report for you.

## Frequently Asked Questions

**How do I find all my LinkedIn Ad accounts using `list_ad_accounts`?**
The agent runs `list_ad_accounts` and returns a list of IDs. This is the necessary first step because all other tools require an active account ID to function.

**Can I calculate performance using only `get_ad_analytics`?**
Yes, but you should always run `list_conversion_rules` beforehand. This ensures that the 'performance' metrics your agent pulls are based on the correct conversion definitions.

**What is the difference between `list_ad_campaigns` and `list_campaign_groups`?**
Campaign groups contain related campaigns. Running `list_campaign_groups` gives you a broader view of objectives; running `list_ad_campaigns` lists individual, actionable campaign units.

**Do I need to use the API key for `list_ad_creatives`?**
Yes. The token must have read access permissions for ad content metadata. Otherwise, the tool will fail and you won't see any assets.

**How does `list_conversion_rules` help me track my return on ad spend?**
It provides definitions for your conversion rules. This allows your AI client to connect performance metrics (like clicks or impressions) directly to defined business outcomes, giving you a real view of your Return on Ad Spend.

**What specific parameters do I need when using `get_ad_analytics`?**
You must provide both a pivot and a date range. The pivot tells the system how to break down the data (e.g., by Account, Campaign, or Creative), while the date range locks in the reporting period.

**What kind of technical details does `list_ad_creatives` expose?**
It lists every individual ad variation and its specific configuration. You can inspect deep metadata here, which is crucial for auditing whether the creative setup aligns with your marketing objectives.

**If I run too many queries using `list_ad_campaigns`, what should I expect?**
The system manages standard API rate limits. If you exceed them, your agent receives an error code that tells you to slow down or wait for the next available interval before retrying.

**Which scopes are required for this server?**
Your access token must have at least `r_ads_reporting` and `r_ads` scopes to list accounts and fetch performance metrics.

**How do I specify the time range for analytics?**
You must provide a Restli-formatted string in the `params` field, including `dateRange=(start:(day:X,month:Y,year:Z))`. Refer to LinkedIn API documentation for exact syntax.

**Is the API Key (Personal Access Token) supported?**
LinkedIn uses OAuth2 tokens. You can generate a long-lived Access Token through the LinkedIn Developer Portal's Token Generator tool for development use.