A Model Context Protocol (MCP) server for LinkedIn. Search people, companies, and jobs, scrape profiles, and retrieve structured JSON data from any MCP-compatible AI client. Built with FastMCP, Patchright, and a clean hexagonal architecture. The getpersonprofile tool supports granular section scraping. Request only the sections you need: - Main profile (always included) — name, headline, location,
Add this skill
npx mdskills install eliasbiondo/linkedin-mcp-serverProfessional LinkedIn scraper with comprehensive tools, excellent documentation, and clean architecture
1# LinkedIn MCP Server23A [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) server for LinkedIn. Search people, companies, and jobs, scrape profiles, and retrieve structured JSON data from any MCP-compatible AI client.45https://github.com/user-attachments/assets/50cd8629-41ee-4261-9538-40dc7d30294e678Built with [FastMCP](https://github.com/PrefectHQ/fastmcp), [Patchright](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright), and a clean hexagonal architecture.910---1112## Features1314| Category | Tools |15| ----------- | ---------------------------------------- |16| People | `get_person_profile` · `search_people` |17| Companies | `get_company_profile` · `get_company_posts` |18| Jobs | `get_job_details` · `search_jobs` |19| Browser | `close_browser` |2021### Person Profile Sections2223The `get_person_profile` tool supports granular section scraping. Request only the sections you need:2425- **Main profile** (always included) — name, headline, location, followers, connections, about, profile image26- **Experience** — title, company, dates, duration, description, company logo27- **Education** — school, degree, dates, description, school logo28- **Contact info** — email, phone, websites, birthday, LinkedIn URL29- **Interests** — people, companies, and groups followed30- **Honors and awards** — title, issuer, description31- **Languages** — language name and proficiency level32- **Posts** — recent activity with reactions and timestamps33- **Recommendations** — received and given, with author details3435### Company Profile Sections3637- **About** (always included) — overview, website, industry, size, headquarters, specialties, logo38- **Posts** — recent feed posts with engagement metrics39- **Jobs** — current open positions4041### Job Search Filters4243The `search_jobs` tool supports the following filters:4445| Filter | Values |46| ------------------ | ------------------------------------------------------------------------- |47| `date_posted` | `past_hour`, `past_24_hours`, `past_week`, `past_month` |48| `job_type` | `full_time`, `part_time`, `contract`, `temporary`, `internship`, `other` |49| `experience_level` | `entry`, `associate`, `mid_senior`, `director`, `executive` |50| `work_type` | `on_site`, `remote`, `hybrid` |51| `easy_apply` | `true` / `false` |52| `sort_by` | `date`, `relevance` |5354---5556## Prerequisites5758- Python 3.12 or later59- [uv](https://docs.astral.sh/uv/) package manager60- A LinkedIn account for authentication6162---6364## Quick Start6566### 1. Clone and install6768```bash69git clone https://github.com/eliasbiondo/linkedin-mcp-server.git70cd linkedin-mcp-server71uv sync72```7374### 2. Install browser7576This project uses [Patchright](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright) (a patched fork of Playwright) for browser automation. You need to install the browser binaries before first use:7778```bash79uv run patchright install80```8182> **Windows users:** If the command above fails with `program not found`, run instead:83>84> ```powershell85> uv run python -m patchright install86> ```8788### 3. Authenticate with LinkedIn8990```bash91uv run linkedin-mcp-server --login92```9394A browser window will open. Log in to LinkedIn and the session will be persisted locally at `~/.linkedin-mcp-server/browser-data`.9596### 4. Run the server9798**stdio transport** (default — for Claude Desktop, Cursor, and similar clients):99100```bash101uv run linkedin-mcp-server102```103104**HTTP transport** (for remote clients, the MCP Inspector, etc.):105106```bash107uv run linkedin-mcp-server --transport streamable-http --host 0.0.0.0 --port 8000108```109110---111112## Client Integration113114### Claude Desktop / Cursor115116Add to your MCP configuration file:117118```json119{120 "mcpServers": {121 "linkedin": {122 "command": "uv",123 "args": [124 "--directory", "/path/to/linkedin-mcp-server",125 "run", "linkedin-mcp-server"126 ]127 }128 }129}130```131132### MCP Inspector133134```bash135npx @modelcontextprotocol/inspector136```137138Then connect to `http://localhost:8000/mcp` if using HTTP transport.139140---141142## Configuration143144Configuration follows a strict precedence chain: **CLI args > environment variables > `.env` file > defaults**.145146### CLI Arguments147148| Argument | Description | Default |149| --------------- | ----------------------------------- | ----------- |150| `--transport` | `stdio` or `streamable-http` | `stdio` |151| `--host` | Host for HTTP transport | `127.0.0.1` |152| `--port` | Port for HTTP transport | `8000` |153| `--log-level` | `DEBUG`, `INFO`, `WARNING`, `ERROR` | `WARNING` |154| `--headless` | Run browser in headless mode | `true` |155| `--no-headless` | Show browser window (visible mode) | — |156| `--login` | Open browser for LinkedIn login | — |157| `--logout` | Clear stored credentials | — |158| `--status` | Check session status | — |159160### Environment Variables161162Create a `.env` file in the project root:163164```env165# Server166LINKEDIN_TRANSPORT=stdio167LINKEDIN_HOST=127.0.0.1168LINKEDIN_PORT=8000169LINKEDIN_LOG_LEVEL=WARNING170171# Browser172LINKEDIN_HEADLESS=true173LINKEDIN_SLOW_MO=0174LINKEDIN_TIMEOUT=10000175LINKEDIN_VIEWPORT_WIDTH=1280176LINKEDIN_VIEWPORT_HEIGHT=720177LINKEDIN_CHROME_PATH=178LINKEDIN_USER_AGENT=179LINKEDIN_USER_DATA_DIR=~/.linkedin-mcp-server/browser-data180```181182---183184## Architecture185186The project follows a hexagonal (ports and adapters) architecture with strict layer separation:187188```189src/linkedin_mcp_server/190├── domain/ # Core business logic — zero external dependencies191│ ├── models/ # Data models (Person, Company, Job, Search)192│ ├── parsers/ # HTML to structured data parsers193│ ├── exceptions.py # Domain exceptions194│ └── value_objects.py # Immutable configuration and content objects195├── ports/ # Abstract interfaces196│ ├── auth.py # Authentication port197│ ├── browser.py # Browser automation port198│ └── config.py # Configuration port199├── application/ # Use cases — orchestration layer200│ ├── scrape_person.py201│ ├── scrape_company.py202│ ├── scrape_job.py203│ ├── search_people.py204│ ├── search_jobs.py205│ └── manage_session.py206├── adapters/ # Concrete implementations207│ ├── driven/ # Infrastructure adapters (browser, auth, config)208│ └── driving/ # Interface adapters (CLI, MCP tools, serialization)209└── container.py # Dependency injection composition root210```211212### Design Decisions213214- **Ports and adapters** — Domain logic is fully decoupled from infrastructure. The browser engine, MCP framework, and configuration source can all be swapped independently.215- **Dependency injection** — A single `Container` class acts as the composition root and is the only place that imports concrete adapter classes.216- **Structured JSON output** — LinkedIn HTML is parsed into typed Python dataclasses, then serialized to JSON for reliable LLM consumption.217- **Session persistence** — Browser state is saved to disk, so authentication is required only once.218219---220221## Development222223### Setup224225```bash226uv sync --group dev227uv run pre-commit install228```229230### Running tests231232```bash233uv run pytest234```235236With coverage:237238```bash239uv run pytest --cov=linkedin_mcp_server240```241242### Linting and formatting243244This project uses [Ruff](https://docs.astral.sh/ruff/) for both linting and formatting. Pre-commit hooks will run these automatically on each commit.245246```bash247# Lint248uv run ruff check .249250# Lint and auto-fix251uv run ruff check . --fix252253# Format254uv run ruff format .255```256257---258259## License260261This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.262263---264265## Contributing266267Contributions are welcome. Please read the [contributing guide](CONTRIBUTING.md) for details on the development workflow and submission process.268269---270271## Disclaimer272273This tool is intended for personal and educational use. Scraping LinkedIn may violate their Terms of Service. Use responsibly and at your own risk. The authors are not responsible for any misuse or consequences arising from the use of this software.274
Full transparency — inspect the skill content before installing.