基于FastMCP的LinkedIn自动化和数据提取服务器,使用浏览器自动化技术。此服务器提供了一组工具,用于通过编程方式与LinkedIn进行交互,同时遵守LinkedIn的服务条款和速率限制。
安全认证
个人资料操作
帖子互动
git clone [repository-url]
cd mcp-linkedin-server
python -m venv env
source env/bin/activate # 在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 # 可选:如果没有提供,将会自动生成
python linkedin_browser_mcp.py
login_linkedin_secure: 使用环境凭证安全登录browse_linkedin_feed: 浏览并从动态中提取帖子search_linkedin_profiles: 搜索符合标准的个人资料view_linkedin_profile: 查看并从特定个人资料中提取数据interact_with_linkedin_post: 点赞、评论或阅读帖子from fastmcp import FastMCP
# 初始化客户端
client = FastMCP.connect("http://localhost:8000")
# 登录
result = await client.login_linkedin_secure()
print(result)
# 搜索个人资料
profiles = await client.search_linkedin_profiles(
query="软件工程师",
count=5
)
print(profiles)
# 查看个人资料
profile_data = await client.view_linkedin_profile(
profile_url="https://www.linkedin.com/in/用户名"
)
print(profile_data)
速率限制:服务器实现了速率限制以防止过多请求:
错误处理:全面的错误处理包括:
会话管理:
MIT
此工具仅用于教育目的。使用本软件时,请确保遵守LinkedIn的服务条款和速率限制指南。 </中文翻译>