LinkedIn Data API MCP server

Integrates with LinkedIn Data API to fetch, analyze, and search posts by username, keywords, date ranges, and engagement metrics for social media analysis and content strategy development.
Back to servers
Setup instructions
Provider
Rugved Patil
Release date
Mar 17, 2025
Language
Python
Stats
15 stars

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.

Prerequisites

  • Python 3.7+
  • RapidAPI key for LinkedIn Data API
  • Claude AI access

Installation

Get a RapidAPI Key

  1. Visit LinkedIn Data API on RapidAPI
  2. Sign up or log in to RapidAPI
  3. Subscribe to the LinkedIn Data API
  4. Copy your RapidAPI key from the dashboard

Set Up the MCP Server

  1. Clone the repository:

    git clone https://github.com/rugvedp/linkedin-mcp.git
    cd linkedin-mcp
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Set up environment variables:

    • Create a .env file
    • Add your RapidAPI key:
    RAPIDAPI_KEY=your_rapidapi_key_here
    

MCP Configuration

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.

Available Tools

Fetch and Save LinkedIn Posts

Retrieves and stores LinkedIn posts for a specified username:

fetch_and_save_linkedin_posts(username: str) -> str

Get Saved Posts

Retrieves previously saved posts with pagination:

get_saved_posts(start: int = 0, limit: int = 10) -> dict

Search Posts

Searches through posts for specific keywords:

search_posts(keyword: str) -> dict

Get Top Performing Posts

Returns the most engaging posts based on metrics:

get_top_posts(metric: str = "Like Count", top_n: int = 5) -> dict

Filter Posts by Date

Retrieves posts within a specified date range:

get_posts_by_date(start_date: str, end_date: str) -> dict

Using with Claude

  1. Initialize the MCP server in your conversation with Claude
  2. Use natural language to request actions from the available tools
  3. For example, you might say: "Please fetch the LinkedIn posts for username 'johndoe'"
  4. Claude will execute the appropriate tool and return the results

API Integration Details

This project connects to the LinkedIn Data API with the following endpoint:

  • GET /get-profile-posts: Fetches posts from a LinkedIn profile
    • Base URL: https://linkedin-data-api.p.rapidapi.com
    • Required Headers:
      • x-rapidapi-key: Your RapidAPI key
      • x-rapidapi-host: linkedin-data-api.p.rapidapi.com

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later