mcp-linkedin
LinkedIn MCP Server for local automation
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:
- Clone the repository:
# Replace with the actual repository URL
git clone [repository-url]
cd mcp-linkedin-server
- Create and activate a virtual environment:
python -m venv env
# macOS/Linux
source env/bin/activate
# Windows
env\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
playwright install chromium
- Set up environment variables:
Create a
.envfile 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
- 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
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP