Get the FREE Ultimate OpenClaw Setup Guide →

mcp-linkedin

LinkedIn MCP Server for local automation

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio alinaqi-mcp-linkedin-server python linkedin_browser_mcp.py \
  --env LINKEDIN_PASSWORD="Your LinkedIn password" \
  --env LINKEDIN_USERNAME="Your LinkedIn email address" \
  --env COOKIE_ENCRYPTION_KEY="Encryption key for cookie storage (optional: auto-generated if omitted)"

How to use

This MCP server provides browser-driven LinkedIn automation and data extraction through the FastMCP framework. It offers tools to securely authenticate, browse feeds, search and retrieve profile information, and perform basic post interactions such as liking or commenting. The available tools include login_linkedin_secure for credential-based login, browse_linkedin_feed to fetch and analyze feed content, search_linkedin_profiles to locate profiles based on keywords, view_linkedin_profile to extract data from a specific profile, and interact_with_linkedin_post to like or comment on posts. Clients can connect to the server via the FastMCP client and invoke these tools programmatically to automate LinkedIn workflows while respecting rate limits and session persistence.

How to install

Prerequisites:

  • Python 3.8+
  • Playwright (and browser binaries)
  • FastMCP library
  • LinkedIn account

Installation steps:

  1. Clone the repository:
# Replace with the actual repository URL
git clone [repository-url]
cd mcp-linkedin-server
  1. Create and activate a virtual environment:
python -m venv env
# macOS/Linux
source env/bin/activate
# Windows
env\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
playwright install chromium
  1. Set up environment variables: Create a .env file in the root directory with:
LINKEDIN_USERNAME=your_email@example.com
LINKEDIN_PASSWORD=your_password
COOKIE_ENCRYPTION_KEY=your_encryption_key  # Optional: will be auto-generated if not provided
  1. Run the server:
python linkedin_browser_mcp.py

Additional notes

Tips and considerations:

  • Ensure your LinkedIn account credentials are stored securely; the server supports encrypted cookie storage for session persistence.
  • The implementation includes rate limiting to reduce login attempts and protect against LinkedIn security challenges.
  • If COOKIE_ENCRYPTION_KEY is omitted, an auto-generated key will be created, but for persistent sessions across restarts you should provide a stable key.
  • Monitor your usage to stay within LinkedIn’s terms of service and rate limits; adjust query counts as needed.
  • If you encounter authentication or network issues, check the environment variables and ensure chromium is properly installed by Playwright.

Related MCP Servers

Sponsor this space

Reach thousands of developers