LinkedIn Profile Scraper
Fetches LinkedIn profile information using the Fresh LinkedIn Profile Data API.
LinkedIn Profile Scraper MCP Server
This MCP server uses the Fresh LinkedIn Profile Data API to fetch LinkedIn profile information. It is implemented as a model context protocol (MCP) server and exposes a single tool, get_profile, which accepts a LinkedIn profile URL and returns the profile data in JSON format.
Features
- Fetch Profile Data: Retrieves LinkedIn profile information including skills and other settings (with most additional details disabled).
- Asynchronous HTTP Requests: Uses
httpxfor non-blocking API calls. - Environment-based Configuration: Reads the
RAPIDAPI_KEYfrom your environment variables usingdotenv.
Prerequisites
- Python 3.7+ – Ensure you are using Python version 3.7 or higher.
- MCP Framework: Make sure the MCP framework is installed.
- Required Libraries: Install
httpx,python-dotenv, and other dependencies. - RAPIDAPI_KEY: Obtain an API key from RapidAPI and add it to a
.envfile in your project directory (or set it in your environment).
Installation
-
Clone the Repository:
git clone https://github.com/AIAnytime/Awesome-MCP-Server cd linkedin_profile_scraper -
Install Dependencies:
uv add mcp[cli] httpx requests -
Set Up Environment Variables:
Create a
.envfile in the project directory with the following content:RAPIDAPI_KEY=your_rapidapi_key_here
Running the Server
To run the MCP server, execute:
uv run linkedin.py
The server will start and listen for incoming requests via standard I/O.
MCP Client Configuration
To connect your MCP client to this server, add the following configuration to your config.json. Adjust the paths as necessary for your environment:
{
"mcpServers": {
"linkedin_profile_scraper": {
"command": "C:/Users/aiany/.local/bin/uv",
"args": [
"--directory",
"C:/Users/aiany/OneDrive/Desktop/YT Video/linkedin-mcp/project",
"run",
"linkedin.py"
]
}
}
}
Code Overview
- Environment Setup: The server uses
dotenvto load theRAPIDAPI_KEYrequired to authenticate with the Fresh LinkedIn Profile Data API. - API Call: The asynchronous function
get_linkedin_datamakes a GET request to the API with specified query parameters. - MCP Tool: The
get_profiletool wraps the API call and returns formatted JSON data, or an error message if the call fails. - Server Execution: The MCP server is run with the
stdiotransport.
Troubleshooting
- Missing RAPIDAPI_KEY: If the key is not set, the server will raise a
ValueError. Make sure the key is added to your.envfile or set in your environment. - API Errors: If the API request fails, the tool will return a message indicating that the profile data could not be fetched.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Servidores relacionados
Bright Data
patrocinadorDiscover, extract, and interact with the web - one interface powering automated access across the public internet.
Puppeteer Vision
Scrape webpages and convert them to markdown using Puppeteer. Features AI-driven interaction capabilities.
Web Scraper Service
A Python-based MCP server for headless web scraping. It extracts the main text content from web pages and outputs it as Markdown, text, or HTML.
SearchMCP
Connect any LLM to the internet with the cheapest, most reliable, and developer-friendly search API.
MCP LLMS.txt Explorer
Explore and analyze websites that have implemented the llms.txt standard.
Kakuyomu MCP Server
An MCP server for the Kakuyomu novel posting site, enabling users to search for works, retrieve episode lists, and read content.
Web Scout
A server for web scraping, searching, and analysis using multiple engines and APIs.
Douyin MCP Server
Extract watermark-free video links and copy from Douyin.
Horse Racing News
Fetches horse racing news from the thoroughbreddailynews.com RSS feed.
Playwright MCP
Browser automation using Playwright, enabling LLMs to interact with web pages through structured accessibility snapshots.
ScrapeGraph AI
AI-powered web scraping using the ScrapeGraph AI API. Requires an API key.