Skip to main content
Glama
LinkedIn Ads MCP

LinkedIn Ads MCP

by kopeli91
README.md
# linkedin-ads-mcp

A small, read-only LinkedIn Ads (Marketing API) MCP server for Claude Code.

LinkedIn has no official MCP server. Reporting tools usually carry delivery numbers only, without targeting setup, audience sizing or who your ads actually reached. This server wraps the Marketing API directly. It's built for audience planning and performance checks, and it can't change anything in the account.

## Quick start with Claude Code

Clone the repo, open Claude Code in the folder, and say:

> Follow SETUP_PROMPT.md and set this up for me.

Budget a few days for LinkedIn to approve the app's API access. That wait is most of the setup time.

Using the **Claude Desktop** app instead of Claude Code? Follow [CLAUDE_DESKTOP.md](CLAUDE_DESKTOP.md).

## What's in here

| file | what it does |
|---|---|
| `CLAUDE_DESKTOP.md` | how to add the server to the Claude Desktop app |
| `SETUP_PROMPT.md` | the full setup guide, written as a prompt you can give Claude |
| `auth.py` | saves your access token (hidden input, or a browser sign-in) |
| `server.py` | the MCP server (one file) |
| `requirements.txt` | Python dependencies |

The token is stored in `~/.linkedin-ads/` by default. To keep it somewhere else, set `LINKEDIN_ADS_SECRETS_DIR` to that folder. Nothing secret is stored in this repo.

## Tools (all read-only)

| tool | what it answers |
|---|---|
| `ad_accounts` | ad accounts you can read |
| `campaign_groups` | Campaign Manager's "Campaigns": status, objective, budget |
| `campaigns` | Campaign Manager's "ad sets": budget, bid, objective and full targeting, with targeting values shown as readable names |
| `targeting_facets` | the targeting catalogue: every facet and how it can be searched |
| `targeting_entities` | the values under a facet (list all, or search by name) with their IDs |
| `similar_entities` | LinkedIn's "similar to these" suggestions |
| `audience_size` | the estimated member count for a targeting combination you propose |
| `campaign_audience_size` | the same estimate for an existing campaign's current targeting |
| `demographics` | performance by company, company size, industry, seniority, job title, job function, country and region |
| `performance` | spend, impressions, clicks and conversions by account, campaign group, campaign or creative |
| `ad_library` | LinkedIn's public Ad Library: ads any company runs, searchable by keyword or advertiser |
| `matched_audiences` | uploaded lists and retargeting segments (needs separate LinkedIn approval) |