Skip to main content
Glama
alinaqi

LinkedIn Browser MCP Server

by alinaqi

LinkedIn 浏览器 MCP 服务器

基于 FastMCP 的 LinkedIn 自动化服务器,使用浏览器自动化功能进行数据提取。该服务器提供了一套工具,用于以编程方式与 LinkedIn 交互,同时遵守 LinkedIn 的服务条款和速率限制。

特征

  • 安全认证

    • 基于环境的凭证管理

    • 通过加密的 cookie 存储实现会话持久性

    • 速率限制保护

    • 自动会话恢复

  • 配置文件操作

    • 查看并提取个人资料信息

    • 根据关键字搜索个人资料

    • 浏览 LinkedIn 动态

    • 个人资料访问功能

  • 帖子互动

    • 点赞帖子

    • 对帖子进行评论

    • 阅读帖子内容和参与度指标

Related MCP server: LinkedIn MCP

先决条件

  • Python 3.8+

  • 剧作家

  • FastMCP 库

  • LinkedIn 帐户

安装

  1. 克隆存储库:

git clone [repository-url]
cd mcp-linkedin-server
  1. 创建并激活虚拟环境:

python -m venv env
source env/bin/activate  # On Windows: env\Scripts\activate
  1. 安装依赖项:

pip install -r requirements.txt
playwright install chromium
  1. 设置环境变量:在根目录中创建一个.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

用法

  1. 启动 MCP 服务器:

python linkedin_browser_mcp.py
  1. 可用工具:

  • 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存储

  • 速率限制保护

  • 安全凭证管理

  • 会话持久性

  • 浏览器自动化安全措施

最佳实践

  1. 速率限制:服务器实施速率限制以防止过多的请求:

    • 每小时最多登录尝试 5 次

    • 自动会话重用

    • Cookie 持久化以最大程度减少登录需求

  2. 错误处理:全面的错误处理:

    • 网络问题

    • 身份验证失败

    • LinkedIn 安全挑战

    • 无效的 URL 或参数

  3. 会话管理:

    • 自动 Cookie 加密

    • 会话持久性

    • 安全存储实践

贡献

  1. 分叉存储库

  2. 创建功能分支

  3. 提交你的更改

  4. 推送到分支

  5. 创建拉取请求

执照

麻省理工学院

免责声明

此工具仅供教育用途。使用此软件时,请确保遵守 LinkedIn 的服务条款和速率限制准则。

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Fully featured MCP server that provides automation tools for LinkedIn, supporting browser-based scraping and API-based operations for content management, media uploads, and reactions.
    6
    3
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server for programmable LinkedIn automation via Playwright, offering 20 tools for profile management, messaging, feed interaction, and job searching through real browser automation.
    12 npm
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Playwright-powered MCP server for LinkedIn that automates jobs, profile edits, messaging, network actions, and feed posts using a real logged-in browser session.
    36
    Apache 2.0
  • F
    license
    A
    quality
    C
    maintenance
    MCP server for automating LinkedIn actions such as reading feeds, sending messages, creating posts, and managing connections. Uses browser automation with proxy and stealth support.
    21
    -