
io.github.JohannsenLum由 GitHub 账号 JohannsenLum 发布v1.0.1更新于 Oct 27, 2026
Read LinkedIn profiles, companies, jobs and messages via your own browser session
概览
通过你自己的已登录浏览器会话读取 LinkedIn 的个人资料、公司、职位、帖子和消息,并可发送消息和连接邀请。
- 可以做什么
- 读取个人资料:按链接或公开标识获取成员资料、获取自己的资料、按关键词搜索成员
- 读取公司与职位:获取公司主页、搜索公司、搜索职位、获取单条职位详情
- 读取帖子与消息:搜索信息流帖子、列出收件箱会话预览、读取某个会话的完整记录、搜索会话
- 以你的账号发送消息和连接邀请
- 检查会话是否有效以及当前用量是否触及速率限制
- 适用场景
- 适合让助手在 LinkedIn 上调研人物、公司或招聘职位,或整理和回复你的收件箱,并使用你已登录的账号。它不是通用的 LinkedIn API,适合低频、有节奏的使用。
- 运行要求
- 以 Python 包形式在本地运行,通过 uvx 启动,并需安装其驱动的 Chromium(patchright)。需要你的 LinkedIn li_at 会话 cookie,可通过 auth 命令存入系统钥匙串,或通过 LINKEDIN_COOKIE 提供。可选设置:LINKEDIN_HEADLESS、LINKEDIN_MIN_INTERVAL、LINKEDIN_MAX_PER_HOUR。仅支持桌面客户端。
安装
在 SourceWeft 中
- 打开 控制台中的 LinkedIn,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
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]
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
Claude Code
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:
Cursor: ~/.cursor/mcp.json
Fallback for the button above, or if you'd rather paste it directly:
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:
Codex CLI: ~/.codex/config.toml
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:
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:
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:
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.
- One-time: install the Chromium build the server drives.
- Log in to linkedin.com in a normal browser.
- Open DevTools (
F12orCmd+Opt+I) → Application → Cookies →https://www.linkedin.com. - Find the row named
li_atand 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.
- Store it: 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.
- Verify LinkedIn accepts it before wiring up a client: Prints the server's redacted configuration and confirms the session is live. It never prints the cookie itself.
Tools
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.
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:
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_messageproves delivery before reporting success. It polls the conversation until the sent text actually appears, and raisessend_unconfirmedrather 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:
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版本历史
1- v1.0.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
