LinkedIn Ads
LinkedIn Marketing API v202602 for B2B advertising
15 tools available
Installation
Claude Desktop
{
"mcpServers": {
"hopkin-linkedin-ads": {
"url": "https://mcp.hopkin.ai/linkedin-ads/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
CLI
npm install -g @hopkin/cli
hopkin auth set-key hpk_live_...
hopkin linkedin ping
Platform Overview
The LinkedIn Ads MCP server enables programmatic management and analysis of LinkedIn Sponsored Content campaigns through the LinkedIn Marketing API v202602. It provides tools for B2B audience targeting, campaign performance tracking, lead generation monitoring, and professional demographic breakdowns unique to LinkedIn's platform.
Your prompt → Claude + Hopkin → LinkedIn Marketing API v202602
↓
Campaign Data
B2B Audience Insights
Lead Gen Metrics
Professional Targeting
Common Workflows
Performance Reporting
"Show me how my campaigns performed over the last 30 days, broken down by campaign group."
Calls linkedin_ads_get_performance_report with pivots=['CAMPAIGN_GROUP'], date_preset='LAST_30_DAYS'. Returns spend, impressions, clicks, conversions, leads, and engagement metrics aggregated by campaign group with optional per-conversion-action breakdown.
"What's my account-level summary for this month, including conversion breakdown?"
Calls linkedin_ads_get_account_summary with date_preset='THIS_MONTH'. Returns total spend, impressions, clicks, leads, one-click conversions, and a per-conversion-action summary (e.g., signups vs. downloads).
"I need daily performance trends by campaign for the last 7 days."
Calls linkedin_ads_get_performance_report with pivots=['CAMPAIGN'], time_granularity='DAILY', date_preset='LAST_7_DAYS'. Returns daily spend, impressions, clicks, and conversions broken down by individual campaigns.
Campaign Management
"List all my active campaigns in account 123456789."
Calls linkedin_ads_list_campaigns with account_id='123456789', status=['ACTIVE']. Returns campaign names, IDs, budgets, run schedules, targeting summary, and serving status.
"Show me all campaign groups and which campaigns belong to each."
Calls linkedin_ads_list_campaign_groups to get all campaign groups, then for each group calls linkedin_ads_list_campaigns with campaign_group_id. Displays the hierarchy with budget and status for each level.
"What creatives (ads) are running in my top-performing campaign?"
Calls linkedin_ads_list_creatives with campaign_ids=['campaign-id'], resolve_content=true. Returns ad copy, headlines, body text, associated URLs, and status for each creative in the campaign.
B2B Audience Analysis
"Which job functions are driving the most conversions?"
Calls linkedin_ads_get_insights with pivot='MEMBER_JOB_FUNCTION', date_preset='LAST_30_DAYS', include_conversion_breakdown=true. Returns impressions, clicks, spend, and conversions by job function (e.g., Engineering, Sales, Marketing, HR). Note: Requires ≥3 events per dimension; data delayed 12-24 hours.
"Break down my campaign performance by seniority level and industry."
Calls linkedin_ads_get_insights twice — once with pivot='MEMBER_SENIORITY' and once with pivot='MEMBER_INDUSTRY'. Returns CTR, CPC, CPA metrics by seniority level and by industry. Useful for identifying which professional segments have the best ROI.
"What's my reach and engagement by company size?"
Calls linkedin_ads_get_insights with pivot='MEMBER_COMPANY_SIZE', date_preset='LAST_30_DAYS'. Returns approximate member reach, impressions, engagements, and cost metrics segmented by company size (1-10, 11-50, 51-200, 201-500, 501-1000, 1001-5000, 5001-10000, 10001+).
Lead Generation
"How many one-click leads did I get, and which campaigns generated the most?"
Calls linkedin_ads_get_performance_report with pivots=['CAMPAIGN'], date_preset='LAST_30_DAYS'. Extracts the oneClickLeads metric broken down by campaign. Can then cross-reference with linkedin_ads_get_account_summary for conversion action details.
"What conversion actions are configured for my account?"
Calls linkedin_ads_get_partner_conversions with account_id to see all conversion tracking actions (e.g., form submissions, website conversions, lead magnet downloads). Essential before analyzing conversion breakdown reports.
Recipes
"I want to understand which geographic markets are performing best. Show me impressions, clicks, and spend broken down by country."
Calls linkedin_ads_get_insights with pivot='MEMBER_COUNTRY_V2', date_preset='LAST_30_DAYS', include_conversion_breakdown=true. Returns per-country metrics to identify high-performing markets for budget reallocation. Data shows member reach by country plus conversion details.
"Compare the performance of my SPONSORED_UPDATES campaigns vs SPONSORED_CONTENT campaigns across all metrics."
Calls linkedin_ads_list_campaigns with type=['SPONSORED_UPDATES'], then type=['SPONSORED_CONTENT'] to get campaign IDs. Then calls linkedin_ads_get_performance_report with separate pivots=['CAMPAIGN'] for each type filtered by campaign_ids. Reveals which content format type drives better ROI.
"I need a full performance breakdown: account summary, daily trends by campaign, and audience demographics by job function."
Chains three calls: (1) linkedin_ads_get_account_summary for overall metrics, (2) linkedin_ads_get_performance_report with pivots=['CAMPAIGN'], time_granularity='DAILY', (3) linkedin_ads_get_insights with pivot='MEMBER_JOB_FUNCTION'. Stitches results into a comprehensive executive summary with daily trends and audience insight.
"Which creatives are running in my highest-spend campaigns, and how are they performing?"
Calls linkedin_ads_get_performance_report with pivots=['CAMPAIGN'], sorts by spend, identifies top N campaigns, then calls linkedin_ads_list_creatives with those campaign_ids and resolve_content=true to see ad copy and performance.
"Show me the complete campaign hierarchy, including campaign groups, campaigns, and creatives, for a specific account."
Calls (1) linkedin_ads_list_campaign_groups, (2) linkedin_ads_list_campaigns grouped by campaign_group_id, (3) linkedin_ads_list_creatives for each campaign with resolve_content=true. Builds a nested view of the entire account structure with ad copy and status.
"I want to optimize budget allocation. Show me CPA by campaign, industry, and job function to identify the most efficient segments."
Calls linkedin_ads_get_performance_report with pivots=['CAMPAIGN'], then linkedin_ads_get_insights with pivot='MEMBER_INDUSTRY', and pivot='MEMBER_JOB_FUNCTION'. Filters for rows with >0 spend and conversions, calculates CPA, and ranks by efficiency. Highlights underspend opportunities in high-performing segments.
Tips
- **MEMBER_* Demographic Pivots Have Constraints**: LinkedIn's demographic breakdowns (job function, seniority, industry, company size, country) require at least 3 events per dimension and have a 12-24 hour data delay. Rows below the threshold are silently dropped, so totals may not match account-level aggregates.
- Performance Report vs. Insights: Use
linkedin_ads_get_performance_reportfor standard analysis (campaign, campaign group, creative pivots, up to 3 dimensions). Uselinkedin_ads_get_insightsonly when you need a MEMBER_* demographic pivot or a custom metric. Performance Report includes conversion breakdown by default; Insights includes it optionally.
- Conversion Action Tracking: Always check
linkedin_ads_get_partner_conversionsfirst to understand what conversion tracking is configured. Conversion breakdown in performance and insights reports only includes configured actions; if the action isn't set up, it won't appear in the data.
- Date Ranges and Presets: LinkedIn supports LAST_7_DAYS, LAST_14_DAYS, LAST_30_DAYS, THIS_MONTH, LAST_MONTH, and LAST_90_DAYS presets. For custom ranges, use start_date and end_date (ISO format YYYY-MM-DD). Conversion data lags 24-72 hours, so avoid querying for "today" — use at least the last 7 days for stable numbers.
Tools
account-summary
linkedin_ads_get_account_summary Get LinkedIn Account Summary
Get a high-level performance summary for a LinkedIn Ads account including spend, impressions, clicks, conversions, leads, and conversion breakdown. Conversion data may be delayed 24-72 hours.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | Ad account ID (numeric, without URN prefix). |
reason required | string | Why this tool call is needed |
3 optional parameters
| Parameter | Type | Description |
|---|---|---|
date_preset | string | |
start_date | string | |
end_date | string |
ad-accounts
linkedin_ads_list_ad_accounts List LinkedIn Ad Accounts
List LinkedIn Sponsored Ad Accounts accessible to the authenticated user.
| Parameter | Type | Description |
|---|---|---|
reason required | string | Why this tool call is needed |
6 optional parameters
| Parameter | Type | Description |
|---|---|---|
status | array | Filter by account status. Defaults to [ACTIVE]. |
type | string | Filter by account type. |
include_test_accounts | boolean | Include test accounts. Defaults to false. |
limit | integer | |
cursor | string | Opaque pagination cursor. |
refresh | boolean |
auth
linkedin_ads_check_auth_status Check LinkedIn Ads Authentication Status
Troubleshoot authentication issues and get user profile info. Only use when another tool fails with a permission or authentication error — do NOT call proactively.
| Parameter | Type | Description |
|---|---|---|
reason required | string | Why this tool call is needed |
linkedin_ads_ping Ping LinkedIn Ads MCP Server
Health check for the LinkedIn Ads MCP server. Does not call the LinkedIn API.
| Parameter | Type | Description |
|---|---|---|
reason required | string | Why this tool call is needed |
1 optional parameter
| Parameter | Type | Description |
|---|---|---|
message | string | Optional message to echo back |
budget-pricing
linkedin_ads_get_budget_pricing Get LinkedIn Budget & Pricing
Get bid ranges and daily budget limits for a LinkedIn campaign type and audience. Call this before creating a campaign to understand recommended bids. DYNAMIC campaign type is not supported by this endpoint.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | Ad account ID (numeric, without URN prefix). |
campaign_type required | string | Campaign type. DYNAMIC is not supported by this endpoint. |
bid_type required | string | Bid type. CPV is only valid for SPONSORED_UPDATES video campaigns. |
match_type required | string | |
currency required | string | ISO-4217 currency code (e.g. USD, GBP). |
location_urns required | array | Target location URNs (e.g. urn:li:geo:103644278 for USA). |
reason required | string | Why this tool call is needed |
6 optional parameters
| Parameter | Type | Description |
|---|---|---|
seniority_urns | array | Target seniority URNs (e.g. urn:li:seniority:4 for Senior). |
job_function_urns | array | Target job function URNs. |
industry_urns | array | Target industry URNs. |
company_size_urns | array | Target company size range URNs (e.g. urn:li:staffCountRange:(51,200)). |
objective_type | string | Affects suggested bid. |
daily_budget_amount | number | Current or target daily budget (influences suggested bid calculation). |
campaign-groups
linkedin_ads_list_campaign_groups List LinkedIn Campaign Groups
List LinkedIn Campaign Groups for an ad account. Campaign groups are the top-level organizational unit containing campaigns.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | Ad account ID (numeric, without URN prefix). |
reason required | string | Why this tool call is needed |
6 optional parameters
| Parameter | Type | Description |
|---|---|---|
status | array | Filter by status. Defaults to [ACTIVE, PAUSED]. |
campaign_group_id | string | Fetch a single campaign group by numeric ID. |
campaign_group_ids | array | Fetch specific campaign groups by numeric IDs (batch GET). |
limit | integer | |
cursor | string | |
refresh | boolean |
campaigns
linkedin_ads_list_campaigns List LinkedIn Campaigns
List LinkedIn Campaigns for an ad account. Campaigns define targeting, bidding, and budget within a campaign group.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | Ad account ID (numeric, without URN prefix). |
reason required | string | Why this tool call is needed |
8 optional parameters
| Parameter | Type | Description |
|---|---|---|
status | array | Filter by status. Defaults to [ACTIVE, PAUSED]. |
campaign_group_id | string | Filter by campaign group (numeric ID). |
type | array | Filter by campaign type. |
campaign_id | string | Fetch a single campaign by numeric ID. |
campaign_ids | array | Fetch specific campaigns by numeric IDs (batch filter). |
limit | integer | |
cursor | string | |
refresh | boolean |
creatives
linkedin_ads_list_creatives List LinkedIn Creatives
List LinkedIn Creatives (ads) for an ad account. IMPORTANT: Always explicitly pass resolve_content=true when the user asks about ad copy, headlines, body text, URLs, or creative details — do not omit it and rely on the default. Only set resolve_content=false when the user needs metadata-only and has NOT asked about content.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | Ad account ID (numeric, without URN prefix). |
reason required | string | Why this tool call is needed |
8 optional parameters
| Parameter | Type | Description |
|---|---|---|
campaign_ids | array | Filter by campaign IDs (numeric). |
status | array | Filter by intended status. Defaults to [ACTIVE, PAUSED, DRAFT]. |
resolve_content | boolean | Resolve ad copy (headline, body text, destination URL) from linked posts/shares. Default: true. Set to false only when you need metadata-only (IDs, status, content type) and explicitly do NOT need ad copy. |
creative_id | string | Fetch a single creative by URN or numeric ID. |
creative_ids | array | Fetch specific creatives by numeric IDs (batch filter). |
limit | integer | |
cursor | string | |
refresh | boolean |
feedback
linkedin_ads_developer_feedback Submit Developer Feedback
Submit feedback about missing tools, improvements, or workflow gaps in the LinkedIn Ads MCP toolset. Not for user-facing issues like auth or API errors.
| Parameter | Type | Description |
|---|---|---|
feedback_type required | string | Feedback category: new_tool (request new capability), improvement (enhance existing tool), bug (report issue), workflow_gap (missing workflow) |
title required | string | Concise title summarizing the feedback |
description required | string | What is needed and why |
reason required | string | Why this tool call is needed |
3 optional parameters
| Parameter | Type | Description |
|---|---|---|
current_workaround | string | Current workaround, if any |
priority | string | Impact level: low (nice-to-have), medium (improves workflow), high (blocking issue) |
interface | string | Interface the feedback originated from: MCP (default) or CLI |
insights
linkedin_ads_get_insights Get LinkedIn Ads Insights
Get LinkedIn Ads analytics with a single pivot dimension. For standard analysis, prefer linkedin_ads_get_performance_report; use this only for MEMBER_* demographic pivots (unique to LinkedIn) or custom metric queries not available in the performance report. MEMBER_* pivots have a 3-event minimum threshold and 12-24 hour data delay, so totals may not match account-level numbers. Max 18 metrics per query.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | Ad account ID (numeric, without URN prefix). |
pivot required | string | Analytics pivot dimension. MEMBER_* pivots provide demographic breakdowns unique to LinkedIn. |
reason required | string | Why this tool call is needed |
8 optional parameters
| Parameter | Type | Description |
|---|---|---|
date_preset | string | |
start_date | string | ISO date YYYY-MM-DD. Use with end_date to override date_preset. |
end_date | string | |
time_granularity | string | |
campaign_ids | array | Filter to specific campaigns (numeric IDs). |
campaign_group_ids | array | Filter to specific campaign groups (numeric IDs). |
metrics | array | LinkedIn adAnalytics metric field names (camelCase, exact names required). Core: impressions, clicks, costInLocalCurrency, costInUsd. Conversions: externalWebsiteConversions, externalWebsitePostClickConversions, externalWebsitePostViewConversions, conversionValueInLocalCurrency. Leads: oneClickLeads, oneClickLeadFormOpens, qualifiedLeads. Video: videoViews, videoCompletions. Engagement: totalEngagements, shares, follows, reactions, comments, landingPageClicks, textUrlClicks, companyPageClicks. Card: cardImpressions, cardClicks, viralCardImpressions, viralCardClicks. Reach: approximateMemberReach (only with ACCOUNT/CAMPAIGN_GROUP/CAMPAIGN pivot, ≤92 day range). IMPORTANT: Do NOT use aliases like "conversions", "leads", "spend", or "reach" — use the exact camelCase field names listed above. Max 18 (pivotValues + dateRange count toward the 20-field API limit). Defaults to: impressions, clicks, costInLocalCurrency, costInUsd, externalWebsiteConversions, oneClickLeads, videoViews, totalEngagements. |
include_conversion_breakdown | boolean | When true (and pivot is not CONVERSION), runs a second query to break down conversions per action with names. |
partner-conversions
linkedin_ads_get_partner_conversions Get LinkedIn Partner Conversions
List partner conversions (conversion actions) configured for a LinkedIn Ads account. Use this to understand what conversion tracking is set up before analyzing performance data.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | Ad account ID (numeric, without URN prefix). |
reason required | string | Why this tool call is needed |
reporting
linkedin_ads_get_performance_report Get LinkedIn Ads Performance Report
Get a full-funnel performance report with up to 3 pivot dimensions and optional per-conversion-action breakdown. MEMBER_* demographic pivots are not supported here — use linkedin_ads_get_insights instead.
| Parameter | Type | Description |
|---|---|---|
account_id required | string | Ad account ID (numeric, without URN prefix). |
reason required | string | Why this tool call is needed |
8 optional parameters
| Parameter | Type | Description |
|---|---|---|
pivots | array | Up to 3 pivot dimensions. OBJECTIVE_TYPE is only available in q=statistics. |
date_preset | string | |
start_date | string | |
end_date | string | |
time_granularity | string | |
campaign_ids | array | |
campaign_group_ids | array | |
include_conversion_breakdown | boolean | Run a second query for per-conversion-action breakdown. Adds one extra API call. |
preferences
linkedin_ads_store_preference Store LinkedIn Ads Preference
Store a persistent preference for a LinkedIn ad entity. Use when you infer a recurring preference about analysis, reporting, or management. Updates existing keys. Entity type "ad_set" maps to LinkedIn campaigns; "ad" maps to creatives.
| Parameter | Type | Description |
|---|---|---|
entity_type required | string | Type of ad entity: ad_account, campaign, ad_set (Meta ad sets / Google ad groups), or ad |
entity_id required | string | The platform entity ID (e.g. act_123456, 23842453456789) |
key required | string | Preference key (e.g. preferred_conversion_metric, budget_alert_threshold) |
reason required | string | Why this tool call is needed |
3 optional parameters
| Parameter | Type | Description |
|---|---|---|
value | unknown | Preference value — string, number, boolean, or JSON object |
source | string | Who set this preference: agent (default), user, or system |
note | string | Optional context about why this preference was set |
linkedin_ads_get_preferences Get LinkedIn Ads Preferences
Get all stored preferences for a LinkedIn Ads entity. Preferences are also automatically attached to entity-listing responses, so you often don't need to call this explicitly.
| Parameter | Type | Description |
|---|---|---|
entity_type required | string | Type of ad entity: ad_account, campaign, ad_set, or ad |
entity_id required | string | The platform entity ID |
reason required | string | Why this tool call is needed |
linkedin_ads_delete_preference Delete LinkedIn Ads Preference
Delete a stored preference for a LinkedIn Ads entity by key. No-op if the preference doesn't exist.
| Parameter | Type | Description |
|---|---|---|
entity_type required | string | Type of ad entity: ad_account, campaign, ad_set, or ad |
entity_id required | string | The platform entity ID |
key required | string | The preference key to delete |
reason required | string | Why this tool call is needed |