LinkedIn MCP Server
repository·main·Indexed 25 days ago
https://github.com/stickerdaniel/linkedin-mcp-serverAn MCP server (version 4.20.1) that enables AI assistants like Claude to interact with LinkedIn using a user's local browser session. It provides tools for accessing profiles, messaging, company research, job searching, and feed monitoring. Supports installation via uvx or as a Claude Desktop MCP bundle, with features for session import from Chromium browsers and configurable HTTP transport mode.
What's inside linkedin-mcp-server
- The LinkedIn MCP Server is an Model Context Protocol (MCP) server that enables AI assistants (such as Claude) to interact with LinkedIn data using your own local, logged-in browser session. It allows for reading profiles, accessing company information, searching for jobs, and managing messages through your existing authentication.
Verify browser compatibility for session import
mainBefore attempting to import a session from a specific browser, use this checklist to ensure the server can successfully decrypt the cookies:
- User-data root: Ensure the user-data root resolves on your OS and contains a
Local Statefile. - Cookies DB: Confirm the Cookies database is found (preferred path:
Default/Network/Cookies, fallback:Default/Cookies). - Metadata: Verify that
li_atmetadata can be read without keychain access (expiry and last-access should be available from SQLite columns). - Keychain/Keystore: Confirm the OS Keychain service name actually decrypts a real cookie. Note that browser forks often rename the service (e.g., Helium uses
Helium Storage Keyinstead of<name> Safe Storage). - End-to-end test: Sign into LinkedIn in that browser, then run the server with
--import-from-browser <key>and verify it can access/feed/.
- User-data root: Ensure the user-data root resolves on your OS and contains a
Install and configure the LinkedIn MCP Server via uvx
mainThe recommended way to run the LinkedIn MCP server is using
uvx. This ensures you always run the latest version (via the@latesttag) and avoids version rot caused by LinkedIn's frequent UI changes.Prerequisites: Install
uv(version 0.4.0 or higher).Client Configuration (JSON): Add the following to your MCP client configuration file:
{ "mcpServers": { "mcp-server-linkedin": { "command": "uvx", "args": ["mcp-server-linkedin@latest"], "env": { "UV_HTTP_TIMEOUT": "300" } } } }Note: Setting
UV_HTTP_TIMEOUTto300is recommended to prevent timeouts during initial dependency downloads on slow connections.Quick Start: Run LinkedIn MCP Server via Docker
mainTo use the LinkedIn MCP server in a Docker container, you must first create a browser profile on your host machine to handle authentication. Docker containers cannot open a browser window for manual login.
Step 1: Create a profile on your host
You need
uvinstalled on your host. Run the following command to open a browser window and log in to LinkedIn manually. The session will be saved to~/.linkedin-mcp/.uvx mcp-server-linkedin@latest --loginAlternative: Import an existing session If you are already logged into LinkedIn in a local browser (Chrome, Brave, Edge, etc.), you can reuse that session instead of performing a new login:
uvx mcp-server-linkedin@latest --import-from-browserNote: This does not work for Chrome 127+ if app-bound encryption is used. In that case, use
--login.Step 2: Configure Claude Desktop
{ "mcpServers": { "mcp-server-linkedin": { "command": "docker", "args": [ "run", "--rm", "-i", "-v", "~/.linkedin-mcp:/home/pwuser/.linkedin-mcp", "stickerdaniel/linkedin-mcp-server:latest" ] } } }Set up the LinkedIn MCP Server locally for development
mainTo develop or contribute to the project, follow these steps to clone the repository and install dependencies using
uv.Prerequisites:
Steps:
- Clone the repository and enter the directory.
- Install the
uvpackage manager. - Synchronize dependencies for both the main project and development group.
- Install pre-commit hooks.
- Start the server using the module flag.
Note: The local server manages the Patchright Chromium browser cache automatically. You can explicitly create a session by running the server with the
--loginflag.# 1. Clone repository git clone https://github.com/stickerdaniel/linkedin-mcp-server cd linkedin-mcp-server # 2. Install UV package manager (if not already installed) curl -LsSf https://astral.sh/uv/install.sh | sh # 3. Install dependencies uv sync uv sync --group dev # 4. Install pre-commit hooks uv run pre-commit install # 5. Start the server uv run -m linkedin_mcp_serverInstall the Claude Desktop MCP Bundle
mainFor Claude Desktop users, you can perform a one-click installation using the
.mcpbartifact.Prerequisites: Claude Desktop.
Steps:
- Download the latest
.mcpbartifact from the releases page. - Click the downloaded
.mcpbfile to install it into Claude Desktop. - Call any LinkedIn tool to begin.
Note: On startup, the bundle prepares the Patchright Chromium browser cache in the background. If you call a tool before this is finished, Claude will surface a setup-in-progress error. On the first tool call requiring authentication, the server will open a LinkedIn login browser window; you must sign in and then retry the tool call.
- Download the latest
Set up the LinkedIn MCP Server with Docker
mainTo run the LinkedIn MCP server in Docker, you must first create a browser profile on your host machine because Docker runs headless and cannot open a browser window for manual login.
- Create a profile on the host: Run
uvx mcp-server-linkedin@latest --login. This opens a browser for manual login. Profiles are saved to~/.linkedin-mcp/. - Configure Claude Desktop: Add the Docker configuration to your
mcpServerssettings, mounting the host profile directory into the container.
Note: Docker creates a fresh session on each startup. If authentication fails, re-run the
--logincommand on your host.# Step 1: Create profile on host uvx mcp-server-linkedin@latest --login// Step 2: Claude Desktop Configuration { "mcpServers": { "mcp-server-linkedin": { "command": "docker", "args": [ "run", "--rm", "-i", "-v", "~/.linkedin-mcp:/home/pwuser/.linkedin-mcp", "stickerdaniel/linkedin-mcp-server:latest" ] } } }- Create a profile on the host: Run
Authenticate with LinkedIn
mainThe server requires a LinkedIn session to function. You can establish a session in two ways:
Manual Login (Recommended for new setups): Run the following command to open a browser window where you can sign in manually and solve any CAPTCHAs:
uvx mcp-server-linkedin@latest --loginImport from an existing browser session: If you are already logged into LinkedIn in a local browser (Chrome, Brave, Edge, etc.), you can import that session to skip manual login:
- Auto-pick the most recent session:
uvx mcp-server-linkedin@latest --import-from-browser - Target a specific browser:
uvx mcp-server-linkedin@latest --import-from-browser <browser_name>(e.g.,brave,edge,chrome).
- Auto-pick the most recent session:
Important: If you use a proxy, configure it before running
--loginor--import-from-browserto avoid triggering LinkedIn security checkpoints.uvx mcp-server-linkedin@latest --login # OR uvx mcp-server-linkedin@latest --import-from-browser braveImport LinkedIn session from a browser
mainUse the
--import-from-browser <key>flag to read and decrypt the LinkedIn session cookie from a locally installed Chromium-based browser. This allows you to reuse an existing LinkedIn session without manual login.Requirements for successful import:
- The browser must have a valid
Local Statefile in its user-data root. - The Cookies database must be accessible (typically at
Default/Network/CookiesorDefault/Cookies). - The OS keystore (e.g., macOS Keychain) must contain the correct decryption key for the cookie value.
Note on User Agents: When importing a session, the server reconstructs the source browser's User Agent to match the session fingerprint. This is done using the OS platform token and the Chromium major version read from the browser's files. You can override this behavior using the
USER_AGENTenvironment variable or the--user-agentflag.- The browser must have a valid
Configure Proxy Settings for LinkedIn MCP Server
mainTo route browser traffic through a proxy, use the
PROXY_SERVERenvironment variable with the formatscheme://host:port. You can also provide credentials viaPROXY_USERNAMEandPROXY_PASSWORD.Important Notes:
- Chromium cannot authenticate to a SOCKS proxy; use
http(s)endpoints for proxy authentication. - Inside a Docker container,
127.0.0.1refers to the container itself. To use a proxy running on your host, usehost.docker.internal. On native Linux Docker, you must add the flag--add-host=host.docker.internal:host-gatewayto yourdocker runcommand. - Only browser traffic is routed through the proxy, not the MCP transport.
- Chromium cannot authenticate to a SOCKS proxy; use
Troubleshoot LinkedIn MCP Server issues
mainLogin & Session Issues
- Manual Login: If automated login fails, use the
--logincommand to open a browser window where you can manually solve captchas or handle mobile app confirmations. - Clearing Sessions: If your session is corrupted, use
--logoutto clear the profile stored at~/.linkedin-mcp/profile/. - Docker Detection: If running on a non-containerized Linux host and receiving "No valid LinkedIn session is available in Docker" errors, set the environment variable
LINKEDIN_MCP_CONTAINER=false.
Scraping & Timeout Issues
- Debugging Scraping: Use
--no-headlessto watch the browser actions and--log-level DEBUGfor detailed logs. - Page Operation Timeouts: If elements aren't being found or navigation hangs, increase the page timeout using
--timeout 10000(milliseconds). - Tool Execution Timeouts: For heavy scrapes or slow networks, increase the per-tool timeout using
--tool-timeout 300(seconds).
Proxy Configuration
- Setup Order: Always set up your proxy before creating a session. Run
--loginwith the proxy already configured. Switching to a proxy with an existing profile will likely trigger a LinkedIn security checkpoint. - Authentication: Use
PROXY_USERNAMEandPROXY_PASSWORDenvironment variables. Chromium does not support SOCKS proxy authentication; use anhttp(s)endpoint. - Localhost Access: If using a proxy, you may need to set
PROXY_BYPASS=localhost,127.0.0.1,::1to ensure local targets are reached directly.
- Manual Login: If automated login fails, use the
Override Docker detection with LINKEDIN_MCP_CONTAINER
mainIf you are not running in a container but receive the error "No valid LinkedIn session is available in Docker", the runtime may have been misdetected (common on Linux hosts with Docker daemons).
Use the
LINKEDIN_MCP_CONTAINERenvironment variable to override this:- Set
LINKEDIN_MCP_CONTAINER=falseto indicate you are on a host machine. - Set
LINKEDIN_MCP_CONTAINER=trueto force container mode.
- Set