@bossforce.ai/mcp-linkedin-ads
v0.1.0
Published
MCP server for the **LinkedIn Marketing API** (Advertising API). Read-only reporting over a Campaign Manager account: list ad accounts and campaigns, and pull performance analytics (impressions, clicks, spend). Calls the versioned `/rest` APIs with `Linke
Readme
@bossforce.ai/mcp-linkedin-ads
MCP server for the LinkedIn Marketing API (Advertising API). Read-only
reporting over a Campaign Manager account: list ad accounts and campaigns, and
pull performance analytics (impressions, clicks, spend). Calls the versioned
/rest APIs with LinkedIn-Version and X-Restli-Protocol-Version: 2.0.0.
Credentials
OAuth2 (refresh-token grant). The platform performs the LinkedIn authorization
and supplies the refresh token; the server exchanges it for short-lived access
tokens itself and refreshes once on a 401.
| Env | Role |
| ---------------------------- | ------------------- |
| LINKEDIN_ADS_CLIENT_ID | OAuth client id |
| LINKEDIN_ADS_CLIENT_SECRET | OAuth client secret |
| LINKEDIN_ADS_REFRESH_TOKEN | OAuth refresh token |
Scopes: r_ads (read ad accounts) and r_ads_reporting (reporting). These are
3-legged (member-consent) scopes; the 2-legged client-credentials flow is not
available for marketing use cases. The credentials are read lazily, so the
server boots and answers tools/list without them; calls fail with an auth
error until they are set.
Gating (production access)
Using this server in production requires access to the LinkedIn Marketing Developer Platform:
- Create a developer app at linkedin.com/developers.
- Request the Advertising API product on the app.
- Pass LinkedIn's app review/approval to leave the Development Tier.
Until approved, the app is restricted to the Development Tier (up to 5 ad
accounts configured on the app). The authenticated member must also hold an ad
account role (e.g. VIEWER or above) on each account.
Tools
| Tool | Arguments | Returns |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------- |
| list_ad_accounts | status?, type?, test?, page_size?, page_token? | { elements, metadata } of ad accounts |
| list_campaigns | account_id, status?, test?, page_size?, page_token? | { elements, metadata } of campaigns |
| get_analytics | pivot, time_granularity, date_range_start, date_range_end?, one of accounts/campaigns/creatives, fields? | { elements, paging } of analytics rows |
get_analytics requires exactly one of accounts, campaigns or creatives
(numeric ids — the tool builds the urn:li:sponsored* URNs). Pass fields to
request specific metrics; otherwise only impressions and clicks are returned.
Develop
pnpm --filter @bossforce.ai/mcp-linkedin-ads build
pnpm --filter @bossforce.ai/mcp-linkedin-ads testRegenerate the tools/list snapshot after an intentional signature change:
UPDATE_SNAPSHOTS=1 pnpm --filter @bossforce.ai/mcp-linkedin-ads test