{"_id":"linkedin-campaign-manager-mcp","_rev":"4-5e86b06eb95e9f76c31037affd75d52b","name":"linkedin-campaign-manager-mcp","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"linkedin-campaign-manager-mcp","version":"1.0.0","keywords":["mcp","linkedin","linkedin-ads","campaign-manager","marketing","b2b","paid-social","claude"],"license":"MIT","_id":"linkedin-campaign-manager-mcp@1.0.0","maintainers":[{"name":"zleventer","email":"zleventer@gmail.com"}],"homepage":"https://github.com/ZLeventer/linkedin-campaign-manager-mcp","bin":{"linkedin-campaign-manager-mcp":"dist/index.js"},"dist":{"shasum":"8e5b5f552b4fd8d308e4237c7d789c3ea8ad23b4","tarball":"https://registry.npmjs.org/linkedin-campaign-manager-mcp/-/linkedin-campaign-manager-mcp-1.0.0.tgz","fileCount":13,"integrity":"sha512-fFEAgWnjsE/BH36qCaQ/D/UDU2ttCe2UDk4UchUzsFeHwBWCPYas/dn0S1q6hwjibzf5UNSxCEbD1y0mLtGIbw==","signatures":[{"sig":"MEYCIQDHvew8nMJD9St3HzLTZ5UdDWenlGEjj0fMW3PifWNLvAIhAPRW2dobLiEvrlWkZzPgB+hhdDyzl+fz3BnIuJ67/OiH","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":70482},"type":"module","engines":{"node":">=20"},"gitHead":"ac7e48a1ba3631488108f4c090941c0ce02471c1","scripts":{"dev":"tsc --watch","auth":"tsc && node dist/init-auth.js","build":"tsc","start":"node dist/index.js","prepare":"npm run build"},"_npmUser":{"name":"zleventer","email":"zleventer@gmail.com"},"_npmVersion":"11.9.0","description":"MCP server for the LinkedIn Marketing API — 19 tools for ad accounts, campaigns, creatives, performance analytics, demographics, video analytics, budget pacing, conversions, lead gen forms, audiences, and targeting facets.","directories":{},"_nodeVersion":"24.14.0","dependencies":{"zod":"^3.23.8","@modelcontextprotocol/sdk":"^1.10.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.2"},"_npmOperationalInternal":{"tmp":"tmp/linkedin-campaign-manager-mcp_1.0.0_1777169139426_0.06395292670311714","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"linkedin-campaign-manager-mcp","version":"1.0.1","keywords":["mcp","linkedin","linkedin-ads","campaign-manager","marketing","b2b","paid-social","claude"],"license":"MIT","_id":"linkedin-campaign-manager-mcp@1.0.1","maintainers":[{"name":"zleventer","email":"zleventer@gmail.com"}],"homepage":"https://github.com/ZLeventer/linkedin-campaign-manager-mcp","bin":{"linkedin-campaign-manager-mcp":"dist/index.js"},"dist":{"shasum":"59507569c946d61abc01fd1e4cb4a7f867d8679b","tarball":"https://registry.npmjs.org/linkedin-campaign-manager-mcp/-/linkedin-campaign-manager-mcp-1.0.1.tgz","fileCount":13,"integrity":"sha512-PDNuekmMwt6SWlpZOyCIZO53Aooj0LrUQDtxQ3HujUBocihtNS0FXs69mHdHuUaOCaETAGDphbK4j9wJmmBzIQ==","signatures":[{"sig":"MEUCIEFiQWP/I/7fbTTL1qyyoaN758s3fwn2iDrnWe7q4dIoAiEA6z3ypXyG7rqtJdvxp3grlPCmgCW4xCoQNESiZy7Ng10=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":72498},"type":"module","engines":{"node":">=20"},"gitHead":"927ebe82f16feed0d29ae28aa63df876ff61d036","mcpName":"io.github.ZLeventer/linkedin-campaign-manager-mcp","scripts":{"dev":"tsc --watch","auth":"tsc && node dist/init-auth.js","build":"tsc","start":"node dist/index.js","prepare":"npm run build"},"_npmUser":{"name":"zleventer","email":"zleventer@gmail.com"},"_npmVersion":"11.9.0","description":"MCP server for the LinkedIn Marketing API — 19 tools for ad accounts, campaigns, creatives, performance analytics, demographics, video analytics, budget pacing, conversions, lead gen forms, audiences, and targeting facets.","directories":{},"_nodeVersion":"24.14.0","dependencies":{"zod":"^3.23.8","@modelcontextprotocol/sdk":"^1.10.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.2"},"_npmOperationalInternal":{"tmp":"tmp/linkedin-campaign-manager-mcp_1.0.1_1777226836995_0.7049327369384188","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"linkedin-campaign-manager-mcp","version":"1.1.0","keywords":["mcp","linkedin","linkedin-ads","campaign-manager","marketing","b2b","paid-social","claude"],"license":"MIT","_id":"linkedin-campaign-manager-mcp@1.1.0","maintainers":[{"name":"zleventer","email":"zleventer@gmail.com"}],"homepage":"https://github.com/ZLeventer/linkedin-campaign-manager-mcp","bin":{"linkedin-campaign-manager-mcp":"dist/index.js"},"dist":{"shasum":"98bfaa908b27197d2700a1c28bf6ae431917be47","tarball":"https://registry.npmjs.org/linkedin-campaign-manager-mcp/-/linkedin-campaign-manager-mcp-1.1.0.tgz","fileCount":13,"integrity":"sha512-1CGwweqNEokige1yAsjsB6gXmG+8WaMWmBhLqSMIK/yu/jKxGT/nDrASBRL4SYUc50whSDkM+lNDaomAh/VdmA==","signatures":[{"sig":"MEUCIQC8LO6XmDWqk5EYOSLAs+ujV4+nR+Psr7XpKE4M+9A7MwIgZnAdc6RhPuRSwvlx1Ug4mLSs7zrFQXPb4WL0DkulNBU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":78815},"type":"module","engines":{"node":">=20"},"gitHead":"4157681dd1006789ea907b31cbd02ccb04e1b217","mcpName":"io.github.ZLeventer/linkedin-campaign-manager-mcp","scripts":{"dev":"tsc --watch","auth":"tsc && node dist/init-auth.js","build":"tsc","start":"node dist/index.js","prepare":"npm run build"},"_npmUser":{"name":"zleventer","email":"zleventer@gmail.com"},"_npmVersion":"11.9.0","description":"MCP server for the LinkedIn Marketing API — 19 tools for ad accounts, campaigns, creatives, performance analytics, demographics, video analytics, budget pacing, conversions, lead gen forms, audiences, and targeting facets.","directories":{},"_nodeVersion":"24.14.0","dependencies":{"zod":"^3.23.8","@modelcontextprotocol/sdk":"^1.10.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.2","@types/node":"^22.10.2"},"_npmOperationalInternal":{"tmp":"tmp/linkedin-campaign-manager-mcp_1.1.0_1777311742986_0.5317976114536787","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"linkedin-campaign-manager-mcp","version":"1.1.1","mcpName":"io.github.ZLeventer/linkedin-campaign-manager-mcp","description":"MCP server for the LinkedIn Marketing API — 19 tools for ad accounts, campaigns, creatives, performance analytics, demographics, video analytics, budget pacing, conversions, lead gen forms, audiences, and targeting facets.","type":"module","bin":{"linkedin-campaign-manager-mcp":"dist/index.js"},"scripts":{"build":"tsc","start":"node dist/index.js","dev":"tsc --watch","prepare":"npm run build","auth":"tsc && node dist/init-auth.js"},"keywords":["mcp","linkedin","linkedin-ads","campaign-manager","marketing","b2b","paid-social","claude"],"license":"MIT","homepage":"https://github.com/ZLeventer/linkedin-campaign-manager-mcp","dependencies":{"@modelcontextprotocol/sdk":"^1.10.0","zod":"^3.23.8"},"devDependencies":{"@types/node":"^22.10.2","typescript":"^5.7.2"},"engines":{"node":">=20"},"gitHead":"e7dc1610146cef50abd2bb82f1c523c9c493cab8","_id":"linkedin-campaign-manager-mcp@1.1.1","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-DK3cZNIQNz9MgC7h/jX1roRq41FSUnjxD9fD6ylWcj3qQ53DOdGFvwYUc10h0UIQIZjwjWztskUxEUals66Mxw==","shasum":"0c0aa88ebf8d2cbf90ef8242ffa14bc8effb721c","tarball":"https://registry.npmjs.org/linkedin-campaign-manager-mcp/-/linkedin-campaign-manager-mcp-1.1.1.tgz","fileCount":13,"unpackedSize":78815,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICSKS/QngQNxjdgCoaIm9/pQDW7qRzOBBl5BnDZB5U1FAiEAqDreiUjA4TEyoF1D0f0EQg8DE8uN6r6RB6UxzMLULCc="}]},"_npmUser":{"name":"zleventer","email":"zleventer@gmail.com"},"directories":{},"maintainers":[{"name":"zleventer","email":"zleventer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/linkedin-campaign-manager-mcp_1.1.1_1777312717193_0.717774305349234"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-26T02:05:39.425Z","modified":"2026-04-27T17:58:37.759Z","1.0.0":"2026-04-26T02:05:39.561Z","1.0.1":"2026-04-26T18:07:17.152Z","1.1.0":"2026-04-27T17:42:23.159Z","1.1.1":"2026-04-27T17:58:37.330Z"},"license":"MIT","homepage":"https://github.com/ZLeventer/linkedin-campaign-manager-mcp","keywords":["mcp","linkedin","linkedin-ads","campaign-manager","marketing","b2b","paid-social","claude"],"description":"MCP server for the LinkedIn Marketing API — 19 tools for ad accounts, campaigns, creatives, performance analytics, demographics, video analytics, budget pacing, conversions, lead gen forms, audiences, and targeting facets.","maintainers":[{"name":"zleventer","email":"zleventer@gmail.com"}],"readme":"# LinkedIn Campaign Manager MCP\n\n[![npm version](https://img.shields.io/npm/v/linkedin-campaign-manager-mcp.svg)](https://www.npmjs.com/package/linkedin-campaign-manager-mcp)\n[![npm downloads](https://img.shields.io/npm/dm/linkedin-campaign-manager-mcp.svg)](https://www.npmjs.com/package/linkedin-campaign-manager-mcp)\n[![Node.js](https://img.shields.io/badge/node-%3E%3D20-green.svg)](https://nodejs.org)\n[![MCP](https://img.shields.io/badge/MCP-compatible-blueviolet)](https://modelcontextprotocol.io)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n**MCP server for the LinkedIn Marketing API — query campaigns, performance, and Lead Gen Forms from Claude in plain English.**\n\n19 read-only tools covering ad accounts, campaigns, creatives, performance analytics, demographics, video analytics, budget pacing, period comparisons, conversions, Lead Gen Forms, audiences, and targeting facets. Built for B2B paid social teams running Sponsored Content, Lead Gen Forms, and account-based campaigns on LinkedIn.\n\n---\n\n## Why this exists\n\nThe LinkedIn Marketing API is notoriously painful to work with: monthly Rosetta versioning, undocumented field mappings, Rest.li-style nested query params for analytics, and 60-day access tokens that silently expire. This server handles all of that under the hood so you can ask questions in plain English instead of hand-writing `dateRange=(start:(year:...))`.\n\nNo other open-source MCP server for LinkedIn Ads ships this depth. Most stop at \"list campaigns.\" This one includes demographics, video completion funnel, budget pacing, period comparisons, and Lead Gen Form responses with PII so you can reconcile leads against Marketo or Salesforce.\n\n---\n\n## Example prompts\n\nOnce installed, ask Claude things like:\n\n- *\"What's our LinkedIn Ads spend trend the last 28 days, broken down by campaign group?\"*\n- *\"Compare CPL on the competitor-conquest campaigns this month vs. last — which creatives moved the number?\"*\n- *\"Pull demographics for our top-spending campaign — what seniority and industry are converting?\"*\n- *\"Which Lead Gen Forms had the highest submit rate last month, and what did each cost per lead?\"*\n- *\"Show the video completion funnel for our awareness campaign — where are people dropping off?\"*\n- *\"Are any campaigns at risk of overspending? Show budget pacing across all active ones.\"*\n- *\"Pull yesterday's Lead Gen Form responses so I can spot-check them against Marketo.\"*\n\n---\n\n## Demo\n\n> 🎥 *Walkthrough video coming soon — querying LinkedIn campaign performance from Claude Code in under 60 seconds.*\n\n---\n\n## Tools\n\n| Tool | What it does |\n|---|---|\n| `li_list_ad_accounts` | All ad accounts the user can access, with status + currency. |\n| `li_get_account` | Single account detail: currency, status, type, billing info. |\n| `li_list_campaigns` | Campaigns in an account; filter by status or campaign group. |\n| `li_get_campaign` | Full campaign detail: targeting criteria, bid, budget, objective. |\n| `li_list_campaign_groups` | Campaign groups (shared budget/objective containers). |\n| `li_list_creatives` | Ad creatives; filter by campaign or status. |\n| `li_get_creative` | Full creative detail: headline, copy, URL, image/video URNs. |\n| `li_get_campaign_performance` | Impressions/clicks/spend/conversions/leads over a date range. DAILY/MONTHLY/YEARLY/ALL granularity. |\n| `li_get_demographics_report` | Performance by company / company size / industry / job function / job title / seniority / region / country. |\n| `li_compare_periods` | WoW/MoM/YoY with per-entity _current/_prior/_delta/_pct_change columns computed server-side. |\n| `li_get_video_analytics` | Video completion funnel per creative: starts → 25% → 50% → 75% → completions + completion rate. |\n| `li_get_budget_pacing` | Spend vs. budget utilization % for active campaigns over a configurable period. |\n| `li_get_conversion_events` | Insight Tag conversion event definitions: type, attribution windows, enabled status. |\n| `li_get_conversion_performance` | Performance by conversion event (CONVERSION pivot): post-click vs. view-through breakdown. |\n| `li_get_audience_insights` | DMP segments: matched audiences, company lists, combined/lookalike segments + sizes. |\n| `li_search_targeting_facets` | Typeahead search for targeting values (job titles, skills, companies, industries, locations, seniorities). |\n| `li_get_leadgen_forms` | Lead Gen Forms + question config + state. |\n| `li_get_leadgen_responses` | Actual form submissions with PII (name, email, company, job title). |\n| `li_get_leadgen_form_performance` | LGF metrics per creative: form open rate, submit rate, cost per lead. |\n\n---\n\n## Setup\n\n### 1. Install\n\n```bash\nnpm install -g linkedin-campaign-manager-mcp\n```\n\nOr clone + build locally:\n\n```bash\ngit clone https://github.com/ZLeventer/linkedin-campaign-manager-mcp\ncd linkedin-campaign-manager-mcp\nnpm install\nnpm run build\n```\n\n### 2. Create a LinkedIn Developer App\n\nThe Marketing API is gated. You need a LinkedIn Developer App with specific product approvals:\n\n1. Go to [developer.linkedin.com](https://developer.linkedin.com) → **Create App** (associate with your company page).\n2. **Products tab** — request access to:\n   - `Marketing Developer Platform` (covers `r_ads`, `r_ads_reporting`)\n   - `Lead Gen Forms` or `Community Management API` (covers `r_ads_leadgen_automation`)\n3. LinkedIn reviews app access manually — typically 2–6 weeks.\n4. **Auth tab** → **Authorized Redirect URLs** — add: `http://127.0.0.1:53123`\n   (change `53123` if you set a different `LINKEDIN_OAUTH_PORT`).\n5. Copy **Client ID** and **Client Secret** from the Auth tab.\n\n> Without product approval every API call returns 403. The server compiles and starts cleanly — the 403 is an app-level permission issue, not a code issue.\n\n### 3. Configure environment\n\n```bash\ncp .env.example .env\n# edit .env with your LINKEDIN_CLIENT_ID, LINKEDIN_CLIENT_SECRET,\n# LINKEDIN_DEFAULT_AD_ACCOUNT (numeric ID from Campaign Manager URL)\n```\n\n### 4. Authorize (one-time OAuth flow)\n\n```bash\nnpm run auth\n```\n\nThis opens a local HTTP server on port 53123 (or `LINKEDIN_OAUTH_PORT`), prints an auth URL to your terminal, and waits for the OAuth callback. After you approve in the browser, it exchanges the code for an access token + 365-day refresh token and saves them to `token.json` (mode 0600).\n\nYou only need to re-run `npm run auth` if the refresh token expires (after 365 days).\n\n### 5. Wire into Claude Code (or any MCP client)\n\nAdd to `~/.claude.json` under `mcpServers`:\n\n```json\n{\n  \"mcpServers\": {\n    \"linkedin\": {\n      \"command\": \"linkedin-campaign-manager-mcp\",\n      \"env\": {\n        \"LINKEDIN_CLIENT_ID\": \"your_client_id\",\n        \"LINKEDIN_CLIENT_SECRET\": \"your_client_secret\",\n        \"LINKEDIN_TOKEN_PATH\": \"/absolute/path/to/token.json\",\n        \"LINKEDIN_DEFAULT_AD_ACCOUNT\": \"123456789\",\n        \"LINKEDIN_API_VERSION\": \"202504\"\n      }\n    }\n  }\n}\n```\n\nOr if running from source:\n\n```json\n{\n  \"mcpServers\": {\n    \"linkedin\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/linkedin-campaign-manager-mcp/dist/index.js\"],\n      \"env\": {\n        \"LINKEDIN_CLIENT_ID\": \"...\",\n        \"LINKEDIN_CLIENT_SECRET\": \"...\",\n        \"LINKEDIN_TOKEN_PATH\": \"/path/to/token.json\",\n        \"LINKEDIN_DEFAULT_AD_ACCOUNT\": \"123456789\"\n      }\n    }\n  }\n}\n```\n\nRestart Claude Code. The 19 tools appear under the `linkedin` server.\n\n---\n\n## Environment variables\n\n| Variable | Required | Default | Description |\n|---|---|---|---|\n| `LINKEDIN_CLIENT_ID` | Yes | — | OAuth app client ID |\n| `LINKEDIN_CLIENT_SECRET` | Yes | — | OAuth app client secret |\n| `LINKEDIN_TOKEN_PATH` | No | `./token.json` | Path to read/write the token file |\n| `LINKEDIN_DEFAULT_AD_ACCOUNT` | Recommended | — | Numeric account ID; tools fall back to this when `ad_account_id` is not passed |\n| `LINKEDIN_OAUTH_PORT` | No | `53123` | Loopback port for OAuth redirect |\n| `LINKEDIN_API_VERSION` | No | `202504` | LinkedIn Rosetta API version (YYYYMM) |\n\n---\n\n## URN handling\n\nLinkedIn resources are identified by URNs: `urn:li:sponsoredAccount:123`, `urn:li:sponsoredCampaign:456`, etc.\n\nAll tool inputs accept either the bare numeric ID or the full URN — the client wraps bare IDs automatically. Numeric IDs appear in Campaign Manager URLs (`/accounts/<id>/`, `/campaigns/<id>/`).\n\n---\n\n## Date inputs\n\nAll date parameters accept:\n\n| Input | Meaning |\n|---|---|\n| `2024-10-01` | Literal ISO date |\n| `today` / `yesterday` | Self-explanatory |\n| `7daysAgo`, `28daysAgo`, `90daysAgo` | N calendar days before today |\n\nDefault range: `28daysAgo` → `yesterday`.\n\n---\n\n## LinkedIn-specific gotchas\n\n### API version churn\n\nLinkedIn Rosetta uses monthly versions (`202504` = April 2025). Versions deprecate ~12 months after release — you'll get `410 Gone` errors when that happens. Bump `LINKEDIN_API_VERSION` quarterly. See the [versioning docs](https://learn.microsoft.com/en-us/linkedin/marketing/versioning).\n\n### Analytics query shape\n\n`/adAnalytics` uses Rest.li-style nested params, **not** plain ISO strings:\n\n```\ndateRange=(start:(year:2024,month:10,day:1),end:(year:2024,month:10,day:31))\ncampaigns=List(urn:li:sponsoredCampaign:123,urn:li:sponsoredCampaign:456)\n```\n\nThis is handled internally by `dateRangeParam()` and `liGetRaw()`. If you extend the server, route analytics calls through `liGetRaw()` with a manually-built URL — do not use `liGet()` for analytics endpoints as `URLSearchParams` will mangle the nested parens.\n\n### Analytics data lag\n\nLinkedIn analytics typically lag 2–6 hours for most metrics, and up to 24 hours for conversion data. Yesterday's numbers are usually complete; today's are partial.\n\n### 60-day access tokens, 365-day refresh tokens\n\nAccess tokens expire in 60 days; refresh tokens in 365 days. The client auto-refreshes the access token on every request when needed. If the refresh token expires, run `npm run auth` again.\n\n### Lead Gen response PII\n\n`li_get_leadgen_responses` returns actual lead PII — name, email, company, job title. Treat output as sensitive: do not write to shared logs, unencrypted storage, or public channels. LinkedIn's data-use policy requires deleting lead responses within 90 days of receipt unless the lead is actively consented. This tool is intended for authorized CRM reconciliation (Marketo/SFDC).\n\n### Rate limits\n\nLinkedIn does not publish hard rate-limit numbers. In practice, expect throttling around 100 analytics calls/minute per app. No retry-on-429 is built in — if you hit limits, reduce call frequency or cache results client-side.\n\n---\n\n## When NOT to use this server\n\n- **Creating or editing campaigns, budgets, or creatives** — read-only by design. Campaign creation has too many failure modes to automate safely; use the Campaign Manager UI.\n- **Real-time impression data** — use the LinkedIn Insight Tag + GA4 for near-realtime.\n- **Audience size estimation for arbitrary targeting criteria** — use the Campaign Manager audience builder UI for ad-hoc sizing. `li_get_audience_insights` only returns sizes of saved/uploaded segments.\n\n---\n\n## License\n\nMIT © 2026 [Zach Leventer](https://github.com/ZLeventer)\n","readmeFilename":"README.md"}