LinkedIn Ads
Overview
Description from the maker (original English)
MCP server for LinkedIn Campaign Manager — campaigns, creatives, and analytics
PopNx MCP’s three pillars
These three are never merged into one score: opinions, measurements and popularity are different things.
- User voiceiNo reviews yetReviews open together with accounts in a later step
- Our basic checksi1 of 1 passedChecked from public information; code not scanned yet
- UsageiVery new↓ 297/wk · ★ –
What you can do with it
We have not written a plain-language summary for this one yet. Below are the facts we read from the registry.
- Connection: Runs on your computer
- Transport: stdio
- Category: Marketing & social media
- You need to fill in: LINKEDIN_CLIENT_ID, LINKEDIN_CLIENT_SECRET, LINKEDIN_ACCESS_TOKEN
Install
Pick the AI app you use, then copy the settings.
Before you install
- Basic checks: 1 of 1 passed
- Runs on your computer with your user’s permissions (files, network, apps).
- You fill in yourself:
LINKEDIN_CLIENT_ID,LINKEDIN_CLIENT_SECRET,LINKEDIN_ACCESS_TOKEN
Values marked secret are keys to your account. Never share them or paste them into a chat.
You need
- npmNode.js installed (for the npx command)
Which app do you use?
Pick your app above. We remember it, so next time the button says “Install in …”.
Open Claude Desktop → Settings → Developer → Edit Config, and paste this into claude_desktop_config.json
{
"mcpServers": {
"linkedin-ads": {
"command": "npx",
"args": [
"-y",
"mcp-linkedin-ads"
],
"env": {
"LINKEDIN_CLIENT_ID": "your-value",
"LINKEDIN_CLIENT_SECRET": "your-value",
"LINKEDIN_ACCESS_TOKEN": "your-value"
}
}
}
}Run this in your terminal
claude mcp add linkedin-ads --env LINKEDIN_CLIENT_ID=your-value --env LINKEDIN_CLIENT_SECRET=your-value --env LINKEDIN_ACCESS_TOKEN=your-value -- npx -y mcp-linkedin-adsFill in the empty values before running it.
Or copy the settings yourself
Paste into .cursor/mcp.json in your project, or ~/.cursor/mcp.json
{
"mcpServers": {
"linkedin-ads": {
"command": "npx",
"args": [
"-y",
"mcp-linkedin-ads"
],
"env": {
"LINKEDIN_CLIENT_ID": "your-value",
"LINKEDIN_CLIENT_SECRET": "your-value",
"LINKEDIN_ACCESS_TOKEN": "your-value"
}
}
}
}Your browser asks to open the app, then the app shows the settings and asks you to confirm. Key values are left empty for you to fill in.
Or copy the settings yourself
Paste into .vscode/mcp.json in your project
{
"servers": {
"linkedin-ads": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-linkedin-ads"
],
"env": {
"LINKEDIN_CLIENT_ID": "your-value",
"LINKEDIN_CLIENT_SECRET": "your-value",
"LINKEDIN_ACCESS_TOKEN": "your-value"
}
}
}
}Your browser asks to open the app, then the app shows the settings and asks you to confirm. Key values are left empty for you to fill in.
This one runs on your computer, and ChatGPT can only connect to servers on the internet. Pick another app.
Your choice stays on this device in a cookie; no account needed.
Values you fill in
- LinkedIn OAuth app client ID
- LinkedIn OAuth app client secret
- LinkedIn OAuth access token
These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.
What it can do
Runs on your computer; the tool list appears in your AI app after you install it.
Basic checksi
We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 8, 2026
- ✓ Pass
Maker matches the repo
The registry name was verified with the GitHub account mharnett, which owns the repo
- … Not checked yet
Still maintained
We have not read this repo from GitHub yet
- … Not checked yet
Has a licence
We have not read this repo from GitHub yet
- – Not applicable
Endpoint responds
This one runs on your computer; there is no internet endpoint
- – Not applicable
Sign-in with OAuth
Runs on your computer and uses local settings instead
- … Not checked yet
No hidden instructions in tool descriptions
Runs on your computer; we can only read tool lists from internet endpoints
Compared with others in Marketing & social mediai
- More stars than 0% of the other 3597 servers in this category
- Published to the registry more recently than 3% of the other 3597 servers in this category
- Basic checks equal to or better than 100% of the other 3597 servers in this category
Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.
Common questions
Is LinkedIn Ads safe?
It passed 1 of 1 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.
What keys or codes does it need?
You need to fill in: LINKEDIN_CLIENT_ID, LINKEDIN_CLIENT_SECRET, LINKEDIN_ACCESS_TOKEN
Does it run on my computer or in the cloud?
It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).
Is it still maintained?
The GitHub repo last changed –, and the latest version (1.0.2) reached the registry 8 months ago.
Which apps can use it?
Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Node.js on your computer.
What can I use instead?
In the same category: MCP YouTube Transcript, Google Analytics MCP, BibiGPT YouTube Video Summarizer
Alternatives
Servers in the same category from other makers, sorted by stars.
Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi
Google Analytics MCP
GA4 MCP server for AI agents: schema discovery, server-side aggregation, analysis-ready defaults.
BibiGPT YouTube Video Summarizer
AI video summarizer: summarize and transcribe YouTube, Bilibili, TikTok and podcast videos.
README from the maker
Open the README
Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.
LinkedIn Ads MCP Server
Production-grade MCP server for LinkedIn Campaign Manager API. Enables Claude to manage LinkedIn ad accounts, campaigns, ad sets, and creatives with full read/write support.
Features:
- 7 tools -- production-tested
- Multi-account management (multiple LinkedIn ad accounts)
- Campaign and campaign group listing
- Account and campaign performance analytics
- Flexible pivot-based reporting (demographics, device, creative breakdowns)
- Landing page click-based CTR (not total clicks)
Stats:
- ⭐ Production-proven: active campaigns under management
- 📊 Multi-client: per-client config, no client data in repo
- 🔄 CTR accuracy: Uses
landingPageClicks(not total clicks with engagement) - ✅ Full test coverage: 40+ contract tests
Installation
npm install mcp-linkedin-ads
Configuration
Security: Never share your .mcp.json file or commit it to git -- it may contain API credentials. Add .mcp.json to your .gitignore.
- Get OAuth credentials:
- Go to LinkedIn Developer Portal
- Create a new app with "Sign In with LinkedIn" + "Marketing Developer Platform"
- Scopes:
r_ads,rw_ads,w_member_social,r_organization_social,w_organization_social
- Create `config.json`:
cp config.example.json config.json
- Fill in your credentials:
{
"oauth": { "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET" }, "clients": { "default": { "account_id": "YOUR_AD_ACCOUNT_ID", "name": "My Account" } } }
- Set environment variables (recommended for production):
export LINKEDIN_ADS_CLIENT_ID="your_client_id"
export LINKEDIN_ADS_CLIENT_SECRET="your_client_secret" export LINKEDIN_ADS_ACCESS_TOKEN="your_access_token"
Environment variables
| Variable | Required | Default | Purpose |
|---|---|---|---|
LINKEDIN_ADS_CLIENT_ID | yes | -- | OAuth client ID |
LINKEDIN_ADS_CLIENT_SECRET | yes | -- | OAuth client secret |
LINKEDIN_ADS_ACCESS_TOKEN | yes | -- | OAuth access token |
LINKEDIN_ADS_REFRESH_TOKEN | optional | -- | OAuth refresh token (rotated automatically when set) |
LINKEDIN_ADS_MCP_WRITE | optional | false | Set to true to expose mutating tools. Read-only by default. |
Read-only by default
Write tools (currently linkedin_ads_create_predictive_audience and linkedin_ads_update_predictive_audience) are hidden from ListTools and refused at call time unless LINKEDIN_ADS_MCP_WRITE=true is set in the MCP server environment. This mirrors the Google Ads MCP gate. Motivation: prevent a casual LLM request from mutating production ad accounts without the operator explicitly opting in.
Each write also requires account_id and confirm_account_id set to the same id. The account is never resolved from the working directory or a default, and an update refuses a segment owned by a different account. Every write reads the object back and returns any field that did not stick as mismatches.
Predictive audiences (lookalikes)
| Tool | Kind |
|---|---|
linkedin_ads_list_predictive_audiences | read — every predictive audience in an account, with locations, seeds, size, build status |
linkedin_ads_get_predictive_audience | read — one audience by parent DMP segment id |
linkedin_ads_create_predictive_audience | write — parent DMP segment + audience, then read-back; dry_run supported |
linkedin_ads_update_predictive_audience | write — partial update of name, locations, seeds, desired size; dry_run supported |
Requirements and behaviour (verified live 2026-11-05):
- The token needs the
rw_dmp_segmentsscope (included inconfig.example.json). LinkedIn grants DMP write access per developer app. - These calls use
LinkedIn-Version: 202607regardless ofapi.version; the audience endpoints 404 at 202604. desired_audience_countand at least oneurn:li:geo:location are required on create.- Freshly created audiences 404 their POST/PATCH for a few seconds, and reads lag writes; the tools retry 404s and re-read before reporting a mismatch.
- If create fails after the parent segment exists, the error names it; retry with
existing_dmp_segment_idinstead of creating a second parent. - Segments created after early September 2026 cannot be attached to campaigns through the API in our testing; attach them in Campaign Manager.
Usage
Start the server
npm start
Use with Claude Code
Add to ~/.claude.json:
{
"mcpServers": { "linkedin-ads": { "type": "http", "url": "http://localhost:3001" } } }
Claude Desktop: Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).
Example API Calls
// Get client context
linkedin_ads_get_client_context({ working_directory: "/path/to/project" })
// List campaigns linkedin_ads_list_campaigns({ account_id: "511664399" })
// Get campaign performance linkedin_ads_campaign_performance({ start_date: "2026-01-01", end_date: "2026-03-31", time_granularity: "MONTHLY" })
// Flexible analytics (e.g. by seniority) linkedin_ads_analytics({ start_date: "2026-03-01", end_date: "2026-03-31", pivot: "MEMBER_SENIORITY" })
Key Data Conventions
CTR Calculation
- Always use
landingPageClicks(LP clicks), NOTclicks(total clicks) - Total clicks include social engagement (likes, comments, shares) which inflates CTR
- This is critical for accurate campaign analysis
Campaign Status
DRAFT— Not yet activeACTIVE— Actively servingPAUSED— Paused manuallyARCHIVED— Historical record
Audience Targeting
- Flexible targeting:
flexible_specarray (OR logic between items) - Exclude targeting:
exclude_specarray - Job titles, seniority levels, functions, locations all supported
CLI Tools
npm run dev # Run in dev mode (tsx)
npm run build # Compile TypeScript npm test # Run contract tests
Architecture
Files:
src/index.ts— MCP server, OAuth flow, tool handlerssrc/tools.ts— Tool schema definitionssrc/errors.ts— Error handling & classificationconfig.json— Credentials & client mapping
Error Handling:
- OAuth errors: Clear messages for token refresh needed
- Rate limits: Automatic retry with backoff (recommended by LinkedIn)
- Invalid campaigns: Validation before creation (save API quota)
Development
Adding a New Tool
- Define schema in
src/tools.ts - Add handler in
src/index.tstool dispatch - Test with contract test in
.contract.test.ts - Document in here
Testing
npm test -- --run # Single run
npm test -- --watch # Watch mode
Troubleshooting
Config file not found
cp config.example.json config.json
Fill in your OAuth credentials and account IDs
Missing required credentials
Check that:
LINKEDIN_ADS_CLIENT_IDandLINKEDIN_ADS_CLIENT_SECRETare set (or in config.json)config.jsonexists and contains at least one client withaccount_id- OAuth tokens are valid (they expire)
Rate limit exceeded
LinkedIn enforces strict rate limits. The server includes automatic retry with exponential backoff. If you hit limits:
- Wait before retrying
- Batch operations when possible
- Reduce query frequency
CTR seems too low
Verify you're using landingPageClicks (LP clicks), not clicks (all interactions). The latter includes social engagement and will inflate CTR incorrectly.
License
MIT
Contributing
Contributions welcome! Please:
- Add tests for new tools
- Update README with new features
- Follow existing code style
- Tag release with version
Support
- Issues: GitHub issues for bugs/feature requests
- Docs: See
docs/folder for detailed API reference - Community: Discussions in GitHub
Built By
[Mark Harnett](https://www.linkedin.com/in/markharnett/) — Demand generation leader and paid media practitioner building AI-powered ad management tools. This server was born from managing LinkedIn campaigns across multiple clients and wanting Claude to handle campaign ops, performance analysis, and bulk creative updates autonomously.
Built with production workloads in mind: resilient API calls (circuit breakers, retry with backoff, response truncation), accurate CTR calculation (landing page clicks, not total clicks), and multi-account support.
Also by Mark: mcp-bing-ads -- Bing/Microsoft Ads MCP server with 10 tools.
Last Updated: 2026-03-13