MCP HubMCP Hub
fredericbarthelet

linkedin-mcp-server

by: fredericbarthelet

An MCP Server for Linkedin API

25created 13/03/2025
Visit
LinkedIn
API

📌Overview

Purpose: To provide a server framework for interfacing with the LinkedIn Community Management API through the Model Context Protocol (MCP).

Overview: The LinkedIn MCP Server facilitates the integration with LinkedIn's Community Management API, allowing developers to manage community interactions easily. It supports both local and remote hosting options and implements a third-party authorization flow based on MVP specifications.

Key Features:

  • User Info Retrieval: Enables fetching details of the currently logged-in user, including name, headline, and profile picture to enhance user experience and provide personalized content.

  • Post Creation: Allows users to create new posts on LinkedIn, facilitating engagement and content sharing within communities.


LinkedIn MCP Server

MCP server for interacting with the LinkedIn Community Management API.

Overview

This MCP server can be hosted locally or remotely and uses the HTTP+SSE transport method defined in MCP. It implements the draft Third-Party Authorization Flow from MCP specifications to delegate authorization to LinkedIn's OAuth authorization server.

Disclaimer: The Third-Party Authorization Flow proposal status is currently in draft.

Features

  • user-info: Get current logged-in user information (name, headline, and profile picture).
  • create-post: Create a new post on LinkedIn.

Installation

To run the LinkedIn MCP server, follow these instructions. You will need to provide your own LinkedIn client.

Requirements

  • Node 22 (lts/jod)
  • pnpm 10
  • A LinkedIn client with the Community Management API product installed and http://localhost:3001/callback added to the authorized redirect URLs.

Instructions

  1. Install dependencies:

    pnpm install
    
  2. Create an .env file and populate it with your LinkedIn client credentials and a random string for JWT_SECRET:

    cp .env.template .env && vi .env
    
  3. Run the server:

    pnpm run dev
    
  4. Configure your MCP client to use this new server:

    {
      "mcpServers": {
        "linkedin": {
          "url": "http://localhost:3001/sse"
        }
      }
    }
    

Debugging

To debug this server, start the MCP Inspector, which is available as a package script:

pnpm run inspector

Access the inspector in your browser at http://localhost:5173.

Acknowledgments

  • Den Delimarsky for his contributions to the new authorization flow with Microsoft Entra ID.
  • Matt Pocock for his TypeScript insights related to creating an MCP server.