Listed from the MCP registry; nobody on Odel publishes it.
MCP server for LinkedIn Campaign Manager — campaigns, creatives, and analytics
Runs on your machine from its package; the steps are below.
At most: creates or changes data: records, files, settings.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally over stdio
This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).
Run
npx -y mcp-linkedin-ads
MCP client config
{
"mcpServers": {
"linkedin-ads": {
"command": "npx",
"args": [
"-y",
"mcp-linkedin-ads"
]
}
}
}Production-grade MCP server for LinkedIn Campaign Manager API. Enables Claude to report on LinkedIn ad accounts, campaign groups and campaigns, and to manage predictive (lookalike) audiences. Reporting is read-only; the two audience write tools are off unless enabled.
Claude Code, one line (replace the placeholder values with your own; see Configuration for how to get them):
claude mcp add --env LINKEDIN_ADS_ACCESS_TOKEN=YOUR_ACCESS_TOKEN_HERE --transport stdio mcp-linkedin-ads -- npx -y mcp-linkedin-ads
An access token alone is enough to start. Add --env LINKEDIN_ADS_ACCOUNT_ID=YOUR_ACCOUNT_ID to set a default ad account. To refresh tokens automatically, also set LINKEDIN_ADS_CLIENT_ID and LINKEDIN_ADS_CLIENT_SECRET. The server uses LinkedIn API version 202607 and starts read-only; set LINKEDIN_ADS_MCP_WRITE=true to expose the two predictive-audience write tools.
Add this to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS), then fully quit and restart Claude Desktop:
{
"mcpServers": {
"mcp-linkedin-ads": {
"command": "npx",
"args": ["-y", "mcp-linkedin-ads"],
"env": {
"LINKEDIN_ADS_ACCESS_TOKEN": "YOUR_ACCESS_TOKEN_HERE"
}
}
}
}
Add this to ~/.codex/config.toml:
[mcp_servers.mcp-linkedin-ads]
command = "npx"
args = ["-y", "mcp-linkedin-ads"]
[mcp_servers.mcp-linkedin-ads.env]
LINKEDIN_ADS_ACCESS_TOKEN = "YOUR_ACCESS_TOKEN_HERE"
Features:
Stats:
landingPageClicks (not total clicks with engagement)npm install mcp-linkedin-ads
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:
r_ads, rw_ads, w_member_social, r_organization_social, w_organization_socialCreate 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"
| 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. |
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.
| 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):
rw_dmp_segments scope (included in config.example.json).
LinkedIn grants DMP write access per developer app.LinkedIn-Version: 202607,
set only in src/config.ts; an api.version in config.json is ignored with a
warning. The audience endpoints 404 at 202604.desired_audience_count and at least one urn:li:geo: location are required on create.existing_dmp_segment_id instead of creating a second parent.The server runs locally over stdio; your MCP client starts it. Add to ~/.claude.json (or a project .mcp.json):
{
"mcpServers": {
"linkedin-ads": {
"command": "npx",
"args": ["-y", "mcp-linkedin-ads"],
"env": {
"LINKEDIN_ADS_CLIENT_ID": "your_client_id",
"LINKEDIN_ADS_CLIENT_SECRET": "your_client_secret",
"LINKEDIN_ADS_ACCESS_TOKEN": "your_access_token"
}
}
}
}
Claude Desktop: Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).
// 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"
})
landingPageClicks (LP clicks), NOT clicks (total clicks)DRAFT — Not yet activeACTIVE — Actively servingPAUSED — Paused manuallyARCHIVED — Historical recordflexible_spec array (OR logic between items)exclude_spec arraynpm run dev # Run in dev mode (tsx)
npm run build # Compile TypeScript
npm test # Run contract tests
Files:
src/index.ts — MCP server, OAuth flow, tool handlerssrc/tools.ts — Tool schema definitionssrc/errors.ts — Error handling & classificationconfig.json — Credentials & client mappingError Handling:
src/tools.tssrc/index.ts tool dispatch.contract.test.tsnpm test -- --run # Single run
npm test -- --watch # Watch mode
Config file not foundcp config.example.json config.json
# Fill in your OAuth credentials and account IDs
Missing required credentialsCheck that:
LINKEDIN_ADS_CLIENT_ID and LINKEDIN_ADS_CLIENT_SECRET are set (or in config.json)config.json exists and contains at least one client with account_idRate limit exceededLinkedIn enforces strict rate limits. The server includes automatic retry with exponential backoff. If you hit limits:
CTR seems too lowVerify you're using landingPageClicks (LP clicks), not clicks (all interactions). The latter includes social engagement and will inflate CTR incorrectly.
MIT
Contributions welcome! Please:
docs/ folder for detailed API referenceMark Harnett — 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 13 tools.
Last Updated: 2026-03-13