LinkedIn MCP Server
Fully featured MCP server that provides automation tools for LinkedIn, supporting browser-based scraping and API-based operations for content management, media uploads, and reactions.
README
LinkedIn MCP Server
Complete LinkedIn automation toolkit. Scrape profiles, manage posts, read any LinkedIn content, and automate interactions via MCP (Model Context Protocol).
๐ Table of Contents
- Overview
- Features
- Quickstart
- Authentication
- Usage
- Claude Desktop Integration
- Available Tools
- Project Structure
- Testing
- Troubleshooting
- API Versioning
- Contributing
- License
- Disclaimer
- Changelog
Overview
linkedin-mcp is a fully featured MCP server that provides automation tools for LinkedIn.
It supports browser-based scraping and API-based operations for content management, media uploads, and reactions.
Repository: Linkedin MCP Server
Features
๐ Scraping (Browser-Based)
- Extract full LinkedIn profiles
- Scrape company pages
- Read job listings
- Read ANY LinkedIn post
- Extract images, videos, engagement metrics
๐ API-Based Post Management
- Create, update, delete LinkedIn posts
- Add or remove reactions
- Upload images and documents
- Supports all official LinkedIn REST API features
๐งฉ MCP Integration
- Works with Claude Desktop and any MCP-compatible client
- 17 total tools included
๐งช Testing
- 50+ tests
- Covers scraping, API, and MCP tools
Quickstart
Install
git clone https://github.com/selvin-paul-raj/Linkedin-MCP-Server.git
cd Linkedin-MCP-Server
# create environment config
cp .env.example .env
# install dependencies
pip install -e .
Run
# Standard MCP server
uv run linkedin-mcp
# Debug mode (shows browser)
uv run main.py --debug --no-headless --no-lazy-init
# HTTP mode
uv run main.py --transport streamable-http
Authentication
1. Scraping (LinkedIn Cookie)
Get your li_at cookie:
- Log in to LinkedIn in Chrome
- Press F12
- Application โ Cookies โ https://www.linkedin.com
- Copy the
li_atcookie value - Add to
.env:
LINKEDIN_COOKIE=li_at=YOUR_COOKIE_VALUE
2. API (OAuth Access Token)
Add these fields to .env:
LINKEDIN_CLIENT_ID=your_id
LINKEDIN_CLIENT_SECRET=your_secret
LINKEDIN_ACCESS_TOKEN=your_access_token
LINKEDIN_API_VERSION=202510
Quick OAuth Link
https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&scope=w_member_social%20r_liteprofile%20r_emailaddress
Exchange auth code:
curl -X POST https://www.linkedin.com/oauth/v2/accessToken \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=authorization_code" \
-d "code=YOUR_CODE" \
-d "redirect_uri=YOUR_REDIRECT_URI" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET"
Usage
Read any LinkedIn post
{
"tool": "read_linkedin_post",
"input": "https://www.linkedin.com/posts/...activity-123456..."
}
Create a post
{
"tool": "create_linkedin_post",
"input": {
"text": "Excited to announce our new product launch! ๐",
"visibility": "PUBLIC"
}
}
Upload image
{
"tool": "upload_linkedin_image",
"input": { "image_url": "https://example.com/image.jpg" }
}
Claude Desktop Integration
Add this to claude_desktop_config.json:
{
"mcpServers": {
"linkedin": {
"command": "uv",
"args": [
"--directory",
"D:\\MCP\\linkedin-mcp",
"run",
"linkedin-mcp"
],
"env": {
"LINKEDIN_COOKIE": "li_at=YOUR_COOKIE",
"LINKEDIN_ACCESS_TOKEN": "YOUR_TOKEN"
}
}
}
}
Available Tools
๐ Content Reading
read_linkedin_post
๐ Scraping
get_person_profileget_company_profileget_job_detailssearch_jobssearch_recommended_jobsclose_session
๐ Post Management
create_linkedin_postupdate_linkedin_postdelete_linkedin_post
๐ผ๏ธ Media
upload_linkedin_imageget_linkedin_image
๐ Reactions
add_linkedin_reactionremove_linkedin_reactionget_linkedin_reactions
๐ค Profile & Auth
get_linkedin_profilevalidate_linkedin_credentials
More details. See TOOLS_REFERENCE.md.
Project Structure
linkedin-mcp/
โโโ linkedin_mcp_server/
โ โโโ server.py
โ โโโ cli.py
โ โโโ config/
โ โโโ drivers/
โ โโโ tools/
โโโ tests/
โ โโโ unit/
โ โโโ integration/
โโโ scripts/
โโโ .env.example
โโโ pyproject.toml
โโโ README.md
โโโ TOOLS_REFERENCE.md
Testing
# unit tests
uv run pytest tests/unit -v
# integration tests
uv run pytest tests/integration -v
# all tests
uv run pytest tests/ -v
Quick API test:
uv run python scripts/test_api.py
Troubleshooting
โ "426 Client Error: Upgrade Required"
Fix:
LINKEDIN_API_VERSION=202510
โ "LINKEDIN_COOKIE required"
Get fresh cookie from Chrome.
โ "401 Unauthorized"
Generate a new access token.
ChromeDriver issues
pip install --upgrade selenium webdriver-manager
API Versioning
Current default:
202510
Check latest: https://learn.microsoft.com/en-us/linkedin/marketing/versioning
Update:
LINKEDIN_API_VERSION=202511
Restart the server.
Contributing
git clone https://github.com/selvin-paul-raj/Linkedin-MCP-Server.git
cd Linkedin-MCP-Server
uv sync
uv run pytest tests/ -v
uv run ruff format .
uv run pre-commit run --all-files
Pull requests welcome.
License
MIT License.
See the LICENSE file.
Disclaimer
This tool is for educational and automation purposes. Follow LinkedIn TOS, API terms, and usage limits. Use responsibly.
Built with โค๏ธ for LinkedIn automation
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.