linkedin-mcp-server-ts
LinkedIn MCP Server (TypeScript / Bun)
免责声明: 这是一个由社区驱动的独立开源项目。它不隶属于 LinkedIn 公司或微软公司,也未经其赞助、授权或认可。“LinkedIn”是 LinkedIn 公司的注册商标,此处仅作描述性使用。
一个极速、轻量的 Model Context Protocol (MCP) 服务器,用于 LinkedIn 自动化和数据抓取,使用 TypeScript 重写,并由 Bun 运行时驱动。
它为 AI 助手(如 Claude Desktop、Cursor、OpenCode、VS Code 和 Windsurf/Antigravity)提供 19 个生产级 MCP 工具,以便浏览个人资料、搜索职位和公司、与消息交互,并使用你已认证的浏览器会话提取信息流。
⚡ 为什么选择 TypeScript + Bun?
linkedin-mcp-server-ts 是 stickerdaniel/linkedin-mcp-server 的原生 TypeScript/Bun 移植版本,旨在实现最高效率并占用最小的资源:
🚀 即时启动与近乎零开销:Bun 的原生 JIT 和快速的包执行消除了冷启动延迟。
🌐 原生 WebView 与直接 CDP 引擎:通过直接 Chrome DevTools Protocol (CDP) 和
Bun.WebView自动化 Chromium,无需笨重的外部浏览器守护进程层。🔄 100% 契约与模式一致性:与 Python MCP 服务器工具、模式和返回格式完全 1:1 即插即用替代。
🔑 无缝会话共享:与标准的
~/.linkedin-mcp/profile会话存储和 cookie 格式 100% 兼容。
架构对比
特性 | Python 版本( | TypeScript / Bun 版本( |
运行时 | Python 3.10+( | Bun 1.2+( |
语言 | Python( | TypeScript 6( |
浏览器引擎 | Patchright Chromium 分支 | 原生 |
内存 / 占用 | 中等(约 150MB+ 运行时) | 超轻量(约 30-60MB 基准) |
传输方式 |
|
|
会话目录 |
|
|
验证 | Pydantic | Zod 模式 |
工具数量 | 19 个工具 | 19 个工具 |
🛠️ MCP 工具概览(19 个工具)
工具 | 类别 | 描述 | 访问类型 |
| 人脉 | 提取个人资料的详细信息,包含细分的板块(经历、教育背景、技能、项目、证书、动态等) | 只读 |
| 人脉 | 提取当前登录用户的个人资料 | 只读 |
| 人脉 | 按关键词、地点、人脉度数( | 只读 |
| 人脉 | 发送连接请求或接受邀请,并可附带个性化的备注 | 写入 / 操作 |
| 人脉 | 提取侧边栏推荐的个人资料链接(“你可能认识的人”、“更多资料”) | 只读 |
| 公司 | 提取公司详细信息、关于我们、动态、职位以及公司 URN 数字 ID | 只读 |
| 公司 | 获取公司最近的信息流动态 | 只读 |
| 公司 | 按关键词搜索公司 | 只读 |
| 公司 | 从 | 只读 |
| 职位 | 获取特定职位发布的完整详情和描述 | 只读 |
| 职位 | 按筛选条件搜索职位:关键词、地点、发布日期、职位类型、工作性质、经验级别、便捷申请 | 只读 |
| 职位 | 获取当前登录用户保存的职位列表 | 只读 |
| 消息 | 列出消息收件箱中的最近会话线程 | 只读 |
| 消息 | 按用户名或 | 只读 |
| 消息 | 按关键词搜索消息会话 | 只读 |
| 消息 | 发送 LinkedIn 私信(需要 | 写入 / 操作 |
| 信息流 | 获取首页时间线上的最近动态 | 只读 |
| 信息流 | 在 LinkedIn 动态中进行全局搜索,支持时间筛选( | 只读 |
| 会话 | 优雅地终止浏览器会话并清理后台资源 | 写入 / 操作 |
🚀 快速开始
前置要求
安装 Bun(v1.2 或更高版本):
# Windows (PowerShell) powershell -c "irm bun.sh/install.ps1 | iex" # macOS / Linux curl -fsSL https://bun.sh/install | bashGoogle Chrome / Chromium:已安装在你的系统上。
单命令执行(bunx)
你可以使用 bunx 直接运行服务器,无需手动安装:
bunx linkedin-mcp-server-ts本地克隆与开发设置
# Clone the repository
git clone https://github.com/joaovjo/linkedin-mcp-server-ts.git
cd linkedin-mcp-server-ts
# Install dependencies
bun install
# Start the server (stdio mode for MCP clients)
bun run start
# Start the HTTP server (for web MCP debugging)
bun run dev💻 MCP 客户端配置
1. Claude Desktop
添加到你的 claude_desktop_config.json:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"linkedin": {
"command": "bunx",
"args": ["linkedin-mcp-server-ts"]
}
}
}或者从本地克隆运行时:
{
"mcpServers": {
"linkedin": {
"command": "bun",
"args": ["run", "src/index.ts"],
"cwd": "D:/linkedin/linkedin-mcp-server-ts"
}
}
}2. Cursor
添加到你的项目 .cursor/mcp.json 或全局 Cursor 设置中:
{
"mcpServers": {
"linkedin": {
"command": "bunx",
"args": ["linkedin-mcp-server-ts"]
}
}
}3. OpenCode
添加到你的 opencode.json(或 ~/.config/opencode/opencode.json):
{
"mcp": {
"linkedin": {
"type": "stdio",
"command": "bunx",
"args": ["linkedin-mcp-server-ts"]
}
}
}4. Antigravity / Windsurf / VS Code(Cline / Roo Code)
添加到 mcp_config.json:
{
"mcpServers": {
"linkedin": {
"command": "bunx",
"args": ["linkedin-mcp-server-ts"],
"disabled": false,
"autoApprove": []
}
}
}5. Streamable HTTP 模式
要通过 HTTP 暴露服务器以供远程代理或容器化环境使用:
bun run src/index.ts --transport streamable-http --host 127.0.0.1 --port 8000端点 URL:http://127.0.0.1:8000/mcp
健康检查:http://127.0.0.1:8000/health
🔐 认证与会话管理
服务器使用存储在 ~/.linkedin-mcp/profile 的持久化浏览器配置文件,因此你只需认证一次。
选项 A:从日常浏览器自动导入(最快)
如果你已经在浏览器(Chrome、Brave、Edge、Arc、Vivaldi)中登录了 LinkedIn,可以立即导入你的会话:
# Auto-detect the most recent browser session
bunx linkedin-mcp-server-ts --import-from-browser
# Or specify a target browser
bunx linkedin-mcp-server-ts --import-from-browser brave
bunx linkedin-mcp-server-ts --import-from-browser chrome
bunx linkedin-mcp-server-ts --import-from-browser edge选项 B:交互式可视化登录
启动一个交互式 Chrome 窗口进行登录:
bunx linkedin-mcp-server-ts --login
# Or from local source:
bun run login将打开一个 Chrome 浏览器窗口,进入 LinkedIn 登录页面。
完成登录(如果提示,包括两步验证 / 验证码)。
服务器检测到成功导航到你的信息流后,会安全地保存你的会话配置文件。
检查会话状态
bunx linkedin-mcp-server-ts --status
# Or from local source:
bun run status退出并清除会话
bunx linkedin-mcp-server-ts --logout
# Or from local source:
bun run logout⚙️ 配置与环境变量
在根目录创建 .env 文件(或传入 CLI 参数)以自定义行为:
变量 | CLI 标志 | 默认值 | 描述 |
|
|
| 持久化浏览器配置文件目录的路径 |
|
|
| 以无头模式运行浏览器 |
|
|
| 传输协议: |
|
|
| HTTP 绑定主机 |
|
|
| HTTP 端口 |
|
|
| HTTP 端点路径 |
|
|
| DOM 导航/交互超时时间(毫秒) |
|
|
| 每个工具的 MCP 执行超时时间(秒) |
|
|
|
|
|
|
| 内联认证回退的等待时间(秒) |
|
|
| 如果不存在配置文件,则自动导入 Cookie |
|
|
| Chrome/Chromium 可执行文件的自定义路径 |
|
|
| 可选的自定义浏览器 User-Agent 覆盖值 |
|
|
| 浏览器视口尺寸( |
|
|
|
|
|
|
| 日志级别( |
🧪 开发、测试与质量
运行契约与单元测试
运行完整测试套件,验证所有 19 个工具、模式校验、链接元数据分类器以及错误处理:
bun test代码检查与格式化
代码风格和格式化由 Biome 强制执行:
# Check code for lint issues
bun run lint
# Auto-fix formatting and linting
bun run lint:fix
# Format files
bun run format项目架构
linkedin-mcp-server-ts/
├── src/
│ ├── index.ts # CLI Entrypoint & Transport routing (stdio / HTTP)
│ ├── config.ts # CLI flags & environment configuration
│ ├── browser/
│ │ ├── auth.ts # Login, logout, status, and browser cookie importer
│ │ ├── cdp.ts # Direct Chrome DevTools Protocol helper functions
│ │ ├── chrome-launch.ts # Process launcher for visual login & remote attach
│ │ ├── manager.ts # Bun.WebView & CDP lifecycle manager
│ │ └── types.ts # Browser status types
│ ├── errors/ # Unified error handling & custom error hierarchy
│ ├── mcp/
│ │ └── create-server.ts # MCP Server registration & tool mounting
│ ├── middleware/ # Concurrency serialization queue
│ ├── scraping/ # DOM extraction, noise removal, link classification & URNs
│ ├── session/ # Cookie storage, profile directories, and persistence
│ ├── tools/ # 19 MCP tool implementations
│ └── utils/ # General helpers
├── tests/ # Bun test suite & contract validations
├── bunfig.toml # Bun configuration & npm publish registry settings
└── package.json # Package metadata, dependencies, and scripts📦 发布到 NPM
本项目使用 bunfig.toml 通过 Bun 直接发布到 npm 仓库:
# Verify typecheck & tests pass
bun test
bun run lint
# Publish public package
bun publish🤝 贡献
欢迎贡献、错误报告和 Pull Request!
在 GitHub 上复刻仓库:
https://github.com/joaovjo/linkedin-mcp-server-ts创建功能分支:
git checkout -b feature/amazing-feature提交你的更改:
git commit -m 'feat: add amazing feature'确保所有测试通过:
bun test && bun run lint推送到分支:
git push origin feature/amazing-feature打开一个 Pull Request。
📄 许可证与致谢
许可证: 根据 MIT License 分发。
致谢: 特别感谢 Daniel Sticker 以及
stickerdaniel/linkedin-mcp-server的贡献者,感谢他们提供的原始 Python 架构、爬虫逻辑和研究。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.
MCP server for LeadDelta — manage LinkedIn connections and CRM data via AI assistants.
Stealth scraping & search. Bypasses Cloudflare, DataDome & LinkedIn via Cyborg HITL approach.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/joaovjo/linkedin-mcp-server-ts'
If you have feedback or need assistance with the MCP directory API, please join our Discord server