LinkedIn MCP Server
LinkedIn MCPサーバー
AIエージェント(batabeto/OpenClaw)があなたになり代わってLinkedInを操作(投稿、コメント、いいね、ネットワーク管理)できるようにするフルスタックMCPサーバーです。
アーキテクチャ
AI Agent (batabeto) ──MCP/HTTP──► LinkedIn MCP Server ──REST──► LinkedIn API
│
OAuth2 + Token Store
│
Dashboard UIRelated MCP server: LinkedIn MCP Server
セットアップガイド
1. LinkedInアプリの作成
LinkedIn Developers にアクセスします
Create App をクリックします
アプリ名、LinkedInページ、ロゴを入力します
Auth タブで
Authorized redirect URLsを追加します:http://YOUR_EC2_IP:3000/auth/callback(nginxを使用している場合は、ご自身のドメインを指定してください)
Products タブで以下をリクエストします:
Share on LinkedIn (
w_member_socialスコープが付与されます)Sign In with LinkedIn using OpenID Connect (
openid profile emailスコープが付与されます)
Client ID と Client Secret をコピーします
2. インストールと設定
git clone <your-repo> linkedin-mcp
cd linkedin-mcp
npm install
cp .env.example .env
nano .env.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. サーバーの実行
# Production
npm start
# Development (auto-restart)
npm run dev
# As a systemd service (recommended for EC2)
sudo nano /etc/systemd/system/linkedin-mcp.servicesystemdサービスファイル:
[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. LinkedInの認証
http://YOUR_EC2_IP:3000を開きますConnect LinkedIn をクリックします
LinkedIn上でアプリを承認します
リダイレクトされ、ステータスが ✅ Connected と表示されます
5. AIエージェントへの接続
OpenClaw (batabeto) の場合:
エージェントのMCP設定に追加します:
{
"mcpServers": {
"linkedin": {
"url": "http://YOUR_EC2_IP:3000/mcp",
"transport": "http",
"headers": {
"Authorization": "Bearer YOUR_MCP_SECRET_KEY"
}
}
}
}Claude Desktop の場合:
{
"mcpServers": {
"linkedin": {
"command": "npx",
"args": ["mcp-remote", "http://YOUR_EC2_IP:3000/mcp", "--header", "Authorization: Bearer YOUR_MCP_SECRET_KEY"]
}
}
}利用可能なツール
ツール | 説明 |
| 名前、見出し、メールアドレス、写真を取得 |
| テキスト、記事、リンクを投稿 |
| 最近の投稿を一覧表示 |
| URNで投稿を削除 |
| いいね/コメント/シェア数を取得 |
| 投稿に「いいね」をする |
| 投稿にコメントする |
| ネットワークを一覧表示 |
| キーワードで人物を検索 |
| 認証状態を確認 |
エージェントへのプロンプト例
"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の制限事項 (LinkedIn)
LinkedInのパブリックAPIには制限があります。動作するものとしないものは以下の通りです:
機能 | ステータス | 備考 |
投稿の作成 | ✅ 動作 | テキスト、記事、リンク |
投稿の削除 | ✅ 動作 | 自分の投稿のみ |
投稿へのいいね | ✅ 動作 | 表示可能なすべての投稿 |
コメント | ✅ 動作 | 表示可能なすべての投稿 |
自分の投稿の取得 | ✅ 動作 | UGC Posts API経由 |
コネクションの取得 | ⚠️ スコープ要 |
|
人物の検索 | ❌ 制限あり | パートナーAPIが必要 |
メッセージ送信 | ❌ 制限あり | パートナープログラムが必要 |
画像投稿 | 🔜 対応予定 | メディアアップロードフローが必要 |
セキュリティ
MCPエンドポイントは
MCP_SECRET_KEYで保護されています。秘密にしてください。OAuthトークンはローカルの
data/tokens.jsonに保存されます。このファイルをコミットしないでください。LinkedInトークンの有効期限は60日、リフレッシュトークンは365日です。
サーバーは有効期限まで5日を切ると自動的にトークンを更新します。
EC2ポートの開放
# In AWS Security Group, allow inbound:
# Port 3000, TCP, from your agent's IP (or 0.0.0.0/0 for testing)または、nginxを使用して 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.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to manage professional networking on LinkedIn by providing tools for posting updates, searching for jobs, and analyzing profiles. It facilitates secure interaction with the LinkedIn platform through OAuth 2.0 authentication and the Model Context Protocol.1711MIT
- FlicenseAqualityDmaintenanceEnables LLMs and agents to interact with LinkedIn's REST API for managing profiles, creating posts, viewing connections, and overseeing organizations.52
- AlicenseBqualityCmaintenanceEnables AI agents to manage LinkedIn profiles, posts, connections, skills, education, and certifications through the LinkedIn API.1817664MIT
- AlicenseBqualityAmaintenanceEnables AI agents with read/write access to LinkedIn API, including profile, posts, media, organizations, comments, reactions, and analytics.2014MIT
Related MCP Connectors
Give AI agents the LinkedIn tools to find, qualify, engage, and follow up with prospects.
Let AI tools securely access your LinkedIn network and DMs
Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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