LinkedIn MCP server

Integrates with LinkedIn to enable direct posting of text and media content with customizable visibility settings through OAuth2 authentication and secure token management.
Back to servers
Setup instructions
Provider
Filipp Trigub
Release date
Jan 21, 2025
Language
Python
Stats
4 stars

This MCP server allows you to post text and media directly to LinkedIn from Claude Desktop. The server supports text updates, image and video attachments, control over post visibility, and handles authentication securely.

Installation and Setup

Create a LinkedIn Developer App

Before installing the MCP server, you need to create a LinkedIn Developer App:

  1. Visit https://www.linkedin.com/developers/apps
  2. Create a new app
  3. Add product permissions: "Log In to LinkedIn" and "Share on LinkedIn"
  4. Configure OAuth redirect URL: http://localhost:3000/callback

Install the MCP Server

  1. Install pipx if not already installed:

    pip install pipx
    
  2. Install the LinkedIn MCP server:

    pipx install linkedin-mcp
    

Configure Authentication

Create a .env file with your LinkedIn Developer App credentials:

LINKEDIN_CLIENT_ID=your_client_id
LINKEDIN_CLIENT_SECRET=your_client_secret
LINKEDIN_REDIRECT_URI=http://localhost:3000/callback

Claude Desktop Integration

Add the following configuration to your claude-desktop.json file:

{
  "mcpServers": {
    "linkedin-mcp": {
      "command": "linkedin-mcp",
      "env": {
        "LINKEDIN_CLIENT_ID": "<yours>",
        "LINKEDIN_CLIENT_SECRET": "<yours>",
        "LINKEDIN_REDIRECT_URI": "<yours>"
      }
    }
  }
}

Using the MCP Server

Available Tools

The LinkedIn MCP server provides two main tools:

  • authenticate: Handles the authentication flow with LinkedIn
  • create_post: Creates and shares posts on LinkedIn, with optional media attachments

Authentication

The first time you use the server, you'll need to authenticate with LinkedIn. Claude will guide you through this process when you attempt to use the LinkedIn tools.

Creating Posts

To create a post on LinkedIn, you can instruct Claude to:

  • Post text updates
  • Include images or videos with your posts
  • Control post visibility (public or connections-only)

Examples

For a simple text post:

Can you post this update to LinkedIn: "Excited to share my latest project using Claude Desktop!"

For a post with an image attachment:

Please post this to LinkedIn with the attached image: "Beautiful sunset from my office window today." The image is located at C:\Images\sunset.jpg

For a post with specific visibility settings:

Post this message to LinkedIn for my connections only: "Working on some interesting private projects this week!"

When you want to attach media, simply provide the file path to the media file you want to include with your post, and the server will handle the attachment process.

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-mcp" '{"command":"linkedin-mcp","env":{"LINKEDIN_CLIENT_ID":"<yours>","LINKEDIN_CLIENT_SECRET":"<yours>","LINKEDIN_REDIRECT_URI":"<yours>"}}'

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-mcp": {
            "command": "linkedin-mcp",
            "env": {
                "LINKEDIN_CLIENT_ID": "<yours>",
                "LINKEDIN_CLIENT_SECRET": "<yours>",
                "LINKEDIN_REDIRECT_URI": "<yours>"
            }
        }
    }
}

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-mcp": {
            "command": "linkedin-mcp",
            "env": {
                "LINKEDIN_CLIENT_ID": "<yours>",
                "LINKEDIN_CLIENT_SECRET": "<yours>",
                "LINKEDIN_REDIRECT_URI": "<yours>"
            }
        }
    }
}

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