August 7, 2026 · 8 min read
LinkedIn Ads API MCP server: how to connect AI agents to your ad account
Connect your LinkedIn Ads account to an MCP server and let AI agents pull campaign data, segment CPL by audience, and surface budget waste in B2B campaigns.

That precision is why LinkedIn drives an estimated 75-85% of all B2B leads that come from social media, according to a 2026 MCP Playground analysis of the platform's advertising tools.
The tradeoff is that precision is expensive to manage. LinkedIn ads cost $8-$15 per click for most B2B audiences, and the demographic data that justifies that price sits behind a slow reporting interface. A LinkedIn Ads API MCP server fixes that by giving AI agents direct, authenticated access to your campaign data, so you can ask questions in plain language instead of clicking through Campaign Manager.
Why connect LinkedIn Ads to an MCP server
A Model Context Protocol (MCP) server is an open standard that lets AI models connect to external tools and data sources with live access. When you connect your LinkedIn Ads account through an MCP server, Claude, Cursor, or any MCP-compatible agent can pull campaign performance, audience demographics, conversion data, and lead gen metrics straight from the LinkedIn Marketing API.
The win is speed. An ICP segment audit that takes 45-90 minutes manually, pulling demographic breakdowns across job function, seniority, and company size, becomes a 60-second conversation with an agent. Teams that run these workflows report 25-40% lower cost per lead and 10+ hours saved every week on reporting and audience analysis.
You get the same result if you prefer a standalone pipeline. The Marketing API returns JSON, so you can skip the MCP layer and query it directly from a script. The MCP route matters when you want to pair the data with reasoning: ask why CPL spiked, get a comparison, and receive a suggested fix in one pass.
What a LinkedIn Ads API MCP server does
The server sits between your AI client and the LinkedIn Marketing API. It handles authentication, token refresh, rate limiting, and shapes raw API responses into tools the agent can call. The open source danielpopamd/linkedin-ads-mcp server exposes roughly 25 tools covering accounts, campaigns, creatives, audiences, conversions, and analytics.
Typical tools include listing ad accounts, pulling campaign performance, reading audience demographics by job function and seniority, checking conversion performance, reviewing lead gen forms, comparing time periods, and reading daily trends. Most implementations include write operations for campaign management alongside read-only analytics.
Once configured, you talk to your ad account like a colleague. Ask "show me campaign performance for the last 30 days" and the agent returns spend, impressions, clicks, CTR, CPL, and conversions. Ask "which job functions are responding best" and it pulls the demographic breakdown.
What you need before you connect
A LinkedIn developer app is the first requirement. You create it at developer.linkedin.com, attach it to a company page you administer, and request the Advertising API product under the Products tab. Approval for the Marketing Developer Platform typically takes 1-5 business days for legitimate advertising use cases.
Your app gets a client ID and client secret. These are the credentials the MCP server uses during the OAuth flow. You also configure a redirect URL, usually http://localhost:3000/callback for local installations, so the browser-based authorization can complete.
The OAuth scopes you need are r_ads to read ad accounts, r_ads_reporting to read reporting data, rw_ads to create and manage campaigns, and r_organization_social to read organization posts for creative content. The danielpopamd repo documents these scopes and the exact approval flow.
How to set up a LinkedIn Ads MCP server
The self-hosted path starts with Node.js 18 or newer. Clone the server repository, run npm install and npm run build, copy the example environment file, and add your LinkedIn client ID and secret. Then run the auth command, which opens a browser window for LinkedIn OAuth and stores the token locally.
Add the server to your client configuration so the agent knows it exists. In Claude Desktop on macOS, that means adding an entry to the mcpServers block in ~/Library/Application Support/Claude/claude_desktop_config.json with the command, script path, and environment variables. Restart the client and test with "list my ad accounts".
If you would rather not manage infrastructure, several managed options exist. Zapier offers a hosted LinkedIn Ads MCP, Improvado ships one aimed at marketing analytics teams, and AdKit runs a managed server that avoids API keys entirely. Managed servers trade a subscription fee for zero installation and automatic maintenance.
Queries that matter for B2B performance
Campaign and creative performance is the baseline. Standard metrics include spend, impressions, clicks, CTR, reach, frequency, engagements, engagement rate, CPM, CPC, conversions, conversion rate, cost per conversion, audience penetration, and average dwell time. You can ask for any subset across a date range.
Audience demographics is where LinkedIn separates itself. The API returns performance broken down by job function, seniority, company size, industry, country, and region. That lets an agent tell you whether your VP-level audience is converting at 2x the account average while individual contributors burn spend with zero conversions.
Conversion and lead gen data close the loop. You can pull conversion performance by action, review conversion tracking rules, read lead gen form submissions with cost per lead, and inspect form configurations. This is the data that tells you whether a cheap-looking form is actually filling with buyers or with job seekers.
B2B workflows that save hours every week
An ICP segment performance audit is the highest-value workflow. Ask the agent to break down 90 days of performance by job function and seniority, flag segments where CPL is more than 2x the account average, and list any segment spending over $500 with zero conversions. The result is a full account audit in a minute.
Creative fatigue detection catches decay before it costs you. LinkedIn B2B audiences are small, so frequency climbs fast. Ask for daily CTR trends across active creatives and flag anything down more than 20% from its 7-day peak or running above frequency 4.0. Catching fatigue before frequency hits 5 can be the difference between a 0.6% and a 0.2% CTR.
Budget waste identification is the fastest payback. Analyses cited by MCP Playground found that B2B teams waste roughly 27% of their LinkedIn budget on audiences that never convert, typically wrong job functions, wrong company sizes, and wrong geographies. A single zero-conversion query surfaces those segments ranked by spend.
Lead gen form quality analysis prevents vanity metrics. A form with a $45 CPL looks great until you learn 60% of fills are job seekers. Cross-reference form performance with the demographic breakdown of who is filling each form, and you can separate qualified CPL from headline CPL.
LinkedIn Ads API limits and gotchas
The Marketing API has firm ceilings. LinkedIn allows roughly 45 million metric values per 5-minute window, a maximum of 15,000 elements per response, and up to 20 metrics per request. A good MCP server handles rate limits with exponential backoff, but batch your queries to stay under these caps.
Demographic data arrives with a delay of 12-24 hours, so yesterday's breakdowns are not instantly available. Reach data is capped at a 92-day date range. Plan reporting windows around these constraints or your agent will return gaps for recent days.
LinkedIn suppresses demographic breakdowns for segments with fewer than roughly 300 members to protect member privacy. Very granular segments, such as a specific title inside a small company in a small country, will return no demographic data at all. This is platform behavior, not a server bug.
What AI agents cannot do with LinkedIn Ads data
Most public LinkedIn Ads MCP servers are read-only for analytics. They surface bid recommendations, exclusion lists, and budget reallocation plans, but you implement those changes in Campaign Manager manually. Write-capable servers exist but are less mature, so treat write access as an extra to verify, not a default.
Agents cannot see which named companies clicked your ads outside of matched audience lists. LinkedIn exposes company-level engagement in aggregate, but individual named-company clicks are protected for privacy. An agent also cannot lower platform-level CPCs; optimization improves spend efficiency, not the $8-$15 baseline cost.
Managed alternatives and where ad intelligence fits
If you want the data without the developer setup, Zapier, Improvado, AdKit, and Radiate B2B all sell managed LinkedIn Ads MCP connections. They handle OAuth, hosting, and maintenance behind a subscription. For teams already on those stacks, that is often the fastest path to a working agent.
Own-account analytics is only half the picture. The same agent that reads your campaign performance can also watch what your competitors are doing. The adextract MCP server connects AI workspaces to competitor ad intelligence across Meta, Google, TikTok, and LinkedIn, so you can benchmark your creative and spend against the market in the same conversation.
If you are building a full ad intelligence stack, you have solid building blocks: the Google Ads API MCP server guide covers search, the Meta Ads Library API post covers social volume, and the TikTok Ads API guide covers short-form creative. LinkedIn slots in as the precision layer for B2B.
Start with a single question you answer manually every week, wire up the MCP connection, and let the agent produce the first report. Once you see your own campaign data in a conversation, the next step is competitive analysis of your market so you know where your spend stands against the field.
Before you commit, check which tools a candidate server actually exposes. Some servers only read campaign names and spend; others surface demographic breakdowns, conversion events, and lead gen forms. For B2B work, demographic and lead gen coverage matter more than raw campaign lists, because that is where the optimization value lives.
Security is a real consideration. The server holds OAuth tokens that can read your ad account, so prefer open source servers you can audit, keep tokens out of version control, and use a dedicated developer app scoped to the accounts you need. Managed providers should publish their data handling and storage policies before you connect a production account.
Frequently asked questions
What is a LinkedIn Ads API MCP server?
A LinkedIn Ads API MCP server connects your LinkedIn advertising data to AI agents through the Model Context Protocol. It bridges a client like Claude to the LinkedIn Marketing API, so you can query campaign performance, audience demographics, conversions, and lead gen data in natural language.
Do I need LinkedIn API approval to use an MCP server?
Yes for self-hosted servers. You need a LinkedIn developer app with Advertising API (Marketing Developer Platform) access, which requires a company page and takes 1-5 business days to approve. Managed providers like Zapier or AdKit handle that access for you.
Can AI agents create or edit LinkedIn ad campaigns?
Some servers expose write operations to create campaigns, update budgets, and manage creatives. Most public community servers are read-only for analytics and leave campaign changes to Campaign Manager. Verify write support before you rely on it.
What metrics can I pull from the LinkedIn Marketing API?
Standard metrics include spend, impressions, clicks, CTR, reach, frequency, engagements, engagement rate, CPM, CPC, conversions, conversion rate, cost per conversion, audience penetration, and average dwell time, broken down by job function, seniority, company size, industry, and region.