LinkedIn MCP Server Documentation

by wedlock666

697 downloads Not rated yet
GitHub

About

Model Context Protocol (MCP) server for LinkedIn integration with n8n

Explore

- Profile Management: View and search LinkedIn profiles
- Connection Management: Send connection requests and manage connections
- Messaging: Send messages and read conversations
- Post Interaction: Create, like, comment on, and share posts
- Job Search: Search for jobs, view details, and apply when possible
- MCP Protocol Support: Seamless integration with n8n through the Model Context Protocol

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name LinkedIn MCP Server Documentation
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

- Node.js (v16 or higher)
- npm (v7 or higher)
- A LinkedIn account
- Internet access

1. Clone the repository or download the source code:

git clone https://github.com/yourusername/mcp-linkedin-project.git
cd mcp-linkedin-project

2. Install dependencies:

npm install

3. Create environment configuration:

cp .env.example .env

4. Edit the .env file with your LinkedIn credentials and other settings:

PORT=3000
MCP_SERVER_NAME="LinkedIn MCP Server"
MCP_SERVER_VERSION="0.1.0"

A Dockerfile is provided for containerized deployment:

1. Build the Docker image:

bash
docker build -t linkedin-mcp-server .

2. Run the container:

bash
docker run -p 3000:3000 --env-file .env linkedin-mcp-server

For deployment on Proxmox as an LXC container, refer to the Proxmox Deployment Guide.

| Variable | Description | Default |
|----------|-------------|---------|
| PORT | Server port | 3000 |
| MCP_SERVER_NAME | Server name | "LinkedIn MCP Server" |
| MCP_SERVER_VERSION | Server version | "0.1.0" |
| LINKEDIN_USERNAME | LinkedIn account email/username | - |
| LINKEDIN_PASSWORD | LinkedIn account password | - |
| JWT_SECRET | Secret for JWT token generation | - |
| COOKIE_SECRET | Secret for cookie encryption | - |
| MAX_REQUESTS_PER_HOUR | Rate limit for requests | 50 |
| RATE_LIMIT_WINDOW_MS | Rate limit window in milliseconds | 3600000 |
| HEADLESS | Run browser in headless mode | true |
| USER_AGENT | Browser user agent | Mozilla/5.0... |
| LOG_LEVEL | Logging level | info |
| PROXY_SERVER | Proxy server (optional) | - |
| PROXY_USERNAME | Proxy username (optional) | - |
| PROXY_PASSWORD | Proxy password (optional) | - |
| PROXY_TYPE | Proxy type (http, https, socks5) | http |

The browser service can be configured for different environments:

- Headless Mode: Set HEADLESS=true for server environments or HEADLESS=false for debugging
- User Agent: Customize with USER_AGENT to avoid detection
- Proxy Support: Configure proxy settings for IP rotation and avoiding rate limits

1. In your n8n instance, go to Settings > Community Nodes
2. Install "n8n-nodes-mcp"

1. Add an "MCP Client" node to your workflow
2. Create new credentials:
- Connection Type: HTTP Transport
- Server URL: http://localhost:3000/mcp (adjust for your server)
- Authentication: None (or configure as needed)

To run the server locally:

bash
./start.sh

To deploy using Docker:

bash
docker build -t linkedin-mcp-server .
docker run -p 3000:3000 --env-file .env linkedin-mcp-server

For detailed instructions on deploying as an LXC container on Proxmox, see the Proxmox Deployment Guide.

To run the basic tests:

bash
./test.sh
``

Symptoms:
- "LinkedIn security checkpoint detected" error
- "CAPTCHA detected during login" error

Solutions:
- Verify your LinkedIn credentials in the
.env` file
- Log in to LinkedIn manually in a regular browser to resolve any security checkpoints
- Consider using a proxy to avoid detection
- Reduce the frequency of requests to avoid triggering security measures

Lists available LinkedIn tools.

Request:

{
"jsonrpc": "2.0",
"method": "listTools",
"params": {},
"id": "2"
}

Response:

{
"jsonrpc": "2.0",
"result": {
"tools": [
{
"name": "profile_view",
"description": "View a LinkedIn profile",
"parameters": {
"type": "object",
"properties": {
"profileUrl": {
"type": "string",
"description": "URL of the LinkedIn profile to view"
}
},
"required": ["profileUrl"]
}
},
// Additional tools...
]
},
"id": "2"
}

Executes a LinkedIn tool.

Request:

{
"jsonrpc": "2.0",
"method": "executeTool",
"params": {
"name": "profile_search",
"parameters": {
"keywords": "software engineer",
"location": "San Francisco",
"limit": 5
}
},
"id": "3"
}

Response:

{
"jsonrpc": "2.0",
"result": [
{
"name": "John Doe",
"title": "Senior Software Engineer",
"location": "San Francisco Bay Area",
"profileUrl": "https://www.linkedin.com/in/johndoe"
},
// Additional results...
],
"id": "3"
}

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "linkedin mcp server documentation": {
            "mcp-linkedin-server": {
                "command": "docker",
                "args": [
                    "build",
                    "-t",
                    "linkedin-mcp-server",
                    "."
                ]
            }
        }
    }
}

McpServers

{
    "mcp-linkedin-server": {
        "command": "docker",
        "args": [
            "build",
            "-t",
            "linkedin-mcp-server",
            "."
        ]
    }
}

Table of Contents

1. Introduction
2. Architecture Overview
3. Installation Guide
4. Configuration
5. API Reference
6. LinkedIn Functionality
7. n8n Integration
8. Deployment Guide
9. Testing
10. Troubleshooting
11. Security Considerations
12. Limitations and Compliance

Introduction

The LinkedIn MCP Server is a Model Context Protocol (MCP) implementation that enables integration between n8n and LinkedIn without requiring official API access. It uses web automation techniques with Puppeteer to interact with LinkedIn's web interface, providing functionality for profile management, connections, messaging, posts, and job searching.

Purpose

This server allows you to automate LinkedIn interactions through n8n workflows, enabling various use cases:

- Automated connection management
- Profile data extraction and analysis
- Messaging automation
- Content posting and engagement
- Job search and application processes

Key Features

- Profile Management: View and search LinkedIn profiles
- Connection Management: Send connection requests and manage connections
- Messaging: Send messages and read conversations
- Post Interaction: Create, like, comment on, and share posts
- Job Search: Search for jobs, view details, and apply when possible
- MCP Protocol Support: Seamless integration with n8n through the Model Context Protocol

Architecture Overview

The LinkedIn MCP Server follows a modular architecture designed for maintainability and extensibility:

Core Components

1. MCP Server Core: Implements the JSON-RPC 2.0 based protocol with SSE support
2. LinkedIn Automation Engine: Uses Puppeteer for web automation
3. LinkedIn Functionality Modules: Provides specific LinkedIn features
4. n8n Integration Layer: Connects the MCP server to n8n workflows

Technical Stack

- Node.js: Runtime environment
- Express.js: Web server framework
- Puppeteer: Headless browser automation
- Puppeteer-Extra: Enhanced Puppeteer with stealth capabilities
- Winston: Logging system
- JSON-RPC 2.0: Communication protocol for MCP

Directory Structure

mcp-linkedin-project/
├── src/
│   ├── index.js                  # Main entry point
│   ├── routes/                   # API routes
│   │   └── mcp.js                # MCP protocol routes
│   ├── controllers/              # Business logic
│   │   └── linkedin-controller.js # LinkedIn functionality controller
│   ├── services/                 # Core services
│   │   ├── browser.js            # Puppeteer browser management
│   │   ├── linkedin-auth.js      # LinkedIn authentication
│   │   ├── linkedin-profile.js   # Profile functionality
│   │   ├── linkedin-connection.js # Connection functionality
│   │   ├── linkedin-messaging.js # Messaging functionality
│   │   ├── linkedin-post.js      # Post functionality
│   │   └── linkedin-job.js       # Job functionality
│   ├── models/                   # Data models
│   ├── utils/                    # Utility functions
│   └── config/                   # Configuration files
├── test/                         # Test scripts
│   ├── test-mcp.js               # MCP server tests
│   ├── n8n-webhook-test.js       # n8n webhook simulator
│   └── n8n-workflow-example.js   # Example n8n workflow
├── docs/                         # Documentation
├── .env.example                  # Environment variables template
├── package.json                  # Dependencies and scripts
├── start.sh                      # Server start script
└── test.sh                       # Test runner script

Installation Guide

Prerequisites

- Node.js (v16 or higher)
- npm (v7 or higher)
- A LinkedIn account
- Internet access

Local Installation

1. Clone the repository or download the source code:

git clone https://github.com/yourusername/mcp-linkedin-project.git
cd mcp-linkedin-project

2. Install dependencies:

npm install

3. Create environment configuration:

cp .env.example .env

4. Edit the .env file with your LinkedIn credentials and other settings:

```
PORT=3000
MCP_SERVER_NAME="LinkedIn MCP Server"
MCP_SERVER_VERSION="0.1.0"

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.