linkedin-spider
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
linkedin-spider
A modern LinkedIn scraping library with built-in anti-detection, available as a Python library, CLI tool, and MCP server.
MCP Server · Python Library · CLI · Docker
Features
Profile search with advanced filters (location, industry, company, connection degree)
Post search by keywords with engagement metrics and comments
Profile scraping with experience, education, skills, and contact details
Company scraping with industry, size, specialties, and more
Connection management — retrieve and send connection requests
Conversations — list threads, read message history, and send messages
Proxy support — route traffic through HTTP or SOCKS5 proxies
Anti-detection — human-like behavior simulation, stealth mode, session persistence
Related MCP server: LinkedIn MCP Server
Installation
pip install linkedin-spider # library only
pip install linkedin-spider[cli] # library + CLI
pip install linkedin-spider[mcp] # library + MCP server
pip install linkedin-spider[all] # everythingAuthentication
linkedin-spider supports two authentication methods. Sessions are persisted in a Chrome profile so you typically only authenticate once.
LinkedIn Cookie (Recommended)
Log in to LinkedIn in your browser
Open DevTools (F12) → Application → Cookies →
linkedin.comCopy the
li_atcookie value
scraper = LinkedinSpider(li_at_cookie="your_cookie_value")Email & Password
scraper = LinkedinSpider(email="you@example.com", password="your_password")For CLI and MCP, pass --cookie (or --email/--password) flags, or set the LINKEDIN_COOKIE (or LINKEDIN_EMAIL/LINKEDIN_PASSWORD) environment variables.
MCP Server
The MCP server exposes LinkedIn data to AI assistants like Claude.
Example prompts you can give Claude once connected:
Research the background of this candidate https://www.linkedin.com/in/johndoeFind 10 product managers in San Francisco and summarize their experienceWhat has OpenAI been posting about recently? https://www.linkedin.com/company/openaiShow me my pending connection requests and summarize who they areSend a message to John Doe saying "Thanks for connecting!"It provides 12 tools:
Tool | Description |
| Search profiles with filters (location, industry, company, connections) |
| Extract complete profile data from a URL |
| Search posts by keywords with date filters |
| Get company details from a URL |
| List pending connection requests received |
| List connection requests you've sent |
| Send a connection request with optional note |
| List messaging conversations |
| Read messages from a conversation |
| Send a message in an existing or new conversation |
| Check if the browser session is active |
| Close and reset the browser session |
Start the server
# stdio (default — for Claude Desktop, Claude Code)
linkedin-spider-mcp serve --cookie your_li_at_cookie_value
# SSE or HTTP (for remote clients)
linkedin-spider-mcp serve --transport sse --host 127.0.0.1 --port 8000
linkedin-spider-mcp serve --transport http --host 0.0.0.0 --port 9000Or configure via environment variables in a .env file:
LINKEDIN_COOKIE=your_li_at_cookie_value
HEADLESS=true
PROXY_URL=http://host:port # optionalClaude Desktop
Add to your Claude Desktop config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
With Docker (Recommended)
No local dependencies required — the Docker image includes Python, Chrome, and everything needed.
{
"mcpServers": {
"linkedin-spider": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"LINKEDIN_COOKIE=your_li_at_cookie_value",
"-e",
"HEADLESS=true",
"-e",
"TRANSPORT=stdio",
"vertexcoverlabs/linkedin-mcp"
]
}
}
}Without Docker
Requires pip install linkedin-spider[mcp] and Chrome installed locally.
{
"mcpServers": {
"linkedin-spider": {
"command": "linkedin-spider-mcp",
"args": ["serve", "--cookie", "your_li_at_cookie_value"]
}
}
}Claude Code
With Docker
claude mcp add linkedin-spider -- \
docker run --rm -i \
-e LINKEDIN_COOKIE=your_li_at_cookie_value \
-e HEADLESS=true \
-e TRANSPORT=stdio \
vertexcoverlabs/linkedin-mcpWithout Docker
claude mcp add linkedin-spider -- \
linkedin-spider-mcp serve --cookie your_li_at_cookie_valueOr connect to a running SSE/HTTP server:
claude mcp add linkedin-spider --transport sse http://localhost:8000/sseTroubleshooting
Cookie expired: LinkedIn cookies expire periodically. Grab a fresh
li_atvalue from your browser.Email/password not working: LinkedIn may trigger a CAPTCHA or verification. Try cookie auth instead.
Session reuse: Sessions are saved in a Chrome profile. If things break, delete the profile directory and re-authenticate.
First-time pull is slow: The image is ~1.4GB. Pre-pull with
docker pull vertexcoverlabs/linkedin-mcpbefore configuring Claude Desktop to avoid timeout.Port conflicts: If port 8080 is in use, map to a different host port:
-p 9090:8080.
Chrome not found (non-Docker): Set
CHROMEDRIVER_PATHin your.envor passchromedriver_pathinScraperConfig.Page load timeouts: Increase
page_load_timeoutinScraperConfigor use a faster proxy.Headless mode issues: Some LinkedIn pages behave differently in headless mode. Try
headless=Falsefor debugging.
Python Library
from linkedin_spider import LinkedinSpider, ScraperConfig
config = ScraperConfig(headless=True, page_load_timeout=30)
scraper = LinkedinSpider(
li_at_cookie="your_cookie_value",
config=config,
)
# Search profiles
results = scraper.search_profiles("software engineer", max_results=10)
# Search posts
posts = scraper.search_posts("artificial intelligence", max_results=10)
# Scrape a single profile
profile = scraper.scrape_profile("https://linkedin.com/in/someone")
# Scrape a company page
company = scraper.scrape_company("https://linkedin.com/company/openai")
# Connection requests
incoming = scraper.scrape_incoming_connections(max_results=20)
scraper.send_connection_request("https://linkedin.com/in/someone", note="Hi!")
# Conversations
threads = scraper.scrape_conversations_list(max_results=10)
messages = scraper.scrape_conversation_messages("John Doe")
scraper.send_message("Thanks for connecting!", participant_name="John Doe")
# Always clean up
scraper.close()See the examples/ directory for more detailed usage.
Configuration
ScraperConfig accepts the following options:
Option | Default | Description |
|
| Run browser without a visible window |
|
| Inject anti-detection scripts |
|
| Page load timeout in seconds |
|
| Implicit wait timeout in seconds |
|
| Random delay range between actions |
|
| Proxy URL ( |
|
| Override the default user agent |
Command Line Interface
# Search profiles
linkedin-spider-cli search -q "product manager" -n 10 -o results.json
# Search posts
linkedin-spider-cli search-posts -k "artificial intelligence" -n 10 -o posts.json
# Scrape a profile
linkedin-spider-cli profile -u "https://linkedin.com/in/johndoe" -o profile.json
# Scrape a company
linkedin-spider-cli company -u "https://linkedin.com/company/openai" -o company.json
# List connection requests
linkedin-spider-cli connections -n 20 -o connections.jsonPass --cookie on first use (or set LINKEDIN_COOKIE env var). You can also use --email/--password instead. The session is saved and reused for subsequent commands.
Output defaults to stdout. Use -o to write JSON or CSV files.
Docker
A pre-built Docker image is published on Docker Hub:
docker pull vertexcoverlabs/linkedin-mcpOr build locally:
docker build -t linkedin-spider .Run with different transports:
# stdio
docker run --rm -i -e TRANSPORT=stdio --env-file .env vertexcoverlabs/linkedin-mcp
# SSE
docker run -p 8080:8080 -e TRANSPORT=sse --env-file .env vertexcoverlabs/linkedin-mcp
# HTTP
docker run -p 8080:8080 -e TRANSPORT=http --env-file .env vertexcoverlabs/linkedin-mcpRunning in the Cloud
LinkedIn blocks requests from known datacenter IP ranges. To run linkedin-spider on a cloud server (AWS, GCP, Azure, etc.), route browser traffic through a residential or mobile proxy using the PROXY_URL environment variable.
LINKEDIN_COOKIE=your_li_at_cookie_value
HEADLESS=true
PROXY_URL=http://user:pass@proxy-host:portBoth HTTP and SOCKS5 proxies are supported:
PROXY_URL=http://user:pass@proxy-host:port
PROXY_URL=socks5://user:pass@proxy-host:portWhen using Docker, pass it as an environment variable:
docker run --rm -i \
-e LINKEDIN_COOKIE=your_li_at_cookie_value \
-e PROXY_URL=http://user:pass@proxy-host:port \
-e HEADLESS=true \
-e TRANSPORT=stdio \
vertexcoverlabs/linkedin-mcpWhen using the Python library, pass it via ScraperConfig:
config = ScraperConfig(headless=True, proxy="http://user:pass@proxy-host:port")Residential proxies are recommended over datacenter proxies to avoid detection.
Development
git clone https://github.com/vertexcover-io/linkedin-spider
cd linkedin-spider
uv sync
cp .env.example .env # add your credentialsmake check # lint + typecheck
make test # run tests
make build # build wheelDisclaimer
This tool is for personal and educational use. Please respect LinkedIn's Terms of Service, use reasonable rate limits, and handle collected data responsibly.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
The LinkedIn API for AI agents. Search, inbox, posts and outreach over MCP.
LinkedIn actions for AI agents: search, messaging, posts and invites, as hosted MCP tools.
Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.
Give AI agents the LinkedIn tools to find, qualify, engage, and follow up with prospects.
Related MCP Servers
- AlicenseAqualityBmaintenanceReleased 3.0.0: 22 MCP tools, guided offline setup, local stdio, Chrome and manual login. No hosted deployment or job-research brief. Writes need opt-in, reviewed preview and human approval. Unofficial; provider compatibility, first-use cohorts, coordinated erasure and Windows privacy proof remain unverified. No mandatory paid service.22137 npm12MIT
- AlicenseAqualityDmaintenanceEnables searching and scraping of LinkedIn profiles, companies, jobs, and posts using natural language through MCP-compatible AI clients.13MIT
- AlicenseAqualityNot gradedmaintenanceAn MCP server that lets AI assistants read LinkedIn data through the user's logged-in browser session, providing tools for profiles, companies, job searches, messaging, and feeds.19Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered LinkedIn automation, including content generation, profile and company data extraction, connection requests, and post scraping through MCP tools.-