linkedin-api-mcp

linkedin-api-mcp

Provides LinkedIn automation via a real browser session using your own cookie, enabling profile, company, job, and post search and reading, plus sending messages and connection requests with rate limiting.

Category
访问服务器

README

<!-- mcp-name: io.github.JohannsenLum/linkedin-api-mcp -->

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 tools to read profiles, companies, jobs and posts, and — deliberately separated out — two tools that take real actions on your behalf: 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 Rate limits below.

Install

Requires Python 3.11+. The server is published for uv, so nothing needs a persistent virtualenv:

# One-time: install the Chromium build patchright drives.
uvx --from linkedin-api-mcp patchright install chromium

# One-time: store your session cookie in the OS keyring.
uvx linkedin-api-mcp auth

# Verify the cookie works before wiring it into a client.
uvx linkedin-api-mcp --test

--test prints the server's redacted configuration and confirms LinkedIn accepts the stored session — it never prints the cookie itself.

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. Log in to linkedin.com in a normal browser.
  2. Open DevTools (F12 or Cmd+Opt+I) → Application → Cookies → https://www.linkedin.com.
  3. Find the row named li_at and copy its Value.
  4. Run uvx linkedin-api-mcp auth and paste it in when prompted (the terminal will not echo it back).

[!WARNING] This cookie is your LinkedIn login. Anyone who has it can act as you on LinkedIn — read your messages, message your connections, see everything your account can see — without needing your password, and it does not expire when you change one. Never paste it into a chat, a commit, an issue, a screenshot, or anywhere other than linkedin-api-mcp auth. If you ever suspect it has leaked, log out of that session from LinkedIn's Settings → Sign in & security page, which invalidates it immediately.

By default the cookie is stored in your OS keyring (Keychain, Windows Credential Manager, or Secret Service on Linux), never written to a config file. For CI or a throwaway environment, set LINKEDIN_COOKIE instead and skip auth entirely — the environment variable takes priority when both are set.

Tools

Tool Description
get_profile Fetch a member's profile (headline, about, experience, education, skills) by URL or public identifier.
get_my_profile Fetch the profile of the account this server is logged in as.
search_people Search LinkedIn members by keyword.
get_inbox List recent message thread previews.
get_conversation Fetch the full message history of one thread, by id.
search_conversations Search 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_company Fetch a company page (about, size, industry, recent posts).
search_companies Search LinkedIn companies by keyword.
search_jobs Search job postings by keyword and optional location.
get_job Fetch one job posting in full.
search_posts Search LinkedIn feed posts by keyword.
linkedin_status Check session validity and current usage against the rate limits below.

send_message and connect are the only two tools that change anything — everything else only reads what your account can already see. Both are visible to another real person the moment they run: there is no draft, preview, or undo step.

Client configuration

All three clients spawn the same command over stdio; only the file differs.

Claude Desktop

Add to claude_desktop_config.json:

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

Claude Code

claude mcp add linkedin -- uvx linkedin-api-mcp

or add the same block as above to .mcp.json.

Cursor

Add to .cursor/mcp.json:

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

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

{
  "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.

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.

Rate limits

The queue answer above is enforced, not just claimed — every tool call, including linkedin_status, passes through the same ActionQueue before it touches the browser:

Setting Default Env var Effect
Minimum interval between actions 2 seconds LINKEDIN_MIN_INTERVAL Calls are paced against the previous one, not run back-to-back.
Actions per rolling hour 120 LINKEDIN_MAX_PER_HOUR Once hit, further calls fail immediately with a rate_limited error rather than queueing or sleeping.

Both are read from the environment at startup. 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. Call linkedin_status to see current usage against both before running a batch of actions.

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

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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选