linkedin-ads

v1.2.2
io.github.mharnett/linkedin-ads Checked 4 days ago Published 11 days ago

MCP server for LinkedIn Campaign Manager — campaigns, creatives, and analytics

Values you need

VariableWhat it is
LINKEDIN_ADS_ACCESS_TOKENrequired secret LinkedIn OAuth access token. Enough on its own to start.
LINKEDIN_ADS_REFRESH_TOKENoptional secret LinkedIn OAuth refresh token. With LINKEDIN_ADS_CLIENT_ID and LINKEDIN_ADS_CLIENT_SECRET, the server renews the access token itself.
LINKEDIN_ADS_CLIENT_IDoptional LinkedIn app client ID. Needed only with a refresh token.
LINKEDIN_ADS_CLIENT_SECREToptional secret LinkedIn app client secret. Needed only with a refresh token.
LINKEDIN_ADS_ACCOUNT_IDoptional Default LinkedIn ad account ID, used when a tool call names none.
LINKEDIN_ADS_MCP_WRITEoptional Set to true to expose the predictive-audience write tools. Read-only by default. Default: false

npm (npx) discovery passed

Requires Node.js 18+

Run in a terminal
claude mcp add linkedin-ads -e 'LINKEDIN_ADS_ACCESS_TOKEN=<LINKEDIN_ADS_ACCESS_TOKEN>' -- npx -y mcp-linkedin-ads@1.2.2
Add to claude_desktop_config.json
{
  "mcpServers": {
    "linkedin-ads": {
      "args": [
        "-y",
        "mcp-linkedin-ads@1.2.2"
      ],
      "command": "npx",
      "env": {
        "LINKEDIN_ADS_ACCESS_TOKEN": "<LINKEDIN_ADS_ACCESS_TOKEN>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "linkedin-ads": {
      "args": [
        "-y",
        "mcp-linkedin-ads@1.2.2"
      ],
      "command": "npx",
      "env": {
        "LINKEDIN_ADS_ACCESS_TOKEN": "<LINKEDIN_ADS_ACCESS_TOKEN>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "LINKEDIN_ADS_ACCESS_TOKEN",
      "id": "linkedin-ads-access-token",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "linkedin-ads": {
      "args": [
        "-y",
        "mcp-linkedin-ads@1.2.2"
      ],
      "command": "npx",
      "env": {
        "LINKEDIN_ADS_ACCESS_TOKEN": "${input:linkedin-ads-access-token}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.linkedin-ads]
command = "npx"
args = ["-y", "mcp-linkedin-ads@1.2.2"]
env = { "LINKEDIN_ADS_ACCESS_TOKEN" = "<LINKEDIN_ADS_ACCESS_TOKEN>" }

For AI agents

  1. Ask the user for: LINKEDIN_ADS_ACCESS_TOKEN. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: linkedin_ads_get_client_context, linkedin_ads_list_accounts, linkedin_ads_list_campaign_groups, linkedin_ads_list_campaigns, linkedin_ads_campaign_performance, linkedin_ads_account_performance, linkedin_ads_analytics, linkedin_ads_list_predictive_audiences, ….
  5. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json