Skip to main content
Glama
TSS99
by TSS99

LinkedIn MCP

这个 MCP 服务器通过 DevTools 协议驱动一个真实的 Chrome 窗口,让 AI 助手能够搜索 LinkedIn 职位并读取 LinkedIn 个人资料。

它是只读的。这里没有任何工具可以建立连接、发送消息、表示认可、发布内容或申请职位——这不是靠某个设置,而是因为实现这些功能的代码根本不存在。这是刻意划出的一条界线:LinkedIn 对自动化写入的处理远比自动化读取严厉,而把两者混在一起正是账号遭到限制的原因。

工具

工具

返回内容

linkedin_search_jobs

返回职位列表,包含标题、公司、地点、工作场所类型、发布时的薪资、发布时长和 job_id。筛选条件:location、posted-within-days、experience level、job type、workplace type、Easy Apply、sort order。

linkedin_get_job

一条完整的职位发布——公司、地点、LinkedIn 的职位洞察,以及展开“See more”折叠后的完整职位描述。

linkedin_get_profile

姓名、头衔、地点、关于文本、工作经历、教育背景和技能。

linkedin_check_session

已保存的浏览器会话是否仍处于登录状态。

linkedin_close_session

与 Chrome 断开连接,让窗口和会话保持原样。

Related MCP server: LinkedIn MCP Server

安装

需要 Python 3.12+、uv 和 Google Chrome。

git clone https://github.com/TSS99/linkedin-mcp.git
cd linkedin-mcp
uv sync

登录一次。这会打开一个 Chrome 窗口,等待你手动登录——脚本绝不会输入凭据,因为 LinkedIn 会拦截脚本化的凭据输入:

uv run linkedin-mcp --login

会话持久保存在 ~/.linkedin-mcp/chrome-profile 中。你可以随时用 uv run linkedin-mcp --check 检查它,或者用 uv run linkedin-mcp --logout 清除它。

它驱动哪个 Chrome 配置文件

默认情况下,服务器会打开一个属于它自己的一次性配置文件。那个窗口看起来是全新的——没有书签、没有扩展,除了 LinkedIn 之外没有登录任何东西。这正是关键所在:服务器只能看到 LinkedIn。

如果你更希望它驱动你日常使用的 Chrome,从而复用你已有的 LinkedIn 会话,并且不打开陌生的窗口,请设置:

LINKEDIN_MCP_PROFILE_DIR=system

或者显式地把它指向任意配置文件目录。在 MCP 客户端配置中,这放在 env 块里:

{
  "mcpServers": {
    "linkedin": {
      "command": "uv",
      "args": ["--directory", "/path/to/linkedin-mcp", "run", "linkedin-mcp"],
      "env": { "LINKEDIN_MCP_PROFILE_DIR": "system" }
    }
  }
}

在这样做之前,有两件事需要明白:

你仍然需要重启一次 Chrome。 --remote-debugging-port 只在启动时生效;它无法对已经运行的进程开启。所以,无论配置文件怎么设置,当前已经打开的 Chrome 永远无法被附加。请彻底退出 Chrome(Cmd+Q,而不只是关闭窗口),然后让服务器来启动它,或者用 --login 打印出的命令自己启动它。

调试端口并非 LinkedIn 专属。 任何能够访问 127.0.0.1:9224 的东西,都可以驱动那个 Chrome 中的每一个标签页,并读取其中的每一个会话——你的邮件、你的银行、所有这一切——而不仅仅是 LinkedIn。在隔离的配置文件里,没有其他东西可被访问;在你日常使用的配置文件里,什么都可以被访问。只在你信任的机器上这样运行,并在用完后关闭调试 Chrome。

--logout 拒绝删除并非由它创建的配置文件,所以把它指向你真实的 Chrome,不会抹掉你的浏览器状态。

配置

添加到你的 MCP 客户端配置中(参见 mcp-config.example.json):

{
  "mcpServers": {
    "linkedin": {
      "command": "uv",
      "args": ["--directory", "/path/to/linkedin-mcp", "run", "linkedin-mcp"]
    }
  }
}

对于 Claude Code:claude mcp add linkedin -- uv --directory /path/to/linkedin-mcp run linkedin-mcp

工作原理及其原因

CDP 对接真实 Chrome 配置文件,而不是启动的浏览器。 Playwright 自带的 Chromium 会在十几种 LinkedIn 会检查的方面暴露自己。附加到你亲自登录过的真实 Chrome 上,才能让浏览器指纹和 Cookie 保持真实可信。服务器运行在调试端口 9224 上,因此可以与 9222/9223 上其他由浏览器驱动的 MCP 服务器共存。

导航会控制节奏。 LinkedIn 的限流不仅看请求量,还看请求节奏,所以 goto 会强制一个带抖动的最小间隔。长时间的研究性运行会比本可以的速度更慢——这是故意的。

LinkedIn DOM 中的每个字符串都会出现两次——一次可见,一次在供屏幕阅读器使用的 visually-hidden span 中——因此原始的 innerText 读起来是“Acme Corp\nAcme Corp”。dedupe_lines 会折叠连续重复的内容;没有它,解析出的每个字段都会翻倍。

选择器是有序的回退列表。 LinkedIn 的类名经过混淆,而且经常改名。只要可能,解析器就会锚定在那些在类名变动中存活下来的东西上——data-occludable-job-id 属性、稳定的 div#experience 锚点 id——并在必要时退而根据卡片文本的行序进行解析,而不是依赖逐字段的钩子。

一次失败的抓取绝不会返回空结果。 每个工具都被包装过,因此当锚点缺失时,会返回 {"status": "error", "error_type": "stale_selector", ...},并指明选择器和 URL。如果把 [] 交给 LLM,它会满怀信心地报告“没有找到职位”;这可以让工具故障与真正的空结果区分开来。

测试

uv run pytest

测试覆盖纯解析器——URL/筛选条件构造、卡片解析、个人资料条目解析、行去重——针对的是与 LinkedIn DOM 实际产出形状一致的 fixtures。它们不需要浏览器,也不需要网络。

当它出错时

它一定会出错。LinkedIn 会不断发布标记结构变更,而爬虫本质上是对别人 HTML 的一种猜测。你最终会遇到 stale_selector 错误;修复方法通常是在 tools/jobs.py 或 tools/profiles.py 的选择器列表中再加一项,并在 tests/test_parsers.py 中补充一个 fixture。

如果你遇到返回 auth_required 并带 checkpoint URL 的情况,说明 LinkedIn 需要真人:打开 Chrome 窗口,完成人机验证,然后重试。

关于使用条款

无论实现多么谨慎,自动化访问都违反 LinkedIn 的用户协议,而且 LinkedIn 确实会因此限制账号。这是一个个人研究工具;只读设计和有节奏的请求可以降低风险,但无法消除它,而你所指向的那个账号正是承担这一风险的账号。请自行判断。

许可证

Apache-2.0

Available Tools

5 tools
linkedin_check_sessionA

Check whether the browser is signed in to LinkedIn.

Every other tool needs this to be true; LinkedIn serves a login wall to anonymous visitors on job listings and profiles alike.

NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must carry the behavioral burden. It states the check itself but does not explicitly confirm it is non-mutating or describe the return format. The login-wall context implies safety, but the description lacks explicit boundary details. It does not contradict anything, but could be more transparent about side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no filler. The purpose is stated first, and the second sentence adds valuable context about why this tool matters. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameterless check with no output schema, the description fully covers what an agent needs: what the tool does and why it's important before other tools. It is complete and self-sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the schema is already complete (100% coverage). Baseline is 4. The description adds no parameter information, which is appropriate since there are none to document.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states a specific verb ('check') and resource ('whether the browser is signed in to LinkedIn'). The description distinguishes it from sibling tools by its unique purpose—session verification—and adds context about the login wall, making it unambiguous what this tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states that 'every other tool needs this to be true,' implying it should be called before other LinkedIn operations. This provides clear usage context. It does not list exclusions or alternatives, but given its singular nature, the guidance is sufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

linkedin_close_sessionA

Disconnect from the browser and free resources.

This detaches from Chrome; it leaves the window and the saved session alone.

NameRequiredDescriptionDefault

No parameters

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It transparently discloses the key side effect: it does NOT close the window or the saved session, and it indicates resource freeing. This goes beyond a simple 'close session' and prevents the agent from assuming destructive behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with zero waste. The core action is front-loaded, and the clarifying sentence adds essential side-effect information without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameterless tool with no output schema, the description is sufficient. It covers what it does and what it doesn't do. One could add typical usage timing (e.g., 'call at end of session'), but that is minor and not strictly necessary for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are zero parameters, so schema coverage is trivially 100%. The description adds no parameter meaning because none exist; per rubric, a baseline of 4 is appropriate for a parameterless tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Disconnect from the browser and free resources.' It further clarifies by specifying it detaches from Chrome and leaves the window and saved session intact, distinguishing it clearly from the search/get/check siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives no explicit when-to-use or when-not-to-use guidance. It does not mention that it should be used after other LinkedIn operations or contrast itself with linkedin_check_session. The implication is present but not stated, leaving the agent to infer usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

linkedin_get_jobA

Get the full detail for one job posting.

Returns the title, company, location, posted age, LinkedIn's job insights (seniority, employment type, headcount) and the complete job description with the "See more" clamp expanded.

NameRequiredDescriptionDefault
jobYesJob id, or a /jobs/view/<id> LinkedIn URL

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must bear the burden. It discloses the output content, including the 'See more' clamp expansion, which is a concrete behavior. However, it does not mention prerequisites like authentication needs, rate limits, or error behavior. For a read operation, this is acceptable but not exhaustive, so a 3 is appropriate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two efficient sentences. The first states the overall purpose, and the second lists the return fields with the clamp expansion noted. No fluff, front-loaded key info, and every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having no output schema, the description lists the return values in detail, providing adequate information for an agent to know what to expect. It does not cover prerequisites like active sessions (sibling check_session exists) or error cases, but for a simple GET with clear return fields, it is nearly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for the single parameter, already specifying it accepts a job ID or URL. The description itself does not add additional semantics beyond what the schema provides. Baseline 3 is correct given the schema's completeness.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves full details for a single job posting and enumerates the exact fields returned (title, company, location, posted age, insights, complete description). This verb+resource focus distinguishes it from siblings like search, profile, and session tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage: it requires a job ID or URL to retrieve full details. The context is clear that this is for a single job, not searches or profiles, but it does not explicitly mention when not to use it or name alternatives. Still, for a straightforward GET tool, the usage context is unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

linkedin_get_profileA

Read a LinkedIn profile.

Returns name, headline and location, plus the about text, experience history, education and listed skills unless include_sections is false.

Set include_sections to false when you only need to confirm who someone is; it is one page load either way but a much smaller result.

NameRequiredDescriptionDefault
profileYesProfile slug, e.g. 'satyanadella', or a full /in/<slug> URL
include_sectionsNoInclude about, experience, education and skills

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It transparently discloses the return content and the page-load trade-off, but omits any session/auth prerequisite or error behavior. This is partially transparent but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three terse sentences, each earning its place: purpose, returns, and the parameter trade-off. The essential information is front-loaded with zero fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only profile tool with no output schema, the description covers what's returned and the parameter option. It omits explicit session requirements, but sibling tools (check_session/close_session) imply that context, so it's not a critical gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so parameters are documented. The description adds value for include_sections by explaining the decision rule and its result-size impact, and reinforces the profile format. This exceeds the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a clear verb-resource pair ('Read a LinkedIn profile') and then lists the specific fields returned (name, headline, location, about, experience, education, skills). This unambiguously distinguishes it from sibling job-search and session tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The purpose is explicit, and the include_sections guidance gives a concrete conditional ('Set include_sections to false when you only need to confirm who someone is') with a performance trade-off. It doesn't explicitly contrast with siblings, but the domain is distinct enough that this is sufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

linkedin_search_jobsA

Search job listings on LinkedIn.

Returns each listing with title, company, location, workplace type, posted salary where the employer provided one, how long ago it was posted, and the job_id. Pass that job_id to linkedin_get_job for the full description rather than re-searching.

Results are paged 25 at a time, so a large limit means several page loads.

NameRequiredDescriptionDefault
sortNoOrder: 'date' or 'relevance'
limitNoMaximum number of results
job_typeNoOne of: full-time, part-time, contract, temporary, internship, volunteer, other
keywordsYesSearch keywords, e.g. 'machine learning engineer'
locationNoCity, region or country, e.g. 'Bengaluru' or 'India'
easy_applyNoRestrict to Easy Apply listings
workplace_typeNoOne of: on-site, remote, hybrid
experience_levelNoOne of: internship, entry, associate, mid-senior, director, executive
posted_within_daysNoOnly jobs posted within this many days

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses that results are paged 25 at a time and that salary may be absent, but it does not mention authentication/session requirements or rate limits. With no annotations provided, the description carries the full burden, and the existence of linkedin_check_session suggests a session prerequisite that is not mentioned. This is a notable gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is about 100 words, front-loaded with the main purpose, and the second paragraph covers pagination. It avoids redundancy and each sentence contributes value, such as noting the paging limit and the alternative tool. No fluff or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description explains the return fields and pagination, and guides to linkedin_get_job, which covers essential operational details. However, it does not mention prerequisites like an active LinkedIn session (implied by check_session sibling) or error/edge-case behavior. Given the parameter count and no output schema, the description is fairly complete but misses these key operational aspects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema provides 100% description coverage for all 9 parameters, so the schema already documents their meaning. The description does not add additional parameter semantics beyond what the schema offers (e.g., it does not clarify how sort values map to behavior or the exact format of location). Baseline 3 is appropriate given the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches LinkedIn job listings, and explicitly distinguishes itself from the sibling linkedin_get_job by instructing to pass the returned job_id to that tool for full descriptions. This separates purpose from the retrieval sibling without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly tells the agent to use linkedin_get_job for the full description rather than re-searching, which is a clear directive about when to use an alternative. It also implicitly distinguishes from profile/session tools by focusing on job search, so usage context is evident.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv0.1.0
    • First observedlinkedin_check_session
    • First observedlinkedin_close_session
    • First observedlinkedin_get_job
    • First observedlinkedin_get_profile
    • First observedlinkedin_search_jobs

TDQS

A4.3/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: searching jobs, fetching job details, reading profiles, and managing session state. No overlap between the data-access tools and the session-management tools.

Naming Consistency5/5

All five tools follow a consistent 'linkedin_<verb>_<noun>' pattern (search_jobs, get_job, get_profile, check_session, close_session). The naming is uniform and predictable.

Tool Count5/5

Five tools is well within the ideal range for a focused server. Every tool contributes to a clear workflow: session management, job search, job details, and profile lookup.

Completeness4/5

The server covers the core read workflows for LinkedIn jobs and profiles, but lacks profile search or listing capabilities. However, for its stated purpose (searching jobs and reading profiles), the surface is largely complete.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    Enables searching and scraping of LinkedIn for structured data on people, companies, and job listings. It allows AI clients to retrieve detailed profiles, experience, and activity sections using browser automation.
    7
    207
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to search, filter, and extract job listings from LinkedIn using an automated headless browser with semantic AI filtering and deduplication.
    17 npm
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Lets an AI assistant operate LinkedIn through an authenticated browser session, enabling profile management, posting, networking, messaging, job search, and automated applications.
    100
    12 npm
    1
    MIT