Complete LinkedIn automation toolkit. Scrape profiles, manage posts, read any LinkedIn content, and automate interactions via MCP (Model Context Protocol).
- Overview
- Features
- Quickstart
- Authentication
- Usage
- Claude Desktop Integration
- Available Tools
- Project Structure
- Testing
- Troubleshooting
- API Versioning
- Contributing
- License
- Disclaimer
- Changelog
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
- Extract full LinkedIn profiles
- Scrape company pages
- Read job listings
- Read ANY LinkedIn post
- Extract images, videos, engagement metrics
- Create, update, delete LinkedIn posts
- Add or remove reactions
- Upload images and documents
- Supports all official LinkedIn REST API features
- Works with Claude Desktop and any MCP-compatible client
- 17 total tools included
- 50+ tests
- Covers scraping, API, and MCP tools
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 .# 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-httpGet 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
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
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"{
"tool": "read_linkedin_post",
"input": "https://www.linkedin.com/posts/...activity-123456..."
}{
"tool": "create_linkedin_post",
"input": {
"text": "Excited to announce our new product launch! π",
"visibility": "PUBLIC"
}
}{
"tool": "upload_linkedin_image",
"input": { "image_url": "https://example.com/image.jpg" }
}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"
}
}
}
}read_linkedin_post
get_person_profileget_company_profileget_job_detailssearch_jobssearch_recommended_jobsclose_session
create_linkedin_postupdate_linkedin_postdelete_linkedin_post
upload_linkedin_imageget_linkedin_image
add_linkedin_reactionremove_linkedin_reactionget_linkedin_reactions
get_linkedin_profilevalidate_linkedin_credentials
More details. See TOOLS_REFERENCE.md.
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
# unit tests
uv run pytest tests/unit -v
# integration tests
uv run pytest tests/integration -v
# all tests
uv run pytest tests/ -vQuick API test:
uv run python scripts/test_api.pyFix:
LINKEDIN_API_VERSION=202510
Get fresh cookie from Chrome.
Generate a new access token.
pip install --upgrade selenium webdriver-managerCurrent default:
202510
Check latest: https://learn.microsoft.com/en-us/linkedin/marketing/versioning
Update:
LINKEDIN_API_VERSION=202511
Restart the server.
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-filesPull requests welcome.
MIT License.
See the LICENSE file.
This tool is for educational and automation purposes. Follow LinkedIn TOS, API terms, and usage limits. Use responsibly.
Built with β€οΈ for LinkedIn automation