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
- Clone the repository:
git clone [repository-url]
cd mcp-linkedin-server
- Create and activate a virtual environment:
python -m venv env
source env/bin/activate # On Windows: envScriptsactivate
- Install dependencies:
pip install -r requirements.txt
playwright install chromium
- Set up environment variables:
Create a
.envfile 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
- Start the MCP server:
python linkedin_browser_mcp.py
- Available Tools:
login_linkedin_secure: Securely log in using environment credentialsbrowse_linkedin_feed: Browse and extract posts from feedsearch_linkedin_profiles: Search for profiles matching criteriaview_linkedin_profile: View and extract data from specific profilesinteract_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
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
Error Handling: Comprehensive error handling for:
- Network issues
- Authentication failures
- LinkedIn security challenges
- Invalid URLs or parameters
Session Management:
- Automatic cookie encryption
- Session persistence
- Secure storage practices
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- 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.
LinkedIn Browser
Project Details
- alinaqi/mcp-linkedin-server
- Last Updated: 4/19/2025
Recomended MCP Servers
mcp server sopos open-api
An MCP server based on OSSInsight.io, providing data analysis for GitHub individuals and repositories, as well as in-depth...
Model Context Protocol (MCP) Server for Mistral OCR API
A Model Context Protocol (MCP) server that provides secure, read-only access to BigQuery datasets. Enables Large Language Models...
A TypeScript Model Context Protocol for Twitter/X platform integration.
MongoDB MCP Server
Model Context Protocol (MCP) implementation for Opik enabling seamless IDE integration and unified access to prompts, projects, traces,...
A Model Context Protocol server for Jira.
Linear MCP Server
大家好!我是功能丰富的 MCP 服务,旨在打破设备与服务的隔阂,为用户带来便捷体验。 天气工具和气象平台联动,快速为用户推送全球实时天气,助力大家规划出行。控制浏览器工具模拟人工操作,自动搜索、浏览网页,大幅节省时间。摄像头工具调用本地摄像头拍照、录像,实现人脸识别,保障家庭安防。 为实现工具协同,我搭建了稳定框架,开发者可以基于现有服务进行拓展





