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_report for standard analysis (campaign, campaign group, creative pivots, up to 3 dimensions). Use linkedin_ads_get_insights only 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_conversions first 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

Read-onlyIdempotentOpen-world

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.

ParameterTypeDescription
account_id requiredstringAd account ID (numeric, without URN prefix).
reason requiredstringWhy this tool call is needed
3 optional parameters
ParameterTypeDescription
date_presetstring
start_datestring
end_datestring
View full documentation →

ad-accounts

linkedin_ads_list_ad_accounts List LinkedIn Ad Accounts

Read-onlyIdempotentOpen-world

List LinkedIn Sponsored Ad Accounts accessible to the authenticated user.

ParameterTypeDescription
reason requiredstringWhy this tool call is needed
6 optional parameters
ParameterTypeDescription
statusarrayFilter by account status. Defaults to [ACTIVE].
typestringFilter by account type.
include_test_accountsbooleanInclude test accounts. Defaults to false.
limitinteger
cursorstringOpaque pagination cursor.
refreshboolean
View full documentation →

auth

linkedin_ads_check_auth_status Check LinkedIn Ads Authentication Status

Read-onlyIdempotent

Troubleshoot authentication issues and get user profile info. Only use when another tool fails with a permission or authentication error — do NOT call proactively.

ParameterTypeDescription
reason requiredstringWhy this tool call is needed
View full documentation →

linkedin_ads_ping Ping LinkedIn Ads MCP Server

Read-onlyIdempotent

Health check for the LinkedIn Ads MCP server. Does not call the LinkedIn API.

ParameterTypeDescription
reason requiredstringWhy this tool call is needed
1 optional parameter
ParameterTypeDescription
messagestringOptional message to echo back
View full documentation →

budget-pricing

linkedin_ads_get_budget_pricing Get LinkedIn Budget & Pricing

Read-onlyOpen-world

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.

ParameterTypeDescription
account_id requiredstringAd account ID (numeric, without URN prefix).
campaign_type requiredstringCampaign type. DYNAMIC is not supported by this endpoint.
bid_type requiredstringBid type. CPV is only valid for SPONSORED_UPDATES video campaigns.
match_type requiredstring
currency requiredstringISO-4217 currency code (e.g. USD, GBP).
location_urns requiredarrayTarget location URNs (e.g. urn:li:geo:103644278 for USA).
reason requiredstringWhy this tool call is needed
6 optional parameters
ParameterTypeDescription
seniority_urnsarrayTarget seniority URNs (e.g. urn:li:seniority:4 for Senior).
job_function_urnsarrayTarget job function URNs.
industry_urnsarrayTarget industry URNs.
company_size_urnsarrayTarget company size range URNs (e.g. urn:li:staffCountRange:(51,200)).
objective_typestringAffects suggested bid.
daily_budget_amountnumberCurrent or target daily budget (influences suggested bid calculation).
View full documentation →

campaign-groups

linkedin_ads_list_campaign_groups List LinkedIn Campaign Groups

Read-onlyIdempotentOpen-world

List LinkedIn Campaign Groups for an ad account. Campaign groups are the top-level organizational unit containing campaigns.

ParameterTypeDescription
account_id requiredstringAd account ID (numeric, without URN prefix).
reason requiredstringWhy this tool call is needed
6 optional parameters
ParameterTypeDescription
statusarrayFilter by status. Defaults to [ACTIVE, PAUSED].
campaign_group_idstringFetch a single campaign group by numeric ID.
campaign_group_idsarrayFetch specific campaign groups by numeric IDs (batch GET).
limitinteger
cursorstring
refreshboolean
View full documentation →

campaigns

linkedin_ads_list_campaigns List LinkedIn Campaigns

Read-onlyIdempotentOpen-world

List LinkedIn Campaigns for an ad account. Campaigns define targeting, bidding, and budget within a campaign group.

ParameterTypeDescription
account_id requiredstringAd account ID (numeric, without URN prefix).
reason requiredstringWhy this tool call is needed
8 optional parameters
ParameterTypeDescription
statusarrayFilter by status. Defaults to [ACTIVE, PAUSED].
campaign_group_idstringFilter by campaign group (numeric ID).
typearrayFilter by campaign type.
campaign_idstringFetch a single campaign by numeric ID.
campaign_idsarrayFetch specific campaigns by numeric IDs (batch filter).
limitinteger
cursorstring
refreshboolean
View full documentation →

creatives

linkedin_ads_list_creatives List LinkedIn Creatives

Read-onlyIdempotentOpen-world

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.

ParameterTypeDescription
account_id requiredstringAd account ID (numeric, without URN prefix).
reason requiredstringWhy this tool call is needed
8 optional parameters
ParameterTypeDescription
campaign_idsarrayFilter by campaign IDs (numeric).
statusarrayFilter by intended status. Defaults to [ACTIVE, PAUSED, DRAFT].
resolve_contentbooleanResolve 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_idstringFetch a single creative by URN or numeric ID.
creative_idsarrayFetch specific creatives by numeric IDs (batch filter).
limitinteger
cursorstring
refreshboolean
View full documentation →

feedback

linkedin_ads_developer_feedback Submit Developer Feedback

IdempotentOpen-world

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.

ParameterTypeDescription
feedback_type requiredstringFeedback category: new_tool (request new capability), improvement (enhance existing tool), bug (report issue), workflow_gap (missing workflow)
title requiredstringConcise title summarizing the feedback
description requiredstringWhat is needed and why
reason requiredstringWhy this tool call is needed
3 optional parameters
ParameterTypeDescription
current_workaroundstringCurrent workaround, if any
prioritystringImpact level: low (nice-to-have), medium (improves workflow), high (blocking issue)
interfacestringInterface the feedback originated from: MCP (default) or CLI
View full documentation →

insights

linkedin_ads_get_insights Get LinkedIn Ads Insights

Read-onlyIdempotentOpen-world

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.

ParameterTypeDescription
account_id requiredstringAd account ID (numeric, without URN prefix).
pivot requiredstringAnalytics pivot dimension. MEMBER_* pivots provide demographic breakdowns unique to LinkedIn.
reason requiredstringWhy this tool call is needed
8 optional parameters
ParameterTypeDescription
date_presetstring
start_datestringISO date YYYY-MM-DD. Use with end_date to override date_preset.
end_datestring
time_granularitystring
campaign_idsarrayFilter to specific campaigns (numeric IDs).
campaign_group_idsarrayFilter to specific campaign groups (numeric IDs).
metricsarrayLinkedIn 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_breakdownbooleanWhen true (and pivot is not CONVERSION), runs a second query to break down conversions per action with names.
View full documentation →

partner-conversions

linkedin_ads_get_partner_conversions Get LinkedIn Partner Conversions

Read-onlyIdempotentOpen-world

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.

ParameterTypeDescription
account_id requiredstringAd account ID (numeric, without URN prefix).
reason requiredstringWhy this tool call is needed
View full documentation →

reporting

linkedin_ads_get_performance_report Get LinkedIn Ads Performance Report

Read-onlyIdempotentOpen-world

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.

ParameterTypeDescription
account_id requiredstringAd account ID (numeric, without URN prefix).
reason requiredstringWhy this tool call is needed
8 optional parameters
ParameterTypeDescription
pivotsarrayUp to 3 pivot dimensions. OBJECTIVE_TYPE is only available in q=statistics.
date_presetstring
start_datestring
end_datestring
time_granularitystring
campaign_idsarray
campaign_group_idsarray
include_conversion_breakdownbooleanRun a second query for per-conversion-action breakdown. Adds one extra API call.
View full documentation →

preferences

linkedin_ads_store_preference Store LinkedIn Ads Preference

Idempotent

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.

ParameterTypeDescription
entity_type requiredstringType of ad entity: ad_account, campaign, ad_set (Meta ad sets / Google ad groups), or ad
entity_id requiredstringThe platform entity ID (e.g. act_123456, 23842453456789)
key requiredstringPreference key (e.g. preferred_conversion_metric, budget_alert_threshold)
reason requiredstringWhy this tool call is needed
3 optional parameters
ParameterTypeDescription
valueunknownPreference value — string, number, boolean, or JSON object
sourcestringWho set this preference: agent (default), user, or system
notestringOptional context about why this preference was set
View full documentation →

linkedin_ads_get_preferences Get LinkedIn Ads Preferences

Read-onlyIdempotent

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.

ParameterTypeDescription
entity_type requiredstringType of ad entity: ad_account, campaign, ad_set, or ad
entity_id requiredstringThe platform entity ID
reason requiredstringWhy this tool call is needed
View full documentation →

linkedin_ads_delete_preference Delete LinkedIn Ads Preference

DestructiveIdempotent

Delete a stored preference for a LinkedIn Ads entity by key. No-op if the preference doesn't exist.

ParameterTypeDescription
entity_type requiredstringType of ad entity: ad_account, campaign, ad_set, or ad
entity_id requiredstringThe platform entity ID
key requiredstringThe preference key to delete
reason requiredstringWhy this tool call is needed
View full documentation →