home / mcp / linkedin mcp server
LinkedIn MCP Server for local automation
Configuration
View docs{
"mcpServers": {
"alinaqi-mcp-linkedin-server": {
"command": "python",
"args": [
"linkedin_browser_mcp.py"
],
"env": {
"LINKEDIN_PASSWORD": "your_password",
"LINKEDIN_USERNAME": "[email protected]",
"COOKIE_ENCRYPTION_KEY": "your_encryption_key"
}
}
}
}This MCP server enables browser-driven LinkedIn automation and data extraction using a FastMCP-based interface. It provides secure login, session persistence, rate-limiting protection, and a set of profile and post interaction tools to help you programmatically access LinkedIn data while respecting usage limits.
You will run the MCP server locally and connect your MCP client to it to perform LinkedIn actions. You can log in securely, browse your feed, search for profiles, view profile data, and interact with posts (like, comment, read metrics). Use the client to invoke specific tools such as login_linkedin_secure, browse_linkedin_feed, search_linkedin_profiles, view_linkedin_profile, and interact_with_linkedin_post.
Prerequisites: Python 3.8 or newer, Playwright, and the FastMCP library; you also need a LinkedIn account.
git clone [repository-url]
cd mcp-linkedin-serverCreate and activate a virtual environment, then install dependencies and set up Playwright for Chromium.
python -m venv env
source env/bin/activate # On Windows: env\Scripts\activate
pip install -r requirements.txt
playwright install chromiumConfigure your environment to authenticate with LinkedIn by creating a .env file in the root directory with your credentials and an optional cookie encryption key.
[email protected]
LINKEDIN_PASSWORD=your_password
COOKIE_ENCRYPTION_KEY=your_encryption_key # Optional: will be auto-generated if not providedStart the MCP server by running the main script.
python linkedin_browser_mcp.pyConfiguration and security follow practical defaults designed to protect credentials and manage session state. Your environment variables enable secure, persistent logins and encrypted cookie storage. The server enforces rate limiting and supports automatic session recovery to minimize login churn.
Security notes include encrypted cookie storage, secure credential handling, and session persistence. Adhere to LinkedIn’s terms of service and use rate limiting to avoid triggering security challenges.
Troubleshooting tips cover common network issues, authentication failures, and handling LinkedIn security challenges. Validate that environment variables are set, dependencies are installed, and Playwright can launch Chromium without sandbox restrictions if needed.
Notes: The server exposes tools for login, feed browsing, profile search and viewing, and post interactions. Use the client to call these tools and process the returned data.
Securely log in using environment credentials with encrypted session storage and automatic session recovery.
Browse and extract posts from your LinkedIn feed, including content and engagement metrics.
Search for profiles matching a given query and return profile data.
View and extract data from a specific LinkedIn profile URL.
Like a post, leave a comment, or read post content and engagement metrics.