LinkedIn Advertising MCP Server
Create a powerful Model Context Protocol (MCP) server for LinkedIn Advertising in minutes with our AI Gateway. This guide walks you through setting up seamless advertising campaign management with enterprise-grade security and instant Bearer token authentication.
About LinkedIn Advertising API
The LinkedIn Advertising API provides programmatic access to create, manage, and optimize advertising campaigns on the world's largest professional network. It enables sophisticated B2B marketing automation with precise professional targeting and comprehensive analytics.
Key Capabilities
- Campaign Management: Create and manage ad campaigns
- Creative Development: Design and optimize ad creatives
- Audience Targeting: Leverage professional demographic data
- Budget Optimization: Automated bidding and budget management
- Performance Analytics: Detailed campaign performance metrics
- Lead Generation: Capture and manage marketing qualified leads
- Account Management: Multi-account advertising operations
- Conversion Tracking: ROI and attribution analytics
API Features
- REST API v2: Modern advertising operations
- Bearer Authentication: Secure token-based access
- Real-time Bidding: Dynamic campaign optimization
- Batch Operations: Efficient bulk campaign management
- Rich Targeting: Professional, company, and behavioral targeting
- Creative Formats: Sponsored content, message ads, dynamic ads
- Analytics Integration: Comprehensive performance tracking
- Lead Gen Forms: Native LinkedIn lead capture
What You Can Do with LinkedIn Advertising MCP Server
The MCP server transforms LinkedIn Advertising API into a natural language interface, enabling AI agents to:
Campaign Creation & Management
-
Campaign Setup
- "Create B2B lead generation campaign"
- "Launch brand awareness campaign for technology sector"
- "Set up recruitment advertising campaign"
- "Create event promotion campaign"
-
Campaign Configuration
- "Set daily budget to $500 for campaign"
- "Configure CPC bidding strategy"
- "Schedule campaign to run next month"
- "Set conversion tracking goals"
-
Campaign Optimization
- "Pause underperforming ad groups"
- "Increase budget for high-converting campaigns"
- "Optimize bidding based on performance"
- "A/B test different creative variations"
Audience Targeting & Segmentation
-
Professional Targeting
- "Target software engineers in San Francisco"
- "Reach C-level executives in Fortune 500"
- "Focus on marketing managers with 5+ years experience"
- "Target specific LinkedIn groups and interests"
-
Company Targeting
- "Target employees at technology companies"
- "Focus on companies with 1000+ employees"
- "Target specific industries and company sizes"
- "Exclude competitor company employees"
-
Behavioral Targeting
- "Target recent job changers"
- "Focus on active LinkedIn users"
- "Target based on content engagement"
- "Reach decision makers and influencers"
Creative Management & Optimization
-
Ad Creative Development
- "Create compelling ad headlines"
- "Generate ad copy variations"
- "Design call-to-action strategies"
- "Develop video ad scripts"
-
Creative Testing
- "A/B test different ad images"
- "Compare headline variations"
- "Test different call-to-action buttons"
- "Optimize ad formats for performance"
-
Creative Performance
- "Analyze top-performing creatives"
- "Identify best-converting ad copy"
- "Monitor creative fatigue metrics"
- "Refresh underperforming assets"
Lead Generation & Management
-
Lead Capture Setup
- "Create LinkedIn Lead Gen forms"
- "Configure form field requirements"
- "Set up privacy policy compliance"
- "Design thank you page experience"
-
Lead Processing
- "Export leads to CRM system"
- "Score leads based on profile data"
- "Trigger follow-up email sequences"
- "Route leads to sales teams"
-
Lead Analytics
- "Track lead quality metrics"
- "Analyze conversion funnel performance"
- "Calculate cost per qualified lead"
- "Monitor lead nurturing progress"
Performance Analytics & Reporting
-
Campaign Performance
- "Generate campaign ROI report"
- "Analyze click-through rates by audience"
- "Compare performance across ad formats"
- "Track campaign spend efficiency"
-
Audience Insights
- "Analyze audience engagement patterns"
- "Identify high-value customer segments"
- "Track demographic performance trends"
- "Generate audience persona reports"
-
Competitive Analysis
- "Monitor competitor ad strategies"
- "Analyze industry benchmark metrics"
- "Track market share trends"
- "Identify competitive opportunities"
Budget & Bid Management
-
Budget Optimization
- "Distribute budget across campaigns"
- "Set up automated budget rules"
- "Monitor daily spend pacing"
- "Optimize budget allocation by performance"
-
Bidding Strategy
- "Implement automated bidding"
- "Set maximum cost-per-click limits"
- "Optimize for conversions"
- "Adjust bids based on audience value"
-
Cost Management
- "Track cost per acquisition trends"
- "Monitor budget utilization rates"
- "Identify cost-saving opportunities"
- "Generate spend forecasting reports"
Prerequisites
- Access to Cequence AI Gateway
- LinkedIn Company Page or advertising account
- LinkedIn Advertising API access
- Valid Bearer authentication token
- LinkedIn Campaign Manager access
Step 1: Enable LinkedIn Advertising API
1.1 Access LinkedIn Developer Portal
- Go to developer.linkedin.com
- Sign in with your LinkedIn account
- Create a new app or select existing
- Navigate to Products section
1.2 Request API Access
- Select Advertising API
- Complete application process
- Provide detailed use case and business justification
- Wait for approval (typically 14-30 days)
1.3 Generate Access Tokens
- Go to Auth tab in your app
- Configure OAuth 2.0 settings
- Generate Bearer Token
- Set appropriate token scopes
1.4 Configure Permissions
Required scopes:
r_ads- Read advertising campaigns and performance dataw_ads- Create and manage advertising campaignsr_ads_leadgen_automation- Access lead generation dataw_ads_leadgen_automation- Manage lead generation campaigns
Step 2-4: Standard Setup
Follow standard steps to access AI Gateway, find LinkedIn Advertising API, and create MCP server.
Step 5: Configure API Endpoints
- Base URL:
https://api.linkedin.com/v2 - Required Headers:
{
"LinkedIn-Version": "202511",
"X-Restli-Protocol-Version": "2.0.0"
} - Select advertising endpoints
- Configure rate limiting
- Click Next
Step 6: MCP Server Configuration
- Name: "LinkedIn Advertising"
- Description: "B2B advertising campaign management and optimization"
- Request Timeout: 45 seconds
- Custom Headers: Add LinkedIn-specific headers
- Rate Limiting: Configure appropriate limits
- Click Next
Step 7: Configure Authentication
- Authentication Type: Bearer Token
- Token Header:
Authorization - Token Prefix:
Bearer - Enter your LinkedIn Bearer token
- Test API connection
- Verify required scopes
Step 8-10: Complete Setup
Configure security settings, choose deployment options, and deploy your server.
Required Custom Headers Configuration
For Cursor (mcp.json)
{
"servers": {
"linkedin-advertising": {
"url": "your-mcp-server-url",
"headers": {
"LinkedIn-Version": "202511",
"X-Restli-Protocol-Version": "2.0.0"
},
"rateLimiting": {
"requestsPerMinute": 100,
"requestsPerDay": 50000
}
}
}
}
For Claude Desktop
{
"servers": {
"linkedin-advertising": {
"url": "your-mcp-server-url",
"customHeaders": {
"LinkedIn-Version": "202511",
"X-Restli-Protocol-Version": "2.0.0"
},
"requestLimits": {
"perMinute": 100,
"perDay": 50000
}
}
}
}
For Windsurf
{
"mcp": {
"servers": {
"linkedin-advertising": {
"url": "your-mcp-server-url",
"requestHeaders": {
"LinkedIn-Version": "202511",
"X-Restli-Protocol-Version": "2.0.0"
},
"throttling": {
"rpm": 100,
"dailyLimit": 50000
}
}
}
}
}
Finding Latest LinkedIn API Versions
To ensure compatibility, always use the latest LinkedIn API versions:
-
LinkedIn-Version Header:
- Visit LinkedIn API Documentation
- Check the "API Versioning" section
- Use the latest version format:
YYYYMM(e.g.,202511for November 2025) - Update the
LinkedIn-Versionvalue in your configuration
-
X-Restli-Protocol-Version Header:
- Check LinkedIn Rest.li Protocol Documentation
- Current stable version is
2.0.0 - This version changes rarely, but verify for updates
-
Verification:
- Test your API calls with the latest versions
- Monitor LinkedIn Developer announcements for version updates
- Update headers when new versions are released
Authentication Setup
- Create Cequence AI Gateway Token:
- Log in to your Cequence AI Gateway dashboard
- Navigate to Organization Settings > API Tokens
- Click Generate New Token
- Copy the generated token
Using Your LinkedIn Advertising MCP Server
Setup Instructions:
Natural Language Commands
- "Create lead generation campaign targeting software engineers"
- "Optimize campaign budgets based on performance data"
- "Export leads from all active campaigns this month"
- "Generate campaign performance report for Q4 2024"
- "Pause underperforming ad groups with CTR below 0.5%"
Common Use Cases
B2B Lead Generation
- Software and technology companies
- Professional services firms
- Financial services and consulting
- Enterprise solution providers
Brand Awareness & Thought Leadership
- Executive positioning campaigns
- Industry expertise showcasing
- Company culture promotion
- Product innovation highlighting
Recruitment & Talent Acquisition
- Technical role recruitment
- Executive search campaigns
- Employer brand building
- Talent pipeline development
Event & Webinar Promotion
- Conference and trade show promotion
- Webinar registration campaigns
- Product launch events
- Professional networking events
Security Best Practices
-
Bearer Token Security:
- Rotate tokens regularly
- Store tokens in secure vaults
- Monitor token usage patterns
- Implement token scoping
-
Campaign Data Protection:
- Encrypt sensitive campaign data
- Control access to advertising accounts
- Audit campaign modifications
- Protect lead information
-
API Rate Limiting:
- Implement exponential backoff
- Monitor API quota usage
- Cache frequently accessed data
- Optimize batch operations
Troubleshooting
Common Issues
-
Authentication Errors
- Verify Bearer token validity and scopes
- Check LinkedIn-Version header (202511)
- Ensure X-Restli-Protocol-Version is 2.0.0
- Validate API access permissions
-
Campaign Setup Errors
- Verify targeting criteria format
- Check budget and bid amount limits
- Validate creative asset requirements
- Review campaign group associations
-
Rate Limiting Issues
- Monitor daily and hourly limits
- Implement request throttling
- Use batch operations when available
- Cache API responses appropriately
-
Lead Generation Issues
- Verify Lead Gen form configuration
- Check form field requirements
- Validate privacy policy links
- Test form submission flow
Getting Help
- Documentation: AI Gateway Docs
- Support: support@cequence.ai
- LinkedIn API Docs: developer.linkedin.com/docs
- LinkedIn Marketing: business.linkedin.com