LinkedIn Intelligence MCP Server
Connects Claude Desktop to LinkedIn's data layer for AI-powered networking, enabling profile research, content creation and scheduling, engagement automation, analytics tracking, and messaging through natural language.
README
LinkedIn MCP Server
AI-powered LinkedIn content creation, analytics, and engagement. Create posts, analyze performance, manage drafts, and grow your professional presence—all through natural conversation with Claude.
A Model Context Protocol (MCP) server that connects Claude to LinkedIn for content creation, scheduling, and analytics.
✅ What's Working (Tested & Verified)
Content Creation (Official API)
| Capability | Example Prompt | Status |
|---|---|---|
| Create Posts | "Create a LinkedIn post about AI trends" | ✅ Working |
| Image Posts | "Post this image with a caption about our launch" | ✅ Working |
| Create Polls | "Create a poll asking about favorite programming languages" | ✅ Working |
| Delete Posts | "Delete my last post" | ✅ Working |
| Get My Profile | "Show me my LinkedIn profile" | ✅ Working |
Content Planning (Local Features)
| Capability | Example Prompt | Status |
|---|---|---|
| Draft Content | "Save this as a draft for later" | ✅ Working |
| List Drafts | "Show my saved drafts" | ✅ Working |
| Publish Drafts | "Publish my 'Product Launch' draft" | ✅ Working |
| Schedule Posts | "Schedule this post for Tuesday at 9am" | ✅ Working |
| Manage Schedule | "Show my scheduled posts" | ✅ Working |
| Content Analysis | "Analyze this draft and suggest improvements" | ✅ Working |
Profile Viewing (Browser Automation)
| Capability | Example Prompt | Status |
|---|---|---|
| View Profiles | "Look up Bill Gates on LinkedIn" | ⚠️ Limited (browser fallback) |
⚠️ Known Limitations
LinkedIn actively blocks unofficial API access. The following features are currently unreliable due to LinkedIn's bot detection:
- ❌ Search (people/companies)
- ❌ Connection management
- ❌ Feed browsing
- ❌ Messaging
- ❌ Network statistics
- ❌ Company research
These use the tomquirk/linkedin-api library which LinkedIn frequently blocks. We're exploring alternatives.
Quick Start
Prerequisites
- Python 3.11+
- uv (recommended) or pip
- LinkedIn account
- LinkedIn Developer App (free, 5 min setup)
Step 1: Clone and Install
git clone https://github.com/southleft/linkedin-mcp.git
cd linkedin-mcp
# Install with uv (recommended)
uv venv && source .venv/bin/activate
uv pip install -e .
# Install browser automation (optional, for profile viewing)
playwright install chromium
Step 2: Create LinkedIn Developer App
- Go to LinkedIn Developer Portal
- Click "Create app"
- Fill in the details:
- App name: e.g., "My LinkedIn MCP"
- LinkedIn Page: Select or create a company page
- Privacy policy URL: Your website or LinkedIn profile
- App logo: Any 100x100 image
- Go to "Products" tab → Request "Share on LinkedIn" (instant approval)
- Go to "Auth" tab:
- Copy Client ID and Client Secret
- Add redirect URL:
http://localhost:8765/callback
Step 3: Configure Environment
Create a .env file:
# LinkedIn OAuth Credentials (Required)
LINKEDIN_CLIENT_ID=your_client_id_here
LINKEDIN_CLIENT_SECRET=your_client_secret_here
# Enable API features
LINKEDIN_API_ENABLED=true
Step 4: Authenticate
# OAuth authentication (opens browser, required for posting)
linkedin-mcp-auth oauth
# Extract browser cookies (optional, for additional features)
linkedin-mcp-auth extract-cookies --browser chrome
# Verify status
linkedin-mcp-auth status
Step 5: Connect to Claude
Claude Code (Recommended)
Add to ~/.claude.json:
{
"mcpServers": {
"linkedin-mcp": {
"type": "stdio",
"command": "/path/to/python3",
"args": ["-m", "linkedin_mcp"],
"cwd": "/path/to/linkedin-mcp",
"env": {
"LINKEDIN_API_ENABLED": "true",
"PYTHONPATH": "/path/to/linkedin-mcp/src"
}
}
}
}
Then run /mcp in Claude Code to connect.
Claude Desktop
Add to your config file:
| Platform | Config Location |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
{
"mcpServers": {
"linkedin": {
"command": "/path/to/linkedin-mcp/.venv/bin/python",
"args": ["-m", "linkedin_mcp"],
"cwd": "/path/to/linkedin-mcp",
"env": {
"LINKEDIN_CLIENT_ID": "your_client_id",
"LINKEDIN_CLIENT_SECRET": "your_client_secret",
"LINKEDIN_API_ENABLED": "true"
}
}
}
}
Restart Claude Desktop after updating.
Available Tools
✅ Reliable Tools (Official API + Local)
Profile
| Tool | Description |
|---|---|
get_my_profile() |
Get your LinkedIn profile |
get_auth_status() |
Check authentication status |
Content Creation
| Tool | Description |
|---|---|
create_post(text, visibility) |
Create a text post |
create_image_post(text, image_path) |
Create a post with image |
create_poll(question, options) |
Create a poll |
delete_post(post_urn) |
Delete a post |
Drafts & Scheduling
| Tool | Description |
|---|---|
create_draft(content, title, tags) |
Save content for later |
list_drafts() |
List all drafts |
get_draft(draft_id) |
Get a specific draft |
update_draft(draft_id, ...) |
Update a draft |
delete_draft(draft_id) |
Delete a draft |
publish_draft(draft_id) |
Publish a draft |
schedule_post(content, time) |
Schedule for future |
list_scheduled_posts() |
View scheduled posts |
cancel_scheduled_post(job_id) |
Cancel scheduled post |
update_scheduled_post(job_id, ...) |
Update scheduled post |
Content Analysis
| Tool | Description |
|---|---|
analyze_draft_content(content) |
Get improvement suggestions |
⚠️ Limited Tools (May Be Blocked)
These tools use the unofficial API and may fail due to LinkedIn's bot detection:
| Tool | Description | Fallback |
|---|---|---|
get_profile(id) |
Get any profile | Browser automation |
search_people(keywords) |
Search for people | None |
search_companies(keywords) |
Search for companies | None |
get_connections(limit) |
List connections | None |
get_feed(limit) |
Browse feed | None |
get_network_stats() |
Network analysis | None |
send_message(id, text) |
Send DM | None |
get_company(id) |
Company details | None |
Example Conversations
Content Creator Workflow (✅ Reliable)
You: "I want to post about continuous learning in tech"
Claude: I'll help you create that post. Here's a draft:
"🚀 In tech, the day you stop learning is the day you start falling behind.
Whether it's a new framework or a completely new domain—curiosity is our greatest competitive advantage.
What are you learning this week? 👇
#ContinuousLearning #TechCareers #GrowthMindset"
Should I post this publicly or save it as a draft?
Content Planning (✅ Reliable)
You: "Save this as a draft for my product launch next week"
Claude: Done! I've saved your draft titled "Product Launch" with tags: product, launch, announcement.
Would you like me to:
- Schedule it for a specific time?
- Analyze it for engagement potential?
- Show you all your drafts?
Post Scheduling (✅ Reliable)
You: "Schedule my launch post for Tuesday at 9am Central"
Claude: ✅ Scheduled! Your post will go live:
- Date: Tuesday, January 7, 2025
- Time: 9:00 AM Central
- Visibility: Public
You can view or cancel scheduled posts anytime.
CLI Commands
# Authentication
linkedin-mcp-auth status # Check auth status
linkedin-mcp-auth oauth # OAuth flow (opens browser)
linkedin-mcp-auth oauth --force # Force re-authentication
linkedin-mcp-auth extract-cookies # Extract session cookies
linkedin-mcp-auth logout --all # Clear all credentials
# Run Server
linkedin-mcp # Start MCP server
Environment Variables
| Variable | Default | Description |
|---|---|---|
LINKEDIN_CLIENT_ID |
- | OAuth Client ID (required) |
LINKEDIN_CLIENT_SECRET |
- | OAuth Client Secret (required) |
LINKEDIN_API_ENABLED |
false |
Enable API features |
MCP_TRANSPORT |
stdio |
Transport: stdio, streamable-http |
MCP_HOST |
127.0.0.1 |
HTTP server host |
MCP_PORT |
8000 |
HTTP server port |
LOG_LEVEL |
INFO |
Logging level |
Troubleshooting
"LinkedIn client not initialized"
linkedin-mcp-auth status # Check what's configured
linkedin-mcp-auth oauth # Re-authenticate
"Exceeded 30 redirects" or "RetryError"
LinkedIn is blocking API access. This is common with the unofficial API. Solutions:
- Refresh cookies:
linkedin-mcp-auth extract-cookies --browser chrome - Wait and retry later
- Use official API tools (posting, drafts, scheduling)
"Application context not initialized"
Reconnect the MCP server: Run /mcp in Claude Code.
Posts not appearing
- Ensure OAuth is authenticated:
linkedin-mcp-auth status - Check your Developer App has "Share on LinkedIn" product enabled
Security
- OAuth tokens: Stored securely in system keychain
- Session cookies: Stored in system keychain (never transmitted)
- Credentials: Loaded from environment variables
- No data collection: Everything runs locally
Development
# Install dev dependencies
uv pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Linting
ruff check src/ && ruff format src/
# Type checking
mypy src/linkedin_mcp
License
MIT License - see LICENSE for details.
Acknowledgments
- tomquirk/linkedin-api - LinkedIn API library
- FastMCP - MCP SDK for Python
- Model Context Protocol - AI tool protocol
Built with ❤️ for AI-powered content creators
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。