LinkedIn Browser MCP Server

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Used for environment-based credential management, allowing secure storage of LinkedIn credentials and encryption keys in a .env file

  • Supports version control for the project, with instructions for cloning the repository as part of the installation process

  • Serves as the underlying runtime environment for the MCP server, requiring Python 3.8+ as a prerequisite

LinkedIn 浏览器 MCP 服务器

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

特征

  • 安全认证
    • 基于环境的凭证管理
    • 通过加密的 cookie 存储实现会话持久性
    • 速率限制保护
    • 自动会话恢复
  • 配置文件操作
    • 查看并提取个人资料信息
    • 根据关键字搜索个人资料
    • 浏览 LinkedIn 动态
    • 个人资料访问功能
  • 帖子互动
    • 点赞帖子
    • 对帖子进行评论
    • 阅读帖子内容和参与度指标

先决条件

  • 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 的服务条款和速率限制准则。

-
security - not tested
F
license - not found
-
quality - not tested

基于 FastMCP 的服务器,可通过浏览器自动化实现 LinkedIn 的编程自动化和数据提取,提供安全的身份验证和用于个人资料操作和发布交互的工具,同时遵守 LinkedIn 的速率限制。

  1. Features
    1. Prerequisites
      1. Installation
        1. Usage
          1. Example Usage
        2. Security Features
          1. Best Practices
            1. Contributing
              1. License
                1. Disclaimer
                  ID: mlkinlqs5h