LinkedIn Browser MCP Server

LinkedIn Browser MCP Server

A FastMCP-based server that enables programmatic LinkedIn automation and data extraction through browser automation, offering secure authentication and tools for profile operations and post interactions while respecting LinkedIn's rate limits.

alinaqi

Browser Automation
Social Media
Python
Visit Server

README

LinkedIn Browser MCP Server

A FastMCP-based server for LinkedIn automation and data extraction using browser automation. This server provides a set of tools for interacting with LinkedIn programmatically while respecting LinkedIn's terms of service and rate limits.

Features

  • Secure Authentication

    • Environment-based credential management
    • Session persistence with encrypted cookie storage
    • Rate limiting protection
    • Automatic session recovery
  • Profile Operations

    • View and extract profile information
    • Search for profiles based on keywords
    • Browse LinkedIn feed
    • Profile visiting capabilities
  • Post Interactions

    • Like posts
    • Comment on posts
    • Read post content and engagement metrics

Prerequisites

  • Python 3.8+
  • Playwright
  • FastMCP library
  • LinkedIn account

Installation

  1. Clone the repository:
git clone [repository-url]
cd mcp-linkedin-server
  1. Create and activate a virtual environment:
python -m venv env
source env/bin/activate  # On Windows: env\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
playwright install chromium
  1. Set up environment variables: Create a .env file in the root directory with:
LINKEDIN_USERNAME=your_email@example.com
LINKEDIN_PASSWORD=your_password
COOKIE_ENCRYPTION_KEY=your_encryption_key  # Optional: will be auto-generated if not provided

Usage

  1. Start the MCP server:
python linkedin_browser_mcp.py
  1. Available Tools:
  • login_linkedin_secure: Securely log in using environment credentials
  • browse_linkedin_feed: Browse and extract posts from feed
  • search_linkedin_profiles: Search for profiles matching criteria
  • view_linkedin_profile: View and extract data from specific profiles
  • interact_with_linkedin_post: Like, comment, or read posts

Example Usage

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)

Security Features

  • Encrypted cookie storage
  • Rate limiting protection
  • Secure credential management
  • Session persistence
  • Browser automation security measures

Best Practices

  1. Rate Limiting: The server implements rate limiting to prevent excessive requests:

    • Maximum 5 login attempts per hour
    • Automatic session reuse
    • Cookie persistence to minimize login needs
  2. Error Handling: Comprehensive error handling for:

    • Network issues
    • Authentication failures
    • LinkedIn security challenges
    • Invalid URLs or parameters
  3. Session Management:

    • Automatic cookie encryption
    • Session persistence
    • Secure storage practices

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT

Disclaimer

This tool is for educational purposes only. Ensure compliance with LinkedIn's terms of service and rate limiting guidelines when using this software.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Playwright MCP Server

Playwright MCP Server

Provides a server utilizing Model Context Protocol to enable human-like browser automation with Playwright, allowing control over browser actions such as navigation, element interaction, and scrolling.

Featured
Local
TypeScript
@kazuph/mcp-fetch

@kazuph/mcp-fetch

Model Context Protocol server for fetching web content and processing images. This allows Claude Desktop (or any MCP client) to fetch web content and handle images appropriately.

Featured
Local
JavaScript
DuckDuckGo MCP Server

DuckDuckGo MCP Server

A Model Context Protocol (MCP) server that provides web search capabilities through DuckDuckGo, with additional features for content fetching and parsing.

Featured
Python
YouTube Transcript MCP Server

YouTube Transcript MCP Server

This server retrieves transcripts for given YouTube video URLs, enabling integration with Goose CLI or Goose Desktop for transcript extraction and processing.

Featured
Python
serper-search-scrape-mcp-server

serper-search-scrape-mcp-server

This Serper MCP Server supports search and webpage scraping, and all the most recent parameters introduced by the Serper API, like location.

Featured
TypeScript
The Verge News MCP Server

The Verge News MCP Server

Provides tools to fetch and search news from The Verge's RSS feed, allowing users to get today's news, retrieve random articles from the past week, and search for specific keywords in recent Verge content.

Featured
TypeScript
Tavily MCP Server

Tavily MCP Server

Provides AI-powered web search capabilities using Tavily's search API, enabling LLMs to perform sophisticated web searches, get direct answers to questions, and search recent news articles.

Featured
Python
mcp-pinterest

mcp-pinterest

A Pinterest Model Context Protocol (MCP) server for image search and information retrieval

Featured
TypeScript
@wopal/mcp-server-hotnews

@wopal/mcp-server-hotnews

A Model Context Protocol server that provides real-time hot trending topics from major Chinese social platforms and news sites.

Featured