LinkedIn Ads MCP Server
LinkedIn Ads MCP 服务器
一个将 Claude (Code 或 Desktop) 连接到 LinkedIn Ads API 的 MCP 服务器,让您能够通过自然语言控制广告系列管理、受众定位、创意上传、分析和账户审计。
功能概述
类别 | 功能 |
广告系列 | 创建、列出、更新广告系列组和广告系列 |
受众群体 | 创建/编辑已保存的受众群体,批量地理位置定位切换 |
广告创意 | 上传图片和视频,创建广告创意 |
分析报告 | 广告系列和创意效果报告,账户摘要 |
账户审计 | 10 项账户审计(CTR 下降、预算使用率、缺失转化跟踪等) |
批量操作 | 队列化并执行批量广告系列/组的创建和更新 |
内置最佳实践强制执行 — 在每次写入操作中,受众扩展和受众网络默认处于禁用状态。
Related MCP server: meta-ads-mcp
前置要求
Node.js 18+
拥有 Advertising API 访问权限的 LinkedIn 开发者应用(在此申请)
OAuth 权限范围:
r_ads,rw_ads,r_ads_reporting,r_basicprofile您的 LinkedIn 广告账户 ID
快速开始
git clone <this-repo-url>
cd linkedin-ads-mcp-server
npm install
cp .env.example .env
# Edit .env with your LinkedIn credentials
npm run build
npm start您应该会看到:LinkedIn Ads MCP server running — 34 tools registered
连接到 Claude
Claude Code (CLI)
添加到您的 ~/.claude/settings.json:
{
"mcpServers": {
"linkedin-ads": {
"command": "node",
"args": ["/path/to/linkedin-ads-mcp-server/dist/index.js"],
"env": {
"LINKEDIN_ACCESS_TOKEN": "your_token",
"LINKEDIN_AD_ACCOUNT_ID": "urn:li:sponsoredAccount:123456789"
}
}
}
}Claude Desktop
将相同的 mcpServers 代码块添加到 %APPDATA%/Claude/claude_desktop_config.json (Windows) 或 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)。
更新配置后重启 Claude。
使用方法
连接后,直接与 Claude 对话即可:
“列出我的广告系列组”
“创建一个名为 Q3 品牌知名度的新广告系列组”
“运行完整的账户审计”
“显示我本月前 5 名广告系列的分析数据”
“将所有已保存受众群体的定位从英国切换到美国”
若要在不重启的情况下定位不同的广告账户,请直接在对话中指定:
“列出账户 urn:li:sponsoredAccount:987654321 的广告系列”
完整设置指南
请参阅 SETUP.md 获取详细说明,涵盖:
创建 LinkedIn 开发者应用
生成 OAuth 令牌
关联您的广告账户
配置 Claude Code / Claude Desktop
生产环境下的令牌刷新
升级到标准 API 层级
令牌过期
访问令牌 60 天后过期。请参阅 SETUP.md 第 5 部分了解刷新流程。
许可证
MIT
Available Tools
37 toolsbulk_create_campaign_groupsA
Queue and execute bulk creation of campaign groups (up to 100). Each item can have unique names, budgets, and schedules. Executes sequentially with rate limiting. Returns a summary with IDs of all created groups.
Inputs: groups (required), dryRun.
bulk_create_campaignsB
Queue and execute bulk creation of campaigns (up to 100). Supports $ref:group_N references to link to groups created in the same session. Best practices are enforced on every campaign.
Inputs: campaigns (required), dryRun.
bulk_geo_swap_audiencesB
Clone a list of saved audiences, replacing one geo-location with another. E.g., swap UK targeting to US and auto-create new audiences with updated names.
Inputs: audienceIds (required), fromGeoUrn (required), toGeoUrn (required), newNameSuffix.
bulk_update_campaignsB
Bulk update multiple campaigns at once — e.g. pause all, change bids, swap targeting.
Inputs: updates (required), dryRun.
check_single_auditA
Run a single audit check by name. Useful for targeted investigation.
Inputs: check (required).
create_ad_creativeA
Create an ad creative and associate it with a campaign. For sponsored content ads, first create a share/post and pass its URN as contentReference. For lead gen, also provide leadgenFormUrn and callToAction.
Inputs: campaignId (required), commentary (required), type, assetUrn, +2 more.
create_campaignA
Create a new campaign. Enforces best practices: audience expansion OFF, audience network OFF, manual bidding default.
Inputs: campaignGroupId (required), name (required), objective (required), dailyBudget (required), +8 more.
create_campaign_groupB
Create a new campaign group. Validates that budget type is consistent.
Inputs: name (required), status, runSchedule, totalBudget, +1 more.
create_full_adA
End-to-end ad creation: upload image + create dark post + create ad creative. Combines upload_image, create_sponsored_post, and create_ad_creative into one call. REQUIRES w_organization_social OAuth scope for post creation.
Inputs: campaignId (required), commentary (required), imagePath, googleDriveUrl, +4 more.
create_saved_audienceC
Create a new saved audience with targeting criteria.
Inputs: name (required), targetingCriteria.
create_sponsored_postA
Create a sponsored post (dark post) for use as ad content. This post won't appear in the org's feed — it's only used as ad creative. Returns a share URN to pass to create_ad_creative. REQUIRES w_organization_social OAuth scope — if you get ACCESS_DENIED, add this scope to your LinkedIn app and re-authorize.
Inputs: commentary (required), imageAssetUrn, landingPageUrl, title, +1 more.
delete_saved_audienceC
Delete a saved audience by ID.
Inputs: id (required).
get_account_summaryB
Get a high-level summary of account performance over a date range.
Inputs: dateRange (required).
get_audience_sizeB
Estimate audience size for given targeting criteria.
Inputs: targetingCriteria.
get_campaignB
Get full details of a single campaign.
Inputs: id (required).
get_campaign_analyticsB
Pull performance metrics for one or more campaigns over a date range.
Inputs: campaignIds (required), dateRange (required), granularity, fields.
get_campaign_groupA
Get details of a single campaign group by ID.
Inputs: id (required).
get_conversion_trackingB
List all conversion rules configured on the account.
Inputs: no named parameters.
get_creativeC
Get details of a single creative by ID.
Inputs: id (required).
get_creative_analyticsC
Pull performance metrics at the creative/ad level.
Inputs: campaignId (required), dateRange (required), granularity.
get_geo_urnsC
Get common geo URNs for targeting (convenience helper).
Inputs: no named parameters.
get_lead_form_responsesC
Pull lead gen form responses for a specific form.
Inputs: formId (required), startDate.
get_queue_statusC
Check the status of a bulk execution queue.
Inputs: queueId (required).
get_saved_audienceC
Get details of a single saved audience.
Inputs: id (required).
list_ad_accountsA
List all LinkedIn Ad accounts the authenticated user has access to. Use this to find account IDs when managing multiple accounts.
Inputs: no named parameters.
list_campaign_groupsA
List all campaign groups in the ad account. Returns names, statuses, budgets.
Inputs: accountId, status.
list_campaignsC
List campaigns, optionally filtered by group or status.
Inputs: accountId, campaignGroupId, status.
list_creativesC
List ad creatives, optionally filtered by campaign.
Inputs: campaignId.
list_saved_audiencesA
List all saved/matched audiences in the ad account.
Inputs: no named parameters.
run_full_auditA
Run a comprehensive audit across 10 checks: declining CTR, low budget utilization, missing conversion tracking, maximized delivery, audience expansion, audience network, stale campaigns, creative fatigue, overlapping audiences, missing UTM parameters.
Inputs: lookbackDays.
search_targeting_entitiesB
Search for targeting entities like job titles, skills, industries, companies.
Inputs: facet (required), query (required).
switch_default_accountA
Show which account is currently the default, and explain how to target a different one.
Inputs: no named parameters.
update_campaignC
Update a campaign. Re-applies best-practice enforcement.
Inputs: id (required), updates (required).
update_campaign_groupC
Update an existing campaign group.
Inputs: id (required), updates (required).
update_saved_audienceB
Update a saved audience's targeting criteria or name.
Inputs: id (required), updates (required).
upload_imageA
Upload an image to the LinkedIn media library from a local file or Google Drive link.
Inputs: filePath, googleDriveUrl, fileName.
upload_videoB
Register a video upload to the LinkedIn media library. Returns upload URLs for multipart upload.
Inputs: fileSizeBytes (required), fileName.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 37 tools
Each tool targets a distinct function or resource: campaigns vs. campaign groups, creatives, audiences, analytics, audit, etc. Even bulk tools are clearly separated by resource type (campaign_groups, campaigns, geo_swap_audiences). No significant overlap.
All tools follow a consistent verb_noun pattern in snake_case (e.g., create_campaign, list_campaign_groups, upload_image). Exceptions like 'switch_default_account' and 'run_full_audit' are still clear and follow the same verb-first structure.
37 tools is high, but the domain of LinkedIn advertising is broad, covering campaigns, groups, audiences, creatives, analytics, audits, media, and bulk operations. However, some tools like check_single_audit and run_full_audit could be merged, and the count could be trimmed without losing functionality.
Covers most CRUD operations for core resources (campaigns, groups, audiences) with creation, read, and update, but lacks delete operations for campaigns, campaign groups, and creatives. Bulk creation is present, but bulk deletion is missing. Audit, analytics, targeting search, and media upload are well covered.
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.
Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.
A hosted LinkedIn MCP server for your own account. Paste one address into Claude, ChatGPT, Cursor or n8n to read your inbox, send messages and invitations, and search people. Free to start. Not made by LinkedIn.
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server for the LinkedIn Marketing API — query campaigns, performance, and Lead Gen Forms from Claude in plain English. 19 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.194-
- AlicenseAqualityDmaintenanceMCP server to manage Meta Ads (Facebook/Instagram) campaigns, ad sets, insights, and audiences from Claude Code using natural language.9MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that connects AI assistants to LinkedIn's Ad Library API for searching advertisers' sponsored content, job postings, and influencer partnerships.MIT
- FlicenseNot gradedqualityDmaintenanceLinkedIn MCP server for Claude to create posts, read profile, and get analytics.-