LinkedIn 浏览器 MCP 服务器
基于 FastMCP 的 LinkedIn 自动化服务器,使用浏览器自动化功能进行数据提取。该服务器提供了一套工具,用于以编程方式与 LinkedIn 交互,同时遵守 LinkedIn 的服务条款和速率限制。
特征
安全认证
基于环境的凭证管理
通过加密的 cookie 存储实现会话持久性
速率限制保护
自动会话恢复
配置文件操作
查看并提取个人资料信息
根据关键字搜索个人资料
浏览 LinkedIn 动态
个人资料访问功能
帖子互动
点赞帖子
对帖子进行评论
阅读帖子内容和参与度指标
Related MCP server: LinkedIn Profile Scraper MCP Server
先决条件
Python 3.8+
剧作家
FastMCP 库
LinkedIn 帐户
安装
克隆存储库:
git clone [repository-url]
cd mcp-linkedin-server创建并激活虚拟环境:
python -m venv env
source env/bin/activate # On Windows: env\Scripts\activate安装依赖项:
pip install -r requirements.txt
playwright install chromium设置环境变量:在根目录中创建一个
.env文件:
LINKEDIN_USERNAME=your_email@example.com
LINKEDIN_PASSWORD=your_password
COOKIE_ENCRYPTION_KEY=your_encryption_key # Optional: will be auto-generated if not provided用法
启动 MCP 服务器:
python linkedin_browser_mcp.py可用工具:
login_linkedin_secure:使用环境凭证安全登录browse_linkedin_feed:浏览并提取feed中的帖子search_linkedin_profiles:搜索符合条件的个人资料view_linkedin_profile:查看并提取特定个人资料的数据interact_with_linkedin_post:点赞、评论或阅读帖子
示例用法
from fastmcp import FastMCP
# Initialize client
client = FastMCP.connect("http://localhost:8000")
# Login
result = await client.login_linkedin_secure()
print(result)
# Search profiles
profiles = await client.search_linkedin_profiles(
query="software engineer",
count=5
)
print(profiles)
# View profile
profile_data = await client.view_linkedin_profile(
profile_url="https://www.linkedin.com/in/username"
)
print(profile_data)安全功能
加密的cookie存储
速率限制保护
安全凭证管理
会话持久性
浏览器自动化安全措施
最佳实践
速率限制:服务器实施速率限制以防止过多的请求:
每小时最多登录尝试 5 次
自动会话重用
Cookie 持久化以最大程度减少登录需求
错误处理:全面的错误处理:
网络问题
身份验证失败
LinkedIn 安全挑战
无效的 URL 或参数
会话管理:
自动 Cookie 加密
会话持久性
安全存储实践
贡献
分叉存储库
创建功能分支
提交你的更改
推送到分支
创建拉取请求
执照
麻省理工学院
免责声明
此工具仅供教育用途。使用此软件时,请确保遵守 LinkedIn 的服务条款和速率限制准则。
This server cannot be installed
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to authenticate as an admin.