A lightweight MCP server for LinkedIn automation. Supports profile, job, company and post scraping. Enables post creation, reactions and media upload for agent workflows
claude mcp add --transport stdio selvin-paul-raj-linkedin-mcp-server uv run linkedin-mcp \ --env LINKEDIN_COOKIE="li_at=YOUR_COOKIE_VALUE" \ --env LINKEDIN_CLIENT_ID="YOUR_CLIENT_ID" \ --env LINKEDIN_API_VERSION="202510" \ --env LINKEDIN_ACCESS_TOKEN="YOUR_ACCESS_TOKEN" \ --env LINKEDIN_CLIENT_SECRET="YOUR_CLIENT_SECRET"
How to use
This MCP server provides a full LinkedIn automation toolkit. It enables both browser-based scraping (to extract complete LinkedIn profiles, company pages, job listings, and posts) and API-based content management (creating, updating, deleting posts, uploading media, and managing reactions), all accessible through the MCP interface. The server exposes a variety of tools for reading, scraping, posting, media handling, and reactions, and is designed to work with Claude Desktop or any MCP-compatible client. To get started, run the server via the MCP runner (uv) and then invoke the available tools through the standard MCP tooling or your client of choice. The project ships with a complete set of tools such as read_linkedin_post, get_person_profile, get_company_profile, create_linkedin_post, upload_linkedin_image, add_linkedin_reaction, and more, all documented in TOOLS_REFERENCE.md.
How to install
Prerequisites:
- Python 3.12+ installed on your system
- Git installed
- Internet access to install dependencies
Installation steps:
-
Clone the repository git clone https://github.com/selvin-paul-raj/Linkedin-MCP-Server.git cd Linkedin-MCP-Server
-
Create an environment configuration file (example provided by repository) cp .env.example .env
Edit .env to include required credentials (see README for details)
-
Install the package in editable mode pip install -e .
-
Prepare to run
- Ensure required environment variables are set in .env or via the MCP config env (LINKEDIN_COOKIE, LINKEDIN_CLIENT_ID, etc.)
- You can also follow the Claude Desktop integration snippet to configure your client
-
Run the MCP server uv run linkedin-mcp
Optional debugging or HTTP mode: uv run main.py --debug --no-headless --no-lazy-init uv run main.py --transport streamable-http
Additional notes
Tips and common issues:
- If you encounter a 426 Client Error: Upgrade Required, ensure LINKEDIN_API_VERSION is set to a supported version (e.g., 202510).
- The LinkedIn cookie (li_at) must be fresh; update it if you see COOKIE required errors.
- API token errors (401) usually mean the access token expired; refresh tokens as needed.
- For ChromeDriver related problems, updating selenium and webdriver-manager can help (pip install --upgrade selenium webdriver-manager).
- The server uses environment-based configuration; prefer .env for sensitive credentials and keep it out of version control.
- API versioning: check the latest LinkedIn API version and adjust LINKS if necessary, then restart the server to apply changes.
- When using Claude Desktop, ensure claude_desktop_config.json points to the correct directory and command (uv run linkedin-mcp) and that environment variables are provided.
- Tests are available and can be run with uv run pytest tests/ -v; run unit tests separately from integration tests to isolate issues.
Related MCP Servers
sre
The SmythOS Runtime Environment (SRE) is an open-source, cloud-native runtime for agentic AI. Secure, modular, and production-ready, it lets developers build, run, and manage intelligent agents across local, cloud, and edge environments.
agents
Create AI Agents in a No-Code Visual Builder or TypeScript SDK with full 2-way sync. For shipping AI assistants and multi-agent AI workflows.
DeepMCPAgent
Model-agnostic plug-n-play LangChain/LangGraph agents powered entirely by MCP tools over HTTP/SSE.
template-repo
Agent orchestration & security template featuring MCP tool building, agent2agent workflows, mechanistic interpretability on sleeper agents, and agent integration via CLI wrappers
linkedapi
MCP server that lets AI assistants control LinkedIn accounts and retrieve real-time data.
linkedin_mcp
A powerful Model Context Protocol server for LinkedIn interactions that enables AI assistants to search for jobs, generate resumes and cover letters, and manage job applications programmatically.