LinkedIn

io.github.JohannsenLum由 GitHub 帳號 JohannsenLum 發布v1.0.1更新於 Oct 27, 2026

Read LinkedIn profiles, companies, jobs and messages via your own browser session

概覽

AI 產生的概覽

透過你自己已登入的瀏覽器工作階段讀取 LinkedIn 的個人檔案、公司、職缺、貼文與訊息,並可傳送訊息和邀請連結。

可以做什麼
  • 讀取個人檔案:依連結或公開識別碼取得成員檔案、取得自己的檔案、依關鍵字搜尋成員
  • 讀取公司與職缺:取得公司頁面、搜尋公司、搜尋職缺、取得單一職缺內容
  • 讀取貼文與訊息:搜尋動態貼文、列出收件匣對話預覽、讀取某個對話的完整紀錄、搜尋對話
  • 以你的帳號傳送訊息與邀請連結
  • 檢查工作階段是否有效,以及目前用量是否觸及速率限制
適用情境
適合讓助理在 LinkedIn 上調查人物、公司或職缺,或整理與回覆你的收件匣,並使用你已登入的帳號。它不是通用的 LinkedIn API,適合低頻、有節制地使用。
執行需求
以 Python 套件在本機執行,透過 uvx 啟動,並需安裝其驅動的 Chromium(patchright)。需要你的 LinkedIn li_at 工作階段 cookie,可透過 auth 指令存入系統鑰匙圈,或以 LINKEDIN_COOKIE 提供。選用設定:LINKEDIN_HEADLESS、LINKEDIN_MIN_INTERVAL、LINKEDIN_MAX_PER_HOUR。僅支援桌面用戶端。
安裝前請注意
li_at cookie 等同於你的 LinkedIn 登入狀態:可被用來冒充你操作,變更密碼後仍有效,且無法從 LinkedIn 的工作階段清單撤銷,請用 auth 指令保存,切勿貼到聊天或提交紀錄中。send_message 與 connect 會立即以真實帳號執行,沒有草稿或復原。LinkedIn 使用者條款禁止自動化存取,帳號可能被限制或停權。擷取的頁面文字會以資料形式傳給助理。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 LinkedIn,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

linkedin-api-mcp

Disclaimer: This is an independent, community project. It is not affiliated with, authorized by, endorsed by, or sponsored by LinkedIn Corporation or Microsoft. "LinkedIn" is a registered trademark of LinkedIn Corporation and is used here only descriptively to identify the third-party service this software interoperates with.

An MCP server for LinkedIn. It drives a real, headless browser (patchright, an undetected fork of Playwright) using your own logged-in LinkedIn session cookie. There is no scraping API, no credential stuffing, no bypass of LinkedIn's login. Your agent gets 12 read tools (profiles, companies, jobs, posts, your inbox) and two write tools, kept deliberately separate: sending a message and sending a connection request. Every action goes through a single browser session, one at a time, paced against limits you control. See Safety below.

Documentation: mcp.johannsenlum.com/linkedin

[PyPI] [Python 3.11+] [License: MIT] [MCP Registry] [GitHub stars]

[Terminal demo of linkedin-api-mcp: an agent calls search_people to find a member, then send_message to message them, then reads the conversation back to confirm the message actually arrived. 14 tools, 68 tests, MIT licence.]

Install (one-click)

Deeplinks exist for Cursor and VS Code only; no other client has a documented install-link format. These prefill the command below, nothing else needs filling in since the cookie lives in your OS keyring, not an environment variable.

[Add to Cursor] [Add to VS Code]

All clients

ClientDeeplink?
Claude Codeno, one-line command
Claude Desktopno
Cursoryes, above
VS Codeyes, above
Codex CLIno
Zedno
Windsurfno (Windsurf only resolves servers in its own registry)

Claude Code
bash
claude mcp add linkedin -- uvx linkedin-api-mcp

Claude Desktop: claude_desktop_config.json

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

No one-click install exists for Claude Desktop (it installs .mcpb bundles, not deeplinks). Copy this JSON in via Settings → Developer → Edit Config:

jsonc
{  "mcpServers": {    "linkedin": {      "command": "uvx",      "args": ["linkedin-api-mcp"]    }  }}

Cursor: ~/.cursor/mcp.json

Fallback for the button above, or if you'd rather paste it directly:

jsonc
{  "mcpServers": {    "linkedin": {      "command": "uvx",      "args": ["linkedin-api-mcp"]    }  }}

VS Code: .vscode/mcp.json

Fallback for the button above, or if you'd rather paste it directly. Note VS Code uses a servers key, not mcpServers:

jsonc
{  "servers": {    "linkedin": {      "type": "stdio",      "command": "uvx",      "args": ["linkedin-api-mcp"]    }  }}

Codex CLI: ~/.codex/config.toml
toml
[mcp_servers.linkedin]command = "uvx"args = ["linkedin-api-mcp"]

Codex CLI's config schema has changed across versions and this block is not independently verified against a live install. If it doesn't load, the reliable path is running uvx linkedin-api-mcp yourself and pointing Codex at whatever its current stdio-server config expects.

Zed: settings.json

No deeplink exists for Zed. Add this under context_servers in your Zed settings:

jsonc
{  "context_servers": {    "linkedin": {      "source": "custom",      "command": "uvx",      "args": ["linkedin-api-mcp"]    }  }}

Windsurf: ~/.codeium/windsurf/mcp_config.json

No deeplink exists for Windsurf. It only resolves servers from its own registry, so this has to be pasted in manually via Windsurf Settings → MCP Servers → Edit raw config:

jsonc
{  "mcpServers": {    "linkedin": {      "command": "uvx",      "args": ["linkedin-api-mcp"]    }  }}

If you'd rather not rely on the keyring in a given client (a sandboxed environment, or CI), pass the cookie directly instead of running auth:

jsonc
{  "mcpServers": {    "linkedin": {      "command": "uvx",      "args": ["linkedin-api-mcp"],      "env": { "LINKEDIN_COOKIE": "your-li_at-value" }    }  }}

Anywhere you do this, treat that config file with the same care as the cookie itself: don't commit it, and restrict its permissions.

Getting your session cookie

LinkedIn doesn't offer an API key for this kind of access, so the server uses the same session cookie your browser already holds.

  1. One-time: install the Chromium build the server drives.
    bash
    uvx --from linkedin-api-mcp patchright install chromium
  2. Log in to linkedin.com in a normal browser.
  3. Open DevTools (F12 or Cmd+Opt+I) → Application → Cookies → https://www.linkedin.com.
  4. Find the row named li_at and copy its Value.

[!WARNING] This cookie is your LinkedIn login. Anyone who has it can act as you: read your messages, message your connections, see everything your account can see, without needing your password. It survives a password change, and it cannot be revoked from any session list LinkedIn shows you. Never paste it into a chat, a commit, an issue, a screenshot, or anywhere other than linkedin-api-mcp auth.

  1. Store it:
    bash
    uvx linkedin-api-mcp auth
    Paste the value in when prompted; the terminal will not echo it back. By default it's stored in your OS keyring (Keychain, Windows Credential Manager, or Secret Service on Linux), never written to a config file.
  2. Verify LinkedIn accepts it before wiring up a client:
    bash
    uvx linkedin-api-mcp --test
    Prints the server's redacted configuration and confirms the session is live. It never prints the cookie itself.

Tools

ToolDescription
get_profileFetch a member's profile (headline, about, experience, education, skills) by URL or public identifier.
get_my_profileFetch the profile of the account this server is logged in as.
search_peopleSearch LinkedIn members by keyword.
get_inboxList recent message thread previews.
get_conversationFetch the full message history of one thread, by id.
search_conversationsSearch your message threads by participant or keyword.
send_message ✏️Write. Sends a real message to another member from your account.
connect ✏️Write. Sends a real connection invitation to another member from your account.
get_companyFetch a company page (about, size, industry, recent posts).
search_companiesSearch LinkedIn companies by keyword.
search_jobsSearch job postings by keyword and optional location.
get_jobFetch one job posting in full.
search_postsSearch LinkedIn feed posts by keyword.
linkedin_statusCheck session validity and current usage against the rate limits in Safety.

14 tools: 12 read, 2 write. send_message and connect are the only two that change anything, and both are visible to another real person the moment they run: there is no draft, preview, or undo step. Everything else only reads what your account can already see. Covered by 68 tests.

What's verified, and what isn't

This is a days-old project. Rather than claim everything works, here's what's actually been checked against a live account, and what hasn't.

StatusTool / behaviourNote
Verified liveget_my_profile, get_profile, search_people, get_company, search_companies, search_jobs, search_posts, get_inboxCalled against a real account and returned real data.
Verified livesend_message ✏️A real message was sent, then the thread was read back to confirm it arrived.
Not yet verifiedconnect ✏️, get_conversation, search_conversations, get_job, linkedin_statusImplemented and tested, but not yet exercised against a live account by hand.
Known gapconversation_id from get_inboxComes back null. LinkedIn binds inbox rows to in-memory JS objects rather than URLs, so there's no id to read out of the page.
Known gapReaction and comment counts on search_postsCome back null.
Known gapexperience and education on get_profileLinkedIn loads these sections only on scroll; they currently come back empty.

Safety

  • A serialised action queue. Every tool call, including linkedin_status, passes through the same queue before it touches the browser: one action at a time, never in parallel.

  • A minimum interval and an hourly ceiling, both enforced, not just claimed:

    SettingDefaultEnv varEffect
    Minimum interval between actions2 secondsLINKEDIN_MIN_INTERVALCalls are paced against the previous one, not run back-to-back.
    Actions per rolling hour120LINKEDIN_MAX_PER_HOUROnce hit, further calls fail immediately with a rate_limited error rather than queueing or sleeping.

    The ceiling is local to this server: it exists to stop a looping agent from generating a burst of LinkedIn traffic, not because LinkedIn told us these numbers. Lowering them is always safe; raising them is you deciding you're willing to accept more risk than the defaults assume.

  • Prompt-injection fencing on all scraped free text. Anything read off a LinkedIn page (a headline, an about section, a message) passes through your agent as data. It is fenced before your agent sees it, so text on a profile or in a message cannot pose as an instruction.

  • The cookie lives in your OS keyring, not a config file, by default. See Getting your session cookie.

  • send_message proves delivery before reporting success. It polls the conversation until the sent text actually appears, and raises send_unconfirmed rather than a false {"sent": true} if it doesn't.

Other environment variables the server reads: LINKEDIN_COOKIE (overrides the keyring), LINKEDIN_HEADLESS (default true), LINKEDIN_NAV_TIMEOUT_MS (default 30000).

FAQ

Is this safe to use? Will I get banned?

This tool controls a real browser session; it doesn't exploit undocumented APIs or bypass authentication. LinkedIn's User Agreement prohibits automated access, and accounts using automated tools can be restricted or banned. Use at your own risk; there is no guarantee of account safety. If you encounter any issues, let me know in the Discussions.

What if my agents execute too many actions?

Tool calls run sequentially through a queue. You are responsible for the volume of automation you run; use it sparingly and prompt your agents responsibly.

Licence

MIT © 2026 Johannsen Lum.

Use it, change it, redistribute it, build something commercial on it: the only condition is that you keep the copyright notice and licence text. It comes with no warranty of any kind.

Contributions are accepted under the same licence.

Contributing

Issues and pull requests are welcome: github.com/JohannsenLum/linkedin-api-mcp. Changes are recorded in CHANGELOG.md.

Running the tests

Install the development dependencies and run pytest from the repository root:

bash
pip install -e ".[dev]"python -m pytest -q

The default test suite does not need Chromium, a LinkedIn account, LINKEDIN_COOKIE, or network access. Browser interactions are replaced by the test doubles in tests/fakes.py, which parse canned HTML and expose the small Playwright surface used by the tools. For a parsing-test example, see tests/test_people_parsing.py.

This is an independent project, not affiliated with LinkedIn Corporation. See the disclaimer at the top of this document.

來源:README.md,提交 f05dace

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分