LinkedIn MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@LinkedIn MCP ServerPost on LinkedIn: Excited to launch our new product!"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LinkedIn MCP Server
Full-stack MCP server that lets your AI agent (batabeto/OpenClaw) control LinkedIn as you — post, comment, like, manage your network.
Architecture
AI Agent (batabeto) ──MCP/HTTP──► LinkedIn MCP Server ──REST──► LinkedIn API
│
OAuth2 + Token Store
│
Dashboard UISetup Guide
1. Create a LinkedIn App
Go to LinkedIn Developers
Click Create App
Fill in: App Name, LinkedIn Page, Logo
Under Auth tab → Add
Authorized redirect URLs:http://YOUR_EC2_IP:3000/auth/callback(or your domain if using nginx)
Under Products tab → Request:
Share on LinkedIn (gives
w_member_socialscope)Sign In with LinkedIn using OpenID Connect (gives
openid profile email)
Copy your Client ID and Client Secret
2. Install & Configure
git clone <your-repo> linkedin-mcp
cd linkedin-mcp
npm install
cp .env.example .env
nano .envFill in .env:
LINKEDIN_CLIENT_ID=your_client_id
LINKEDIN_CLIENT_SECRET=your_client_secret
BASE_URL=http://YOUR_EC2_IP:3000
PORT=3000
MCP_SECRET_KEY=$(openssl rand -hex 32)3. Run the Server
# Production
npm start
# Development (auto-restart)
npm run dev
# As a systemd service (recommended for EC2)
sudo nano /etc/systemd/system/linkedin-mcp.servicesystemd service file:
[Unit]
Description=LinkedIn MCP Server
After=network.target
[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu/linkedin-mcp
ExecStart=/usr/bin/node server.js
Restart=always
RestartSec=5
EnvironmentFile=/home/ubuntu/linkedin-mcp/.env
[Install]
WantedBy=multi-user.targetsudo systemctl enable linkedin-mcp
sudo systemctl start linkedin-mcp
sudo systemctl status linkedin-mcp4. Authenticate LinkedIn
Open:
http://YOUR_EC2_IP:3000Click Connect LinkedIn
Authorize the app on LinkedIn
You'll be redirected back — status shows ✅ Connected
5. Connect to Your AI Agent
For OpenClaw (batabeto):
Add to your agent's MCP config:
{
"mcpServers": {
"linkedin": {
"url": "http://YOUR_EC2_IP:3000/mcp",
"transport": "http",
"headers": {
"Authorization": "Bearer YOUR_MCP_SECRET_KEY"
}
}
}
}For Claude Desktop:
{
"mcpServers": {
"linkedin": {
"command": "npx",
"args": ["mcp-remote", "http://YOUR_EC2_IP:3000/mcp", "--header", "Authorization: Bearer YOUR_MCP_SECRET_KEY"]
}
}
}Available Tools
Tool | Description |
| Get your name, headline, email, photo |
| Post text, articles, links |
| List your recent posts |
| Delete a post by URN |
| Get likes/comments/shares |
| Like any post |
| Comment on a post |
| List your network |
| Search people by keywords |
| Check if authenticated |
Example Agent Prompts
"Post on LinkedIn: Excited to share that I just deployed a full Kubernetes cluster
with ArgoCD GitOps! #DevOps #Kubernetes"
"Get my last 5 LinkedIn posts"
"Delete my LinkedIn post with ID urn:li:ugcPost:1234567890"
"Comment 'Great insight!' on post urn:li:ugcPost:9876543210"
"Check my LinkedIn connection status"API Limitations (LinkedIn)
LinkedIn's public API is restricted. Here's what works vs what doesn't:
Feature | Status | Notes |
Create posts | ✅ Works | Text, articles, links |
Delete posts | ✅ Works | Your posts only |
Like posts | ✅ Works | Any visible post |
Comment | ✅ Works | Any visible post |
Get your posts | ✅ Works | Via UGC Posts API |
Get connections | ⚠️ Needs scope |
|
Search people | ❌ Restricted | Needs Partner API |
Send messages | ❌ Restricted | Needs Partner Program |
Image posts | 🔜 Possible | Needs media upload flow |
Security
The MCP endpoint is protected by
MCP_SECRET_KEY— keep it secretOAuth tokens are stored locally in
data/tokens.json— don't commit this fileLinkedIn tokens expire in 60 days; refresh tokens last 365 days
The server auto-refreshes tokens when < 5 days remain
Open EC2 Port
# In AWS Security Group, allow inbound:
# Port 3000, TCP, from your agent's IP (or 0.0.0.0/0 for testing)Or use nginx to proxy yourdomain.com/mcp → localhost:3000/mcp.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ahmedekramalsada/linkedin-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server