linkedin-campaign-manager-mcp
LinkedIn Campaign Manager MCP
MCP-Server für die LinkedIn Marketing API – fragen Sie Kampagnen, Performance und Lead-Gen-Formulare von Claude in einfachem Englisch ab.
19 schreibgeschützte Tools für Werbekonten, Kampagnen, Creatives, Performance-Analysen, demografische Daten, Video-Analysen, Budget-Pacing, Periodenvergleiche, Conversions, Lead-Gen-Formulare, Zielgruppen und Targeting-Facetten. Entwickelt für B2B-Paid-Social-Teams, die Sponsored Content, Lead-Gen-Formulare und accountbasierte Kampagnen auf LinkedIn schalten.
Warum existiert dieses Tool?
Die Arbeit mit der LinkedIn Marketing API ist bekanntermaßen mühsam: monatliche Rosetta-Versionierung, undokumentierte Feldzuordnungen, verschachtelte Abfrageparameter im Rest.li-Stil für Analysen und 60-Tage-Zugriffstoken, die stillschweigend ablaufen. Dieser Server erledigt all das im Hintergrund, sodass Sie Fragen in einfachem Englisch stellen können, anstatt dateRange=(start:(year:...)) manuell schreiben zu müssen.
Kein anderer Open-Source-MCP-Server für LinkedIn Ads bietet diese Tiefe. Die meisten hören bei „Kampagnen auflisten“ auf. Dieser Server umfasst demografische Daten, Video-Completion-Funnel, Budget-Pacing, Periodenvergleiche und Lead-Gen-Formularantworten inklusive PII, damit Sie Leads mit Marketo oder Salesforce abgleichen können.
Beispiel-Prompts
Nach der Installation können Sie Claude Dinge fragen wie:
„Wie ist der Trend unserer LinkedIn Ads-Ausgaben der letzten 28 Tage, aufgeschlüsselt nach Kampagnengruppe?“
„Vergleiche den CPL der Wettbewerbs-Kampagnen diesen Monat mit dem letzten – welche Creatives haben das Ergebnis beeinflusst?“
„Rufe demografische Daten für unsere Kampagne mit den höchsten Ausgaben ab – welche Seniorität und Branche konvertieren?“
„Welche Lead-Gen-Formulare hatten letzten Monat die höchste Absenderate und wie hoch waren die Kosten pro Lead?“
„Zeige den Video-Completion-Funnel für unsere Awareness-Kampagne – wo steigen die Leute aus?“
„Sind Kampagnen gefährdet, das Budget zu überschreiten? Zeige das Budget-Pacing für alle aktiven Kampagnen.“
„Rufe die Lead-Gen-Formularantworten von gestern ab, damit ich sie stichprobenartig mit Marketo abgleichen kann.“
Demo
🎥 Walkthrough-Video folgt in Kürze – Abfrage der LinkedIn-Kampagnen-Performance von Claude Code in unter 60 Sekunden.
Tools
Tool | Was es tut |
| Alle Werbekonten, auf die der Benutzer zugreifen kann, mit Status + Währung. |
| Details zu einem einzelnen Konto: Währung, Status, Typ, Abrechnungsinformationen. |
| Kampagnen in einem Konto; Filterung nach Status oder Kampagnengruppe. |
| Vollständige Kampagnendetails: Targeting-Kriterien, Gebot, Budget, Zielsetzung. |
| Kampagnengruppen (Container für geteiltes Budget/Zielsetzung). |
| Werbe-Creatives; Filterung nach Kampagne oder Status. |
| Vollständige Creative-Details: Überschrift, Text, URL, Bild-/Video-URNs. |
| Impressionen/Klicks/Ausgaben/Conversions/Leads über einen Datumsbereich. Granularität: DAILY/MONTHLY/YEARLY/ALL. |
| Performance nach Unternehmen / Unternehmensgröße / Branche / Jobfunktion / Berufsbezeichnung / Seniorität / Region / Land. |
| WoW/MoM/YoY mit serverseitig berechneten Spalten für _current/_prior/_delta/_pct_change pro Entität. |
| Video-Completion-Funnel pro Creative: Starts → 25% → 50% → 75% → Abschlüsse + Abschlussrate. |
| Ausgaben vs. Budgetauslastung in % für aktive Kampagnen über einen konfigurierbaren Zeitraum. |
| Definitionen von Insight-Tag-Conversion-Events: Typ, Attributionsfenster, Aktivierungsstatus. |
| Performance nach Conversion-Event (CONVERSION-Pivot): Aufschlüsselung nach Post-Click vs. View-Through. |
| DMP-Segmente: Matched Audiences, Unternehmenslisten, kombinierte/Lookalike-Segmente + Größen. |
| Typeahead-Suche für Targeting-Werte (Berufsbezeichnungen, Fähigkeiten, Unternehmen, Branchen, Standorte, Senioritäten). |
| Lead-Gen-Formulare + Fragenkonfiguration + Status. |
| Tatsächliche Formularübermittlungen mit PII (Name, E-Mail, Unternehmen, Berufsbezeichnung). |
| LGF-Metriken pro Creative: Formular-Öffnungsrate, Absenderate, Kosten pro Lead. |
Einrichtung
1. Installation
npm install -g linkedin-campaign-manager-mcpOder lokal klonen + bauen:
git clone https://github.com/ZLeventer/linkedin-campaign-manager-mcp
cd linkedin-campaign-manager-mcp
npm install
npm run build2. LinkedIn Developer App erstellen
Die Marketing-API ist zugangsbeschränkt. Sie benötigen eine LinkedIn Developer App mit spezifischen Produktfreigaben:
Gehen Sie zu developer.linkedin.com → Create App (mit Ihrer Unternehmensseite verknüpfen).
Tab „Products“ – Zugriff anfordern für:
Marketing Developer Platform(decktr_ads,r_ads_reportingab)Lead Gen FormsoderCommunity Management API(decktr_ads_leadgen_automationab)
LinkedIn prüft den App-Zugriff manuell – normalerweise 2–6 Wochen.
Tab „Auth“ → Authorized Redirect URLs – hinzufügen:
http://127.0.0.1:53123(ändern Sie53123, falls Sie einen anderenLINKEDIN_OAUTH_PORTfestgelegt haben).Kopieren Sie Client ID und Client Secret aus dem Auth-Tab.
Ohne Produktfreigabe gibt jeder API-Aufruf einen 403-Fehler zurück. Der Server kompiliert und startet sauber – der 403 ist ein Berechtigungsproblem auf App-Ebene, kein Code-Problem.
3. Umgebung konfigurieren
cp .env.example .env
# edit .env with your LINKEDIN_CLIENT_ID, LINKEDIN_CLIENT_SECRET,
# LINKEDIN_DEFAULT_AD_ACCOUNT (numeric ID from Campaign Manager URL)4. Autorisieren (einmaliger OAuth-Flow)
npm run authDies öffnet einen lokalen HTTP-Server auf Port 53123 (oder LINKEDIN_OAUTH_PORT), gibt eine Auth-URL in Ihrem Terminal aus und wartet auf den OAuth-Callback. Nachdem Sie im Browser zugestimmt haben, tauscht er den Code gegen ein Zugriffstoken + 365-Tage-Refresh-Token aus und speichert diese in token.json (Modus 0600).
Sie müssen npm run auth nur erneut ausführen, wenn das Refresh-Token abläuft (nach 365 Tagen).
5. In Claude Code (oder einen beliebigen MCP-Client) einbinden
Fügen Sie dies in ~/.claude.json unter mcpServers hinzu:
{
"mcpServers": {
"linkedin": {
"command": "linkedin-campaign-manager-mcp",
"env": {
"LINKEDIN_CLIENT_ID": "your_client_id",
"LINKEDIN_CLIENT_SECRET": "your_client_secret",
"LINKEDIN_TOKEN_PATH": "/absolute/path/to/token.json",
"LINKEDIN_DEFAULT_AD_ACCOUNT": "123456789",
"LINKEDIN_API_VERSION": "202504"
}
}
}
}Oder bei Ausführung aus dem Quellcode:
{
"mcpServers": {
"linkedin": {
"command": "node",
"args": ["/path/to/linkedin-campaign-manager-mcp/dist/index.js"],
"env": {
"LINKEDIN_CLIENT_ID": "...",
"LINKEDIN_CLIENT_SECRET": "...",
"LINKEDIN_TOKEN_PATH": "/path/to/token.json",
"LINKEDIN_DEFAULT_AD_ACCOUNT": "123456789"
}
}
}
}Starten Sie Claude Code neu. Die 19 Tools erscheinen unter dem linkedin-Server.
Umgebungsvariablen
Variable | Erforderlich | Standard | Beschreibung |
| Ja | — | OAuth App Client ID |
| Ja | — | OAuth App Client Secret |
| Nein |
| Pfad zum Lesen/Schreiben der Token-Datei |
| Empfohlen | — | Numerische Konto-ID; Tools greifen darauf zurück, wenn keine |
| Nein |
| Loopback-Port für OAuth-Redirect |
| Nein |
| LinkedIn Rosetta API-Version (JJJJMM) |
URN-Handhabung
LinkedIn-Ressourcen werden durch URNs identifiziert: urn:li:sponsoredAccount:123, urn:li:sponsoredCampaign:456 usw.
Alle Tool-Eingaben akzeptieren entweder die reine numerische ID oder die vollständige URN – der Client umschließt reine IDs automatisch. Numerische IDs erscheinen in den URLs des Campaign Managers (/accounts/<id>/, /campaigns/<id>/).
Datumseingaben
Alle Datumsparameter akzeptieren:
Eingabe | Bedeutung |
| Wörtliches ISO-Datum |
| Selbsterklärend |
| N Kalendertage vor heute |
Standardbereich: 28daysAgo → yesterday.
LinkedIn-spezifische Fallstricke
API-Versionswechsel
LinkedIn Rosetta verwendet monatliche Versionen (202504 = April 2025). Versionen werden ca. 12 Monate nach Veröffentlichung eingestellt – Sie erhalten dann 410 Gone-Fehler. Aktualisieren Sie LINKEDIN_API_VERSION vierteljährlich. Siehe die Versionierungs-Dokumentation.
Analyse-Abfrageform
/adAnalytics verwendet verschachtelte Parameter im Rest.li-Stil, keine einfachen ISO-Strings:
dateRange=(start:(year:2024,month:10,day:1),end:(year:2024,month:10,day:31))
campaigns=List(urn:li:sponsoredCampaign:123,urn:li:sponsoredCampaign:456)Dies wird intern durch dateRangeParam() und liGetRaw() gehandhabt. Wenn Sie den Server erweitern, leiten Sie Analyse-Aufrufe über liGetRaw() mit einer manuell erstellten URL – verwenden Sie nicht liGet() für Analyse-Endpunkte, da URLSearchParams die verschachtelten Klammern beschädigen würde.
Verzögerung der Analysedaten
LinkedIn-Analysen haben bei den meisten Metriken eine Verzögerung von 2–6 Stunden und bei Conversion-Daten von bis zu 24 Stunden. Die Zahlen von gestern sind normalerweise vollständig; die von heute sind unvollständig.
60-Tage-Zugriffstoken, 365-Tage-Refresh-Token
Zugriffstoken laufen in 60 Tagen ab; Refresh-Token in 365 Tagen. Der Client aktualisiert das Zugriffstoken bei Bedarf automatisch bei jeder Anfrage. Wenn das Refresh-Token abläuft, führen Sie npm run auth erneut aus.
Lead-Gen-Antworten PII
li_get_leadgen_responses gibt tatsächliche Lead-PII zurück – Name, E-Mail, Unternehmen, Berufsbezeichnung. Behandeln Sie die Ausgabe als vertraulich: Schreiben Sie sie nicht in freigegebene Protokolle, unverschlüsselten Speicher oder öffentliche Kanäle. Die Datennutzungsrichtlinie von LinkedIn erfordert das Löschen von Lead-Antworten innerhalb von 90 Tagen nach Erhalt, es sei denn, der Lead hat aktiv zugestimmt. Dieses Tool ist für den autorisierten CRM-Abgleich (Marketo/SFDC) gedacht.
Ratenbegrenzungen
LinkedIn veröffentlicht keine harten Ratenbegrenzungen. In der Praxis ist mit einer Drosselung bei etwa 100 Analyse-Aufrufen/Minute pro App zu rechnen. Es ist kein Retry-on-429 integriert – wenn Sie Limits erreichen, reduzieren Sie die Aufrufhäufigkeit oder cachen Sie Ergebnisse clientseitig.
Wann Sie diesen Server NICHT verwenden sollten
Erstellen oder Bearbeiten von Kampagnen, Budgets oder Creatives – konzipiert als schreibgeschützt. Die Kampagnenerstellung hat zu viele Fehlerquellen, um sie sicher zu automatisieren; verwenden Sie die Campaign Manager UI.
Echtzeit-Impression-Daten – verwenden Sie das LinkedIn Insight Tag + GA4 für nahezu Echtzeit.
Schätzung der Zielgruppengröße für beliebige Targeting-Kriterien – verwenden Sie die Audience Builder UI des Campaign Managers für Ad-hoc-Größenbestimmungen.
li_get_audience_insightsgibt nur Größen von gespeicherten/hochgeladenen Segmenten zurück.
Lizenz
MIT © 2026 Zach Leventer
Available Tools
19 toolsli_compare_periodsA
Compare LinkedIn campaign performance across two time periods. wow (week-over-week): last 7d vs prior 7d. mom (month-over-month): last 30d vs prior 30d. yoy (year-over-year): last 30d vs same 30d last year. Returns per-entity rows (keyed by campaign/creative URN) with _current, _prior, _delta, and _pct_change columns for every requested metric. Deltas are computed server-side so you do not need to post-process. Useful for weekly/monthly performance reports and anomaly detection.
Inputs: pivot, fields, comparison, campaign_ids, +1 more.
li_get_accountA
Get full details for a single LinkedIn ad account, including currency code, status, account type (BUSINESS/ENTERPRISE), total budget, billing info, and the associated organization URN. Useful for confirming account currency before interpreting spend data, or checking billing status before troubleshooting ad delivery issues.
Inputs: ad_account_id.
li_get_audience_insightsA
List DMP (Data Management Platform) segments attached to a LinkedIn ad account. Segments represent matched audiences (USER type: contact list uploads, website retargeting, lookalike audiences) and company lists (COMPANY type: for account-based marketing). Returns segment name, type, source, estimated size (where LinkedIn reports it), and status. Use to audit available audiences before building campaigns, or to confirm a matched audience uploaded successfully and has enough members to serve ads.
Inputs: ad_account_id, type, page_size.
li_get_budget_pacingA
Calculate budget utilization for active LinkedIn campaigns. Compares spend over the specified period_days window against total or estimated period budget, and returns a utilization_pct for each campaign. Useful for mid-flight pacing checks: if utilization is below 80% near the end of a month, the campaign may be under-delivering; above 100% means it is over-pacing. Accepts optional campaign_ids to limit scope; defaults to all ACTIVE campaigns in the account.
Inputs: ad_account_id, campaign_ids, period_days.
li_get_campaignA
Get complete detail for a single LinkedIn campaign, including the full targetingCriteria object (all included/excluded facets), bid strategy, unit cost, daily/total budget, run schedule, objective, optimization target, format, and locale. Use this when you need to audit targeting setup, diagnose budget configuration, or confirm campaign structure before pulling performance data.
Inputs: campaign_id (required), ad_account_id.
li_get_campaign_performanceA
Fetch performance metrics for LinkedIn campaigns over a date range. Returns impressions, clicks, spend (USD and local currency), website conversions, one-click lead form submissions, landing-page clicks, video views, follows, reactions, comments, and shares. Pass campaign_ids for specific campaigns or use ad_account_id for account-level totals. Supports DAILY/MONTHLY/YEARLY/ALL time granularity and CAMPAIGN/CAMPAIGN_GROUP/CREATIVE/ACCOUNT pivots. Default range: last 28 days.
Inputs: campaign_ids, ad_account_id, start_date, end_date, +3 more.
li_get_conversion_eventsA
List LinkedIn conversion event definitions on an ad account. Returns each event's name, type (URL/FILE_DOWNLOAD/SIGN_UP/etc.), enabled status, attributionType, post-click and view-through attribution window sizes, and associated Insight Tag. These are the events tracked by the LinkedIn Insight Tag on your website. Use to audit conversion event setup, confirm event names before pulling conversion performance, or verify attribution window configuration.
Inputs: ad_account_id, enabled_only, page_size.
li_get_conversion_performanceA
Fetch conversion performance broken down by conversion event (CONVERSION pivot). Returns externalWebsiteConversions, externalWebsitePostClickConversions, externalWebsitePostViewConversions, impressions, clicks, and spend per conversion event. Use to compare cost-per-conversion across event types, diagnose which Insight Tag events are driving value, or build a funnel from impression → click → conversion. Scope to specific campaigns or report at account level.
Inputs: campaign_ids, ad_account_id, start_date, end_date, +1 more.
li_get_creativeA
Get full detail for a single LinkedIn ad creative, including the creative content (headline, body copy, destination URL, image/video URNs, call-to-action label), intendedStatus, associated campaign URNs, and creative type. Use when auditing ad copy and creative assets, debugging a rejected creative, or pulling the landing page URL to cross-reference with GA4 UTM data.
Inputs: creative_id (required), ad_account_id.
li_get_demographics_reportA
Break down LinkedIn campaign performance by a demographic dimension of the people who saw or clicked your ads. Pivot options: MEMBER_JOB_TITLE (which titles engage most), MEMBER_JOB_FUNCTION, MEMBER_SENIORITY (director vs. manager vs. C-suite), MEMBER_COMPANY (which accounts clicked), MEMBER_COMPANY_SIZE, MEMBER_INDUSTRY, MEMBER_COUNTRY_V2, MEMBER_REGION_V2. Returns impressions, clicks, spend, leads, and conversions per dimension value. Useful for buyer-persona fit analysis and ABM account-list validation.
Inputs: pivot (required), campaign_ids, ad_account_id, start_date, +2 more.
li_get_leadgen_form_performanceA
Fetch LinkedIn Lead Gen Form performance analytics broken down by creative. Returns impressions, clicks, Lead Gen Form opens (oneClickLeadFormOpens), lead submissions (oneClickLeads), spend, and computed metrics: formOpenRate (opens / clicks), leadSubmitRate (submissions / opens), costPerLead (spend / submissions), and CTR. Use to identify high-performing LGF creatives, diagnose drop-off between form open and submission, or compare cost-per-lead across campaigns.
Inputs: end_date, start_date, campaign_ids, ad_account_id.
li_get_leadgen_formsA
List LinkedIn Lead Gen Forms on an ad account. Returns form name, state (ACTIVE/DRAFT/ARCHIVED), the list of questions asked (field type, label, pre-fill source), the thank-you page URL and message, and the associated landing page (if any). Use to audit form question setup, confirm form state before troubleshooting lead delivery, or verify which forms are attached to active campaigns.
Inputs: ad_account_id, state, page_size.
li_get_leadgen_responsesA
Retrieve actual Lead Gen Form submission data from LinkedIn. Each response includes questionResponses with field-by-field values (first name, last name, email, company, job title, phone, etc.) and submission timestamp. Filter by lead_form_id and/or submitted_after/before date range. Use for lead-to-CRM reconciliation against SFDC or Marketo, for auditing lead quality, or for confirming that a form integration is capturing the right fields. NOTE: This endpoint returns PII — handle output as sensitive data.
Inputs: ad_account_id, lead_form_id, submitted_after, submitted_before, +1 more.
li_get_video_analyticsA
Fetch video-specific performance metrics for LinkedIn campaigns, broken down by creative. Returns videoStarts, videoViews, videoFirstQuartileCompletions, videoMidpointCompletions, videoThirdQuartileCompletions, videoCompletions, plus a computed videoCompletionRate (completions / starts × 100). Use to evaluate video ad quality — high completion rates indicate compelling content; low rates signal drop-off. Scope to specific campaigns via campaign_ids or report at account level.
Inputs: campaign_ids, ad_account_id, start_date, end_date, +1 more.
li_list_ad_accountsA
List all LinkedIn ad accounts the authenticated user has access to. Returns account ID, name, status, currency, type (BUSINESS/ENTERPRISE), and reference organization URN. Use this first to discover the ad_account_id needed by other tools. Filter by status (ACTIVE/CANCELED/DRAFT/PENDING_DELETION/REMOVED) or omit to see all accounts.
Inputs: status, page_size.
li_list_campaign_groupsA
List campaign groups in a LinkedIn ad account. Campaign groups are containers that group related campaigns under a shared name and optional total budget cap. Returns group name, status, total budget, run schedule, and the campaigns count. Use to understand account structure before pulling campaign-level data.
Inputs: ad_account_id, status, page_size.
li_list_campaignsA
List campaigns in a LinkedIn ad account. Returns campaign name, status, objectiveType (WEBSITE_VISITS/LEAD_GENERATION/BRAND_AWARENESS/etc.), optimizationTargetType, bid amount, daily/total budget, run schedule, and targeting criteria summary. Filter by status or campaign_group_id. Use li_get_campaign for full targeting detail on a specific campaign.
Inputs: ad_account_id, status, campaign_group_id, page_size.
li_list_creativesA
List ad creatives in a LinkedIn ad account. Returns creative content type (SPONSORED_STATUS_UPDATE/MESSAGE/etc.), intendedStatus, associated campaigns, and content URNs. Filter by campaign_id to see all creatives on a specific campaign, or by status to find paused/archived ads. Use li_get_creative for full content detail on a specific creative.
Inputs: ad_account_id, campaign_id, status, page_size.
li_search_targeting_facetsA
Search LinkedIn targeting facet values to find the correct URNs for audience targeting. Facets include: jobTitles (e.g., 'Supply Chain Director'), skills (e.g., 'S&OP'), companies, industries, seniorities, locations, and more. Returns matching facet values with their LinkedIn URNs, which can then be used to configure campaign targeting via the Campaign Manager UI. Useful for researching targeting options, confirming exact category names, or building audience documentation.
Inputs: facet (required), query (required), locale, count.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
Each tool has a clearly distinct purpose: listing vs. getting details vs. performance reports vs. conversion/leadgen analytics vs. targeting research. Even similar-looking tools like li_get_campaign_performance, li_get_leadgen_form_performance, and li_get_conversion_performance target different metric types and dimensions, so an agent can reliably pick the right one.
All tools follow a consistent snake_case pattern with the li_ prefix and verb-noun structure (list_, get_, search_, compare_). The naming is highly predictable: li_list_* for enumeration, li_get_* for details or reports, and specific modifiers like _performance, _analytics, _insights. No mixed conventions or irregular verbs.
At 19 tools, this is slightly above the typical 3-15 range but still well-justified for the complexity of LinkedIn advertising. Each tool covers a distinct aspect (accounts, campaigns, creatives, performance, demographics, video, conversions, audiences, leadgen, targeting, pacing, comparison) without redundancy. The count feels reasonable for the domain's depth.
The toolset is heavily read/analytics-focused: it covers listing, getting details, and detailed performance/reporting for all major entities, but lacks any create, update, or delete operations for campaigns, creatives, or account settings. For a 'campaign manager' one might expect lifecycle management, but as a monitoring/analytics surface it is fairly complete. The gaps are significant if the intended scope includes editing, but for reporting and optimization analysis it works well.
Maintenance
Related MCP Connectors
LinkedIn Ads MCP server: run LinkedIn campaigns, ad groups, ads and reports from AI.
Hosted MCP server for marketing agencies: connect Google Ads, GA4, Search Console, Meta, LinkedIn and more to Claude or ChatGPT. Pull reports and make changes via OAuth login, no setup.
Meta, TikTok, LinkedIn, Snapchat and Reddit ads in Claude. Connect an ad account first.
Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.