# LinkedIn MCP Server - AI Assistant (`alizarin_refrigerator-owner/linkedin-mcp-server`) Actor

Model Context Protocol server for LinkedIn automation. Enable AI assistants to search profiles, send messages & manage connections programmatically.

- **URL**: https://apify.com/alizarin\_refrigerator-owner/linkedin-mcp-server.md
- **Developed by:** [John Rippy](https://apify.com/alizarin_refrigerator-owner) (community)
- **Categories:** AI, Agents, MCP servers
- **Stats:** 1 total users, 1 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## LinkedIn MCP Server

> **"Let AI Assistants Work With LinkedIn"** by [John Rippy](https://www.linkedin.com/in/johnrippy/) | [johnrippy.link](https://johnrippy.link/)

---

### AI-Powered LinkedIn Automation Through MCP

**Model Context Protocol (MCP)** is an open standard that lets AI assistants like Claude use external tools. This server exposes LinkedIn functionality to your AI assistant.

**What can you do with this?**

- Scrape LinkedIn profiles and posts through natural conversation
- Train AI voice models on writing styles
- Generate content that matches someone's voice
- Analyze post performance and suggest topics
- Search for people and companies

**Talk to Claude. Let Claude talk to LinkedIn.**

---

### What is MCP?

MCP (Model Context Protocol) is a standardized way for AI assistants to use external tools. Instead of copying and pasting data, you can just ask Claude:

> "Analyze my LinkedIn profile and tell me what topics I should write about"

Claude uses this MCP server to scrape your profile, analyze your posts, and give you actionable recommendations.

---

### Available Tools

#### Profile Tools

| Tool | Description |
|------|-------------|
| `scrape_profile` | Get full LinkedIn profile (name, headline, about, experience, posts) |
| `scrape_posts` | Scrape posts from a profile or by hashtag/keyword search |

#### Voice Training Tools

| Tool | Description |
|------|-------------|
| `analyze_voice` | Analyze writing style, tone, hooks, CTAs, and vocabulary |
| `generate_post` | Generate new posts matching a trained voice profile |
| `improve_draft` | Improve your draft to better match a voice profile |

#### Content Tools

| Tool | Description |
|------|-------------|
| `suggest_topics` | Get topic suggestions based on voice profile and trends |
| `analyze_performance` | Analyze engagement metrics and patterns from posts |

#### Search Tools

| Tool | Description |
|------|-------------|
| `search_people` | Search LinkedIn profiles by keywords, company, location |

---

### Quick Start Examples

#### Example 1: Scrape a Profile

```json
{
  "mode": "demo",
  "tool": "scrape_profile",
  "profileUrl": "https://www.linkedin.com/in/johnrippy/",
  "maxPosts": 20
}
````

#### Example 2: Analyze Voice Style

```json
{
  "mode": "demo",
  "tool": "analyze_voice",
  "profileUrl": "https://www.linkedin.com/in/johnrippy/",
  "saveProfile": true,
  "profileName": "johnrippy-voice"
}
```

#### Example 3: Generate a Post in Someone's Voice

```json
{
  "mode": "demo",
  "tool": "generate_post",
  "voiceProfileId": "johnrippy-voice",
  "topic": "Why I stopped checking email first thing in the morning",
  "contentType": "text",
  "includeHashtags": true
}
```

#### Example 4: Improve a Draft

```json
{
  "mode": "demo",
  "tool": "improve_draft",
  "voiceProfileId": "johnrippy-voice",
  "draft": "Here are my thoughts on productivity...",
  "feedback": "Make it more engaging with a stronger hook"
}
```

***

### Setup with Claude Desktop

#### Option 1: Using Apify (Cloud)

Add to your Claude Desktop config (`~/.config/claude/claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "linkedin": {
      "command": "npx",
      "args": ["-y", "@anthropic-ai/model-context-protocol", "run", "apify-actor", "localhowl/linkedin-mcp-server"],
      "env": {
        "APIFY_TOKEN": "your-apify-token"
      }
    }
  }
}
```

#### Option 2: Running Locally

```json
{
  "mcpServers": {
    "linkedin": {
      "command": "node",
      "args": ["/path/to/linkedin-mcp-server/dist/main.js"],
      "env": {
        "LINKEDIN_COOKIES": "[...]",
        "ANTHROPIC_API_KEY": "sk-ant-..."
      }
    }
  }
}
```

***

### Authentication

LinkedIn scraping requires authentication. Provide one of:

| Method | Description |
|--------|-------------|
| **Cookies** (recommended) | Export your LinkedIn session cookies as JSON |
| **Email/Password** | LinkedIn credentials for automated login |

For AI features (voice training, post generation), provide:

- **Claude API key** (recommended)
- **OpenAI API key** (alternative)

***

### Example Conversation with Claude

```
User: Can you analyze my LinkedIn voice and suggest some post topics?

Claude: I'll analyze your LinkedIn profile to understand your writing style.
[Uses scrape_posts tool]
[Uses analyze_voice tool]

Based on your posts, here's your voice profile:
- Tone: Professional but conversational
- Hooks: You often start with contrarian statements
- CTAs: You typically end with questions
- Signature phrases: "Here's the thing", "unpopular opinion"

Let me suggest some topics that match your style:
[Uses suggest_topics tool]

Here are 5 topic ideas:
1. "Why I stopped optimizing for likes" - matches your contrarian style
2. "The 5-minute habit that changed my morning" - fits your list format
3. "What nobody tells you about growing on LinkedIn"
4. "I deleted my content calendar. Here's what happened."
5. "The best career advice I ever ignored"

Want me to draft one of these?
```

***

### Pay-Per-Event Pricing

**You only pay for what you use.**

| Event | Description | Price |
|-------|-------------|-------|
| `profile_scraped` | Profile data extracted | $0.01 |
| `posts_scraped` | Per batch of posts | $0.01-0.05 |
| `voice_analyzed` | Voice profile created | $0.02 |
| `post_generated` | Content generated | $0.01 |

#### Cost Examples

| Task | Estimated Cost |
|------|---------------|
| Scrape profile with 20 posts | ~$0.02 |
| Analyze voice profile | ~$0.02 |
| Generate 5 post drafts | ~$0.05 |
| Full content strategy session | ~$0.15 |

***

### Use Cases

#### Personal Branding

- **Voice consistency**: Maintain your unique voice across all posts
- **Content ideation**: Get topic suggestions based on your style
- **Draft improvement**: Polish drafts to match your voice

#### Ghostwriting

- **Client voice training**: Learn a client's writing style
- **Authentic content**: Generate posts that sound like them
- **Quality control**: Ensure drafts match the trained voice

#### Content Agencies

- **Scale content creation**: Generate drafts for multiple clients
- **Consistency**: Maintain unique voices across accounts
- **Research**: Analyze competitor content strategies

#### Lead Generation

- **Profile research**: Gather info on prospects
- **Connection outreach**: Research before connecting
- **Content targeting**: Find people engaging with relevant topics

***

### API Integration

#### Using the Apify API (JavaScript)

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('localhowl/linkedin-mcp-server').call({
  mode: 'demo',
  tool: 'analyze_voice',
  profileUrl: 'https://www.linkedin.com/in/johnrippy/'
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0]);
```

#### Using cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/localhowl~linkedin-mcp-server/runs?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "demo",
    "tool": "scrape_profile",
    "profileUrl": "https://www.linkedin.com/in/johnrippy/"
  }'
```

***

### Voice Profile Output

When you run `analyze_voice`, you get:

```json
{
  "voiceProfileId": "johnrippy-voice",
  "profileUrl": "https://www.linkedin.com/in/johnrippy/",
  "postsAnalyzed": 20,
  "profile": {
    "tone": "Professional but conversational",
    "formality": 0.6,
    "hookStyles": [
      "Contrarian statements",
      "Personal stories",
      "Numbers/statistics"
    ],
    "ctaStyles": [
      "Questions to audience",
      "Call to connect",
      "Share your experience"
    ],
    "signaturePhrases": [
      "Here's the thing",
      "Unpopular opinion",
      "Let me explain"
    ],
    "topicCategories": [
      "Career advice",
      "Productivity",
      "LinkedIn growth"
    ],
    "postLength": {
      "average": 850,
      "min": 400,
      "max": 1200
    },
    "hashtagUsage": {
      "average": 3,
      "common": ["#productivity", "#career", "#growth"]
    }
  }
}
```

***

### Limitations

- **LinkedIn TOS**: Use responsibly, respect rate limits
- **Cookie expiry**: LinkedIn cookies expire; refresh periodically
- **AI accuracy**: Generated content should be reviewed before posting
- **Profile access**: Can only scrape public profiles or connections

***

### Support

- **Email**: john@johnrippy.link
- **GitHub**: Report issues on the repository

***

**Built by [John Rippy](https://www.linkedin.com/in/johnrippy/)** | [johnrippy.link](https://johnrippy.link/)

***

### Keywords

linkedin mcp server, model context protocol, claude linkedin, ai linkedin integration, linkedin profile scraper, linkedin voice trainer, linkedin post generator, mcp tools, claude desktop, ai assistant tools, linkedin automation, content generation, ghostwriting ai, personal branding ai

# Actor input Schema

## `mode` (type: `string`):

How to run the MCP Server

## `linkedinCookies` (type: `string`):

JSON array of LinkedIn cookies for authenticated scraping. Export from browser using a cookie export extension.

## `linkedinEmail` (type: `string`):

LinkedIn login email (alternative to cookies)

## `linkedinPassword` (type: `string`):

LinkedIn login password (alternative to cookies)

## `claudeApiKey` (type: `string`):

Anthropic API key for AI-powered features (voice training, post generation)

## `openaiApiKey` (type: `string`):

OpenAI API key (alternative to Claude for AI features)

## `proxyConfiguration` (type: `object`):

Proxy settings for LinkedIn scraping

## `demoMode` (type: `boolean`):

Return sample data without making real API calls

## Actor input object example

```json
{
  "mode": "stdio",
  "demoMode": false
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("alizarin_refrigerator-owner/linkedin-mcp-server").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("alizarin_refrigerator-owner/linkedin-mcp-server").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call alizarin_refrigerator-owner/linkedin-mcp-server --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=alizarin_refrigerator-owner/linkedin-mcp-server",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "LinkedIn MCP Server - AI Assistant",
        "description": "Model Context Protocol server for LinkedIn automation. Enable AI assistants to search profiles, send messages & manage connections programmatically.",
        "version": "1.0",
        "x-build-id": "rhfxwUdDHoY2MGZ5q"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/alizarin_refrigerator-owner~linkedin-mcp-server/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-alizarin_refrigerator-owner-linkedin-mcp-server",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/alizarin_refrigerator-owner~linkedin-mcp-server/runs": {
            "post": {
                "operationId": "runs-sync-alizarin_refrigerator-owner-linkedin-mcp-server",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/alizarin_refrigerator-owner~linkedin-mcp-server/run-sync": {
            "post": {
                "operationId": "run-sync-alizarin_refrigerator-owner-linkedin-mcp-server",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "stdio",
                            "http",
                            "demo"
                        ],
                        "type": "string",
                        "description": "How to run the MCP Server",
                        "default": "stdio"
                    },
                    "linkedinCookies": {
                        "title": "LinkedIn Cookies",
                        "type": "string",
                        "description": "JSON array of LinkedIn cookies for authenticated scraping. Export from browser using a cookie export extension."
                    },
                    "linkedinEmail": {
                        "title": "LinkedIn Email",
                        "type": "string",
                        "description": "LinkedIn login email (alternative to cookies)"
                    },
                    "linkedinPassword": {
                        "title": "LinkedIn Password",
                        "type": "string",
                        "description": "LinkedIn login password (alternative to cookies)"
                    },
                    "claudeApiKey": {
                        "title": "Claude API Key",
                        "type": "string",
                        "description": "Anthropic API key for AI-powered features (voice training, post generation)"
                    },
                    "openaiApiKey": {
                        "title": "OpenAI API Key",
                        "type": "string",
                        "description": "OpenAI API key (alternative to Claude for AI features)"
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Proxy settings for LinkedIn scraping"
                    },
                    "demoMode": {
                        "title": "Demo Mode",
                        "type": "boolean",
                        "description": "Return sample data without making real API calls",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
