Skip to main content
Glama
ahmedekramalsada

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 UI

Related MCP server: LinkedIn MCP Server

セットアップガイド

1. LinkedInアプリの作成

  1. LinkedIn Developers にアクセスします

  2. Create App をクリックします

  3. アプリ名、LinkedInページ、ロゴを入力します

  4. Auth タブで Authorized redirect URLs を追加します:

    http://YOUR_EC2_IP:3000/auth/callback

    (nginxを使用している場合は、ご自身のドメインを指定してください)

  5. Products タブで以下をリクエストします:

    • Share on LinkedIn (w_member_social スコープが付与されます)

    • Sign In with LinkedIn using OpenID Connect (openid profile email スコープが付与されます)

  6. Client IDClient 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.service

systemdサービスファイル:

[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.target
sudo systemctl enable linkedin-mcp
sudo systemctl start linkedin-mcp
sudo systemctl status linkedin-mcp

4. LinkedInの認証

  1. http://YOUR_EC2_IP:3000 を開きます

  2. Connect LinkedIn をクリックします

  3. LinkedIn上でアプリを承認します

  4. リダイレクトされ、ステータスが ✅ 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"]
    }
  }
}

利用可能なツール

ツール

説明

linkedin_get_profile

名前、見出し、メールアドレス、写真を取得

linkedin_create_post

テキスト、記事、リンクを投稿

linkedin_get_my_posts

最近の投稿を一覧表示

linkedin_delete_post

URNで投稿を削除

linkedin_get_post_analytics

いいね/コメント/シェア数を取得

linkedin_like_post

投稿に「いいね」をする

linkedin_comment_on_post

投稿にコメントする

linkedin_get_connections

ネットワークを一覧表示

linkedin_search_people

キーワードで人物を検索

linkedin_get_auth_status

認証状態を確認


エージェントへのプロンプト例

"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経由

コネクションの取得

⚠️ スコープ要

r_network_size が必要

人物の検索

❌ 制限あり

パートナー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/mcplocalhost:3000/mcp にプロキシしてください。

A
license - permissive license
Not graded
quality - not tested
C
maintenance

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

  • A
    license
    A
    quality
    D
    maintenance
    Enables 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.
    17
    11
    MIT
  • A
    license
    B
    quality
    C
    maintenance
    Enables AI agents to manage LinkedIn profiles, posts, connections, skills, education, and certifications through the LinkedIn API.
    18
    176
    64
    MIT
  • A
    license
    B
    quality
    A
    maintenance
    Enables AI agents with read/write access to LinkedIn API, including profile, posts, media, organizations, comments, reactions, and analytics.
    20
    14
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

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