Skip to main content
Glama
README.md
# LinkLinkedIn

**English** | [简体中文](README.zh-CN.md)

**A thin, strictly read-only LinkedIn MCP Server powered by a Chrome MV3 Native Messaging bridge — built for clean, zero-UI-noise structured intelligence.**

Unlike headless Playwright/Selenium scrapers that require exporting cookies, fighting login/2FA walls, or attaching `chrome.debugger` (which triggers Chrome's yellow debugging banner), **LinkLinkedIn** runs a tiny `ISOLATED`-world read-only sensor inside your everyday logged-in Chrome tab and cleans LinkedIn's 2026 StyleX/SDUI DOM into crisp JSON for AI agents (Claude Desktop, Cursor, Claude Code, Antigravity, etc.).

---

## Why LinkLinkedIn?

- **Strictly Read-Only by Design**: Zero clicks, zero form fills, zero messaging, zero connection requests, zero private Voyager API calls. Only standard `https://www.linkedin.com/*` page reads.
- **Zero-UI-Noise Output**: Two-stage denoising (`content_sensor.js` + pure-function `cleaner.py`) strips screen-reader duplicates (`3 reactions 3`), verification promo banners, pronoun/degree badges, action buttons (`Connect`/`Follow`/`Message`), sidebar recommendations, and tracking query parameters (`?miniProfileUrn=...`, `utm_*`).
- **Built for LinkedIn 2026 (StyleX / SDUI)**:
  - Zero brittle CSS class tables — extracts via semantic landmarks (`<main>`, `<section>`, `<h1>/<h2>`, `<dl>`, `[role="listitem"]`, `href` patterns);
  - Preserves `display: contents` SDUI wrappers and visible `<span aria-hidden="true">` text while skipping `.visually-hidden` duplicates;
  - Auto-detects LinkedIn's real **inner scroll container** (fixing `window.scrollY === 0`).
- **One Section = One Navigation**: Optional flags (`include_experience_detail`, `include_posts`) let your agent fetch only the exact sub-pages it needs, minimizing page views.
- **Multi-Language LinkedIn UI Support**: Cleanly parses and strips UI chrome across **English, Simplified/Traditional Chinese (中文), Japanese (日本語), German (Deutsch), French (Français), Spanish (Español), Portuguese (Português), Dutch (Nederlands), and Italian (Italiano)**.
- **Fail-Fast Safety Guardrails**: Strict `https://www.linkedin.com/*` URL allowlist, polite jittered pacing, and immediate halt (`challenge_gate`) on any login/checkpoint/captcha screen.

---

## Architecture

```text
AI Client (Claude Desktop / Cursor / Claude Code / Antigravity)
   │  MCP over stdio (5 strictly read-only tools)
   ▼
linkedin_mcp/server.py  ──►  linkedin_mcp/cleaner.py (Pure-function multi-language denoiser)
   │  127.0.0.1 loopback TCP + ephemeral auth_token
   ▼
scout/web_adapter/bridge_host.py  (Chrome Native Messaging Host)
   │  Native Messaging stdio
   ▼
extension-mv3/  (Chrome MV3 ISOLATED Sensor — zero chrome.debugger, zero main-world injection)
   │  Read-only DOM walk + inner scroll container discovery
   ▼
Your Existing Logged-In LinkedIn Tab (fully visible, never hijacks mouse/keyboard)
```

> Architectural trade-offs and open-source benchmark comparisons are documented in [github-research/README.md](github-research/README.md).

---

## Available MCP Tools (Strictly Read-Only)

| Tool | Description |
| :--- | :--- |
| `linkedin_status` | Verify Chrome extension bridge health, active LinkedIn tab URL/title, scroll container metrics, and challenge state. |
| `linkedin_get_person` | Read a cleaned person profile by slug or `/in/` URL. Optional `include_experience_detail=True` (`/details/experience/`) and `include_posts=True` (`/recent-activity/all/`). |
| `linkedin_get_company` | Read a cleaned company profile from `/company/<slug>/about/` (tagline, industry, size, HQ, website, phone, founded, specialties, about). Optional `include_posts=True` (`/posts/`). |
| `linkedin_search_posts` | Search `/search/results/content/` by topic/keywords with `sort_by` (`relevance` \| `date_posted`), `date_posted` (`past-24h` \| `past-week` \| `past-month`), and `max_scrolls`. Returns clean post body, timestamp, engagement, external links, and real named `/in/<slug>/` author URLs. |
| `linkedin_search_companies` | Search `/search/results/companies/` by company name to resolve canonical `/company/<slug>/` URLs before deep-reading. |

---

## Quick Start (3 Minutes)

### Prerequisites
- Python **3.10+**
- Google Chrome (signed in to `https://www.linkedin.com/` in at least one open tab)

### Step 1: Clone & Install Package

```bash
git clone https://github.com/WoodSettler/LinkLinkedIn.git
cd LinkLinkedIn
pip install -e .
```

### Step 2: Register the Local Native Messaging Host (Windows / macOS / Linux)

```bash
linklinkedin-install-host --install
# Or directly: python scout/web_adapter/install_host.py --install
# To uninstall cleanly later: linklinkedin-install-host --uninstall
```

### Step 3: Load the Unpacked Chrome Extension

1. Open `chrome://extensions` in Google Chrome and enable **Developer mode**.
2. Click **Load unpacked** and select the `extension-mv3/` directory inside this repository.
   - The extension pins a deterministic ID (`elbpkghnandifodfdaflccepfchdphie`) via its public key so it pairs automatically with the registered host.
3. Open (or refresh) a logged-in tab at `https://www.linkedin.com/`.

---

## Connecting to MCP Clients

### Option A: Installed CLI Entrypoint (Recommended)

Add to your MCP client config (Claude Desktop `claude_desktop_config.json`, Cursor `.cursor/mcp.json`, Antigravity `mcp_config.json`, etc.):

```json
{
  "mcpServers": {
    "linklinkedin": {
      "command": "linklinkedin-mcp"
    }
  }
}
```

### Option B: Explicit Python Executable (e.g., Conda / Virtualenv)

```json
{
  "mcpServers": {
    "linklinkedin": {
      "command": "<PATH_TO_PYTHON>",
      "args": ["-m", "linkedin_mcp.server"],
      "cwd": "<PATH_TO_LINKLINKEDIN_REPO>"
    }
  }
}
```

### Option C: Claude Code CLI

```bash
claude mcp add linklinkedin -- linklinkedin-mcp
```

---

## Running Offline Tests

All DOM denoising, multi-language parsing, URL allowlist, and MCP tool-surface checks run 100% offline against real LinkedIn 2026 fixtures (zero network/account usage):

```bash
python -B -m unittest discover -s mcp_tests -t . -v
node mcp_tests/test_content_sensor.mjs
```

---

## Disclaimer & Responsible Use

> **IMPORTANT — PLEASE READ BEFORE USE**
>
> 1. **Independent Open-Source Project**: LinkLinkedIn is an independent, community-developed tool and is **not affiliated with, endorsed by, sponsored by, or associated with LinkedIn Corporation or Microsoft Corporation**. "LinkedIn" is a registered trademark of LinkedIn Corporation.
> 2. **User Responsibility & Terms of Service**: Automated access to third-party platforms may be subject to the platform's Terms of Service, User Agreement, and rate limits. Although LinkLinkedIn is strictly read-only, runs locally on your own machine, and does not perform automated outreach or private API calls, **you are solely responsible** for ensuring your usage complies with LinkedIn's User Agreement, applicable data protection/privacy laws (e.g., GDPR, CCPA), and your organization's policies.
> 3. **Personal Research & Moderate Pace Only**: This tool is intended strictly for personal, human-in-the-loop research and intelligence enrichment at normal human browsing speeds. Do **not** use it for bulk harvesting, commercial data resale, spamming, or circumventing platform security/access controls.
> 4. **No Warranty / Liability**: This software is provided **"AS IS"**, without warranty of any kind, under the [MIT License](LICENSE). The authors and contributors assume **no liability** for any account restrictions, suspensions, data loss, or legal consequences arising from its use.

TDQS

A3.9/5.0

Scored across 5 tools

Disambiguation5/5

The tools separate cleanly by resource and action: post search, company search, person profile read, company profile read, and bridge status. The potential overlap between search_posts and profile-scoped include_posts options is clarified by the descriptions.

Naming Consistency4/5

All tools use a consistent linkedin_ prefix and snake_case naming. The only minor deviation is linkedin_status, which uses a noun/state label rather than the verb_noun pattern seen in search_posts, search_companies, get_person, and get_company.

Tool Count5/5

Five tools is tightly scoped for a LinkedIn search/read bridge. Each tool covers a distinct workflow step, and the status tool prevents blind calls when the extension bridge is unavailable.

Completeness4/5

The server covers post search, company search, person and company deep reads, and bridge status, with optional experience and posts expansion. A direct people-search tool is missing, so resolving a person slug depends on post authors or external input, but the core read workflows are mostly covered.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues