
Linkedin Ads
io.github.mharnett由 GitHub 帳號 mharnett 發布v1.0.2更新於 Oct 24, 2026
MCP server for LinkedIn Campaign Manager — campaigns, creatives, and analytics
概覽
一個本機 MCP 伺服器,讓助理讀取 LinkedIn Campaign Manager 的廣告帳戶、廣告活動、創意和成效分析資料。
- 可以做什麼
- 列出廣告帳戶,並透過用戶端情境工具在多個 LinkedIn 廣告帳戶之間切換,藉由工作目錄定位設定與憑證。列出某個帳戶下的廣告活動和廣告活動群組。依日期範圍取得帳戶和廣告活動成效,可選擇時間粒度。執行彈性的樞紐分析,依受眾屬性、裝置或創意細分。預設為唯讀;未來的寫入類工具在未明確開啟寫入模式時會保持隱藏並拒絕呼叫。
- 適用情境
- 適合管理 LinkedIn 廣告、希望助理在對話中直接取得廣告活動清單、成效數據和受眾屬性或裝置細分以進行報告與分析的情況。也適合代理商或內部團隊管理多個廣告帳戶。
- 執行需求
- 以 npm 套件(mcp-linkedin-ads)形式在本機 Node.js 上執行,用 npm start 啟動並透過本機 HTTP 端點連線。需要一個開通 Marketing Developer Platform 權限的 LinkedIn 開發人員應用程式及 OAuth 憑證:LINKEDIN_ADS_CLIENT_ID、LINKEDIN_ADS_CLIENT_SECRET 和 LINKEDIN_ADS_ACCESS_TOKEN,以及至少包含一個廣告帳戶 ID 的 config.json。選用 LINKEDIN_ADS_REFRESH_TOKEN 和 LINKEDIN_ADS_MCP_WRITE。需要連線至 LinkedIn API 的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Linkedin Ads,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
LinkedIn Ads MCP Server
[npm version] [npm downloads] [GitHub stars] [License: MIT]
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
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: -
Fill in your credentials:
-
Set environment variables (recommended for production):
Environment variables
Read-only by default
The LinkedIn Ads MCP currently ships with read-only tools only. The write-mode
gate is already in place so that any future create/update/pause/enable/remove
tool is 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 and matches the pattern being rolled out to
Bing / Reddit / Meta. Motivation: prevent a casual LLM request from mutating
production ad accounts without the operator explicitly opting in.
Usage
Start the server
Use with Claude Code
Add to ~/.claude.json:
Claude Desktop: Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).
Example API Calls
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
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
Troubleshooting
Config file not found
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 — 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
來源:README.md,提交 05dcb5b
工具
0版本歷史
1- v1.0.2最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分