The LinkedIn Profile Analyzer MCP server interfaces with LinkedIn's API to fetch, analyze, and manage LinkedIn posts data, specifically designed to integrate with Claude AI. It allows you to access and analyze public LinkedIn profiles and their content through a structured interface.
Clone the repository:
git clone https://github.com/rugvedp/linkedin-mcp.git
cd linkedin-mcp
Install dependencies:
pip install -r requirements.txt
Set up environment variables:
.env
fileRAPIDAPI_KEY=your_rapidapi_key_here
Configure the LinkedIn MCP server through the mcp.json
file:
{
"mcpServers": {
"LinkedIn Updated": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"path/to/your/script.py"
]
}
}
}
Make sure to update the path in args
to match your local file location.
Retrieves and stores LinkedIn posts for a specified username:
fetch_and_save_linkedin_posts(username: str) -> str
Retrieves previously saved posts with pagination:
get_saved_posts(start: int = 0, limit: int = 10) -> dict
Searches through posts for specific keywords:
search_posts(keyword: str) -> dict
Returns the most engaging posts based on metrics:
get_top_posts(metric: str = "Like Count", top_n: int = 5) -> dict
Retrieves posts within a specified date range:
get_posts_by_date(start_date: str, end_date: str) -> dict
This project connects to the LinkedIn Data API with the following endpoint:
GET /get-profile-posts
: Fetches posts from a LinkedIn profile
https://linkedin-data-api.p.rapidapi.com
x-rapidapi-key
: Your RapidAPI keyx-rapidapi-host
: linkedin-data-api.p.rapidapi.com
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "LinkedIn-Updated" '{"command":"uv","args":["run","--with","mcp[cli]","mcp","run","path/to/your/script.py"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"LinkedIn Updated": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"path/to/your/script.py"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"LinkedIn Updated": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"path/to/your/script.py"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect