MCP领英销售导航
 ](https://www.npmjs.com/package/globodai-mcp-linkedin-sales-navigator)
用于LinkedIn销售导航的MCP服务器 --通过Playwright实现浏览器自动化。
LinkedIn销售导航器不提供公共API。此MCP服务器使用浏览器自动化(Playwright)通过经过身份验证的浏览器会话来控制Sales Navigator。它使AI助手能够搜索潜在客户、查看个人资料、管理列表、发送InMails和导出数据——所有这些都通过标准 模型上下文协议.
⚠️ 重要免责声明
- 此工具需要有效的LinkedIn Sales Navigator订阅
- 浏览器自动化:这是通过控制真实的浏览器来操作的-没有API黑客攻击
- 需要会话:您必须在浏览器实例中登录到LinkedIn
- 速率限制:负责任地使用。LinkedIn可能会限制执行过度自动化的帐户
- 服务条款:在使用自动化工具之前查看LinkedIn的ToS
- 未存储凭据:此工具从不存储或处理LinkedIn密码
特性
| 工具 | 说明 |
|---|---|
linkedin_search_leads | 使用过滤器(职位、公司、地点、行业、资历等)搜索潜在客户 |
linkedin_get_lead_profile | 获取潜在客户的详细个人资料信息 |
linkedin_save_lead | 将潜在客户保存到列表中 |
linkedin_list_lead_lists | 列出所有潜在客户列表 |
linkedin_create_lead_list | 创建新的潜在客户列表 |
linkedin_send_inmail | 发送InMail邮件(附带模拟运行支持) |
linkedin_export_leads | 导出为JSON或CSV格式 |
快速开始
先决条件
- Node.js ≥ 20
- LinkedIn销售导航 具有活动会话的订阅
- 具有活动LinkedIn登录的浏览器(推荐使用Chrome)
安装
npm install globodai-mcp-linkedin-sales-navigator或者克隆并从源代码构建:
git clone https://github.com/globodai-group/mcp-linkedin-sales-navigator.git
cd mcp-linkedin-sales-navigator
npm install
npm run build配置
服务器是通过环境变量配置的:
| 变量 | 默认值 | 描述 |
|---|---|---|
LSN_AUTH_METHOD | cdp | 身份验证方法: cdp, session,或 cookies |
LSN_CDP_ENDPOINT | http://localhost:9222 | Chrome DevTools协议端点 |
LSN_USER_DATA_DIR | -- | Chrome用户数据目录的路径(用于 session 方法) |
LSN_COOKIES_PATH | -- | Cookie JSON文件的路径(用于 cookies 方法) |
LSN_HEADLESS | false | 在无头模式下运行浏览器 |
LSN_VIEWPORT_WIDTH | 1280 | 浏览器视口宽度 |
LSN_VIEWPORT_HEIGHT | 900 | 浏览器视口高度 |
LSN_NAVIGATION_TIMEOUT | 30000 | 导航超时(毫秒) |
LSN_ACTION_TIMEOUT | 10000 | 操作超时(毫秒) |
身份验证方法
1.CDP(Chrome DevTools协议)——推荐
使用活动的LinkedIn会话连接到已运行的Chrome浏览器。
使用远程调试启动Chrome:
# macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--remote-debugging-port=9222
# Linux
google-chrome --remote-debugging-port=9222
# Windows
chrome.exe --remote-debugging-port=9222然后手动登录LinkedIn销售导航。MCP服务器连接到此浏览器。
LSN_AUTH_METHOD=cdp LSN_CDP_ENDPOINT=http://localhost:9222 npx globodai-mcp-linkedin-sales-navigator2.用户数据目录
使用已登录LinkedIn的现有Chrome个人资料:
LSN_AUTH_METHOD=session LSN_USER_DATA_DIR=/path/to/chrome/profile npx globodai-mcp-linkedin-sales-navigator3.基于Cookie
导出您的LinkedIn Cookie并将其作为JSON文件提供:
LSN_AUTH_METHOD=cookies LSN_COOKIES_PATH=/path/to/linkedin-cookies.json npx globodai-mcp-linkedin-sales-navigatorClawdbot/CORTX集成
此MCP服务器旨在与 克劳德博特 浏览器中继:
{
"mcpServers": {
"linkedin-sales-navigator": {
"command": "npx",
"args": ["globodai-mcp-linkedin-sales-navigator"],
"env": {
"LSN_AUTH_METHOD": "cdp",
"LSN_CDP_ENDPOINT": "http://localhost:9222"
}
}
}
}使用Clawdbot的浏览器中继时,AI助手可以直接控制您登录Sales Navigator的浏览器选项卡,无需额外设置。
工具示例
搜索潜在客户
{
"tool": "linkedin_search_leads",
"arguments": {
"title": "VP of Engineering",
"location": "San Francisco Bay Area",
"companySize": "201-500",
"industry": "Computer Software"
}
}获取潜在客户的个人资料
{
"tool": "linkedin_get_lead_profile",
"arguments": {
"profileUrl": "https://www.linkedin.com/sales/lead/ACwAAAxxxxxx"
}
}发送InMail(带模拟)
{
"tool": "linkedin_send_inmail",
"arguments": {
"profileUrl": "https://www.linkedin.com/sales/lead/ACwAAAxxxxxx",
"subject": "Quick question about your team",
"body": "Hi, I noticed your team is growing...",
"dryRun": true
}
}导出导致CSV
{
"tool": "linkedin_export_leads",
"arguments": {
"source": "current_search",
"format": "csv",
"limit": 50
}
}建筑
┌─────────────────────────────────────────────────┐
│ AI Assistant (Claude, GPT, etc.) │
│ ↕ MCP Protocol (stdio) │
├─────────────────────────────────────────────────┤
│ MCP Server (this package) │
│ ├── Tools (search, leads, inmails, lists, etc.)│
│ ├── Browser Controller (Playwright) │
│ └── Selectors & Auth │
├─────────────────────────────────────────────────┤
│ Playwright → Chromium / Chrome │
│ ↕ CDP or Direct │
├─────────────────────────────────────────────────┤
│ LinkedIn Sales Navigator (web app) │
└─────────────────────────────────────────────────┘发展
# Install dependencies
npm install
# Install Playwright browsers
npx playwright install chromium
# Development mode (watch)
npm run dev
# Build
npm run build
# Lint
npm run lint
# Type check
npm run typecheck选择器维护
LinkedIn会定期更新其DOM结构。如果工具停止工作:
- 在Chrome DevTools中打开销售导航器
- 检查更换的元件
- 更新选择器
src/browser/selectors.ts - 提交带有更新选择器的PR
许可证
麻省理工学院——见 许可证
免责声明
本项目不隶属于领英公司,也不由领英公司背书或赞助。LinkedIn和Sales Navigator是LinkedIn公司的商标。负责任地使用此工具,并遵守LinkedIn的服务条款。
