linkedin-mcp
This server lets AI assistants post and engage on LinkedIn through the official API using your personal profile (or company pages).
Publish posts: text, link previews, or single images, with visibility options (public, connections, logged-in members) and automatic hashtag conversion.
Delete posts you authored.
Comment on posts and react (like, celebrate, love, insightful, support, funny).
Get your LinkedIn profile info (name, email, picture, person URN) to verify the connection.
List organizations you administer and post/act as a company page (with extra permissions).
Read post data (get a post, list posts, get like/comment stats) — note these require restricted
r_member_socialpermission and generally don't work for personal profiles.Automate workflows via Claude, ChatGPT, Cursor, n8n, cron, or any MCP client.
Click on "Deploy 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 Publish a LinkedIn post about our latest product launch"
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
Post to LinkedIn from Claude, ChatGPT, Cursor or any AI assistant — on your personal profile, through the official LinkedIn API.
linkedin-mcp is an open-source Model Context Protocol server. You sign in once with your own LinkedIn developer app, and your assistant can publish text, link and image posts, comment and react. No scraping, no password sharing, no browser automation.
No company account needed. It works with a normal personal LinkedIn profile. LinkedIn only asks you to link your developer app to a Page, and you can create one yourself in a minute (see step 1).
Contents
3c. Self-hosting (always on): for Claude routines, claude.ai and scheduled tasks
Related MCP server: LinkedIn MCP Server
What can I do with it?
With a personal profile and the default setup (access is granted instantly):
✅ Publish posts | Plain text, with a link preview, or with an image (local file or URL) |
✅ Real hashtags |
|
✅ Visibility | Public, connections only, or signed-in members |
✅ Engage | Comment on posts and react (like, celebrate, support, love, insightful, funny) |
✅ Delete | Remove posts you created |
✅ Automate | Let your assistant write and publish on a schedule |
❌ Read your feed, posts or engagement statistics (likes, comments, impressions) | LinkedIn restricts |
❌ Messages, connections, search, other profiles | Not offered by LinkedIn's public API |
Company pages are supported as well, but need extra approval from LinkedIn (see Company pages).
Setup
You need Node.js 22+ (node -v) and a LinkedIn account.
1. Create a LinkedIn app (5 minutes)
Create a LinkedIn Page, if you don't have one. LinkedIn requires every developer app to be linked to a Page. This is only a formality: go to For Business → Create a Company Page, pick any name (e.g. "Jane Doe Tools"). It never has to post anything. Your posts still appear on your personal profile.
Open https://www.linkedin.com/developers/apps → Create app, pick that Page, upload any logo.
Settings tab → Verify the app with the Page. As the Page admin you approve it yourself.
Products tab → click Request access on exactly these two (both are granted instantly):
Share on LinkedIn: publish, comment, react (
w_member_social)Sign In with LinkedIn using OpenID Connect: identifies you as the author (
openid profile email)
Don't request the other products (Advertising, Lead Sync, Events, Community Management, …). You don't need them for personal posting.
Auth tab → Authorized redirect URLs for your app → pencil icon → Add redirect URL → paste exactly
http://localhost:8787/callbackand click Update. It must be
http(not https),localhost(not 127.0.0.1), with no trailing slash.Still in Auth: check that OAuth 2.0 scopes lists
openid,profile,email,w_member_social. Keep this tab open, you'll need the Client ID and Primary Client Secret.
2. Sign in
Run this in your terminal. It's the only command you need, and it asks for everything:
npx -y github:vlpmedialtd/linkedin-mcp authLinkedIn Client ID:→ paste the Client ID, press EnterLinkedIn Client Secret (hidden):→ click the copy icon next to Primary Client Secret, paste, press Enter. Nothing is shown while you paste; that's intentional. You'll see(received NN characters): the secret is much longer than the 14-character Client ID.Your browser opens → click Allow
Wait until the terminal shows
✔ Token saved to ~/.config/linkedin-mcp/token.json. Only then are you done.
The token is valid for 60 days. Run the same command again when it expires.
Paste values at the prompts, not behind the command. If your terminal shows
dquote>, pressCtrl+Cand start again.
3a. Use with Claude Code / Claude Desktop / Cursor
These clients start the server locally on your computer.
Claude Code
claude mcp add -s user linkedin -- npx -y github:vlpmedialtd/linkedin-mcpCheck with claude mcp list (should show linkedin … ✓ Connected), then start a new session.
Claude Desktop / Cursor / Windsurf / any stdio MCP client: add to claude_desktop_config.json, .cursor/mcp.json, …
{
"mcpServers": {
"linkedin": {
"command": "npx",
"args": ["-y", "github:vlpmedialtd/linkedin-mcp"]
}
}
}Restart the app. Test it by asking "Who am I on LinkedIn?". This only reads your profile; nothing is posted.
Claude Desktop (macOS): the config file is
~/Library/Application Support/Claude/claude_desktop_config.json. Desktop apps don't inherit your shell'sPATH, so if Node is installed via nvm, Homebrew or in~/.local/bin, use the absolute path fromwhich npxand pass aPATH:{ "mcpServers": { "linkedin": { "command": "/Users/you/.local/bin/npx", "args": ["-y", "github:vlpmedialtd/linkedin-mcp"], "env": { "PATH": "/Users/you/.local/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin" } } } }Quit Claude completely (
Cmd+Q) and reopen it.claude mcp addonly configures Claude Code, not the Claude Desktop chat.
claude.ai in the browser / Claude mobile: these need a remote server. Start the HTTP mode with a tunnel (steps 1 and 2), then go to Settings → Connectors → Add custom connector and paste https://<tunnel>/mcp/<secret>.
3b. Use with ChatGPT
ChatGPT can't start programs on your computer. It connects to MCP servers over public HTTPS instead. linkedin-mcp has an HTTP mode for this, and you make it reachable through a tunnel.
Requirements: a ChatGPT plan with Developer mode (Plus, Pro, Business, Enterprise or Education, on the web), and steps 1 and 2 above completed.
1. Start the HTTP server (terminal 1, keep it running)
npx -y github:vlpmedialtd/linkedin-mcp httpIt prints your secret endpoint, for example http://127.0.0.1:3000/mcp/Xy7…. The part after /mcp/ is a random secret stored in ~/.config/linkedin-mcp/http-token, so it stays the same across restarts.
2. Open an HTTPS tunnel (terminal 2, keep it running)
brew install cloudflaredcloudflared tunnel --url http://localhost:3000Copy the https://….trycloudflare.com address it prints. ngrok (ngrok http 3000) works the same way.
3. Add the app in ChatGPT
ChatGPT → Settings → Security and login → turn on Developer mode.
Go to Plugins (apps) → + to create a developer-mode app for a remote MCP server.
MCP server URL: your tunnel address +
/mcp/+ your secret, e.g.https://blue-sky-1234.trycloudflare.com/mcp/Xy7…Authentication: No authentication. The secret in the URL protects the server.
Confirm that you trust the app and create it.
4. Use it: in a chat, open the + menu → Developer mode → enable your LinkedIn app, then ask "Who am I on LinkedIn?". ChatGPT asks for confirmation before write actions such as publishing a post.
Good to know:
Both terminals must keep running and your computer must stay awake while ChatGPT uses the app.
Quick tunnels get a new address on every start. Update the app's URL in ChatGPT afterwards, or use a named Cloudflare tunnel or an ngrok static domain for a permanent address.
Images: ChatGPT can't hand files from the chat to the server. Use an image URL, or a file path on the computer running the server.
Always-on hosting: run
linkedin-mcp http --host 0.0.0.0on any Node host (VPS, Railway, Render, Fly.io …) withLINKEDIN_ACCESS_TOKENandMCP_AUTH_TOKENset as environment variables, behind HTTPS.Menu names in ChatGPT change from time to time. See OpenAI's Developer mode guide for the current steps.
3c. Self-hosting (always on)
Cloud features such as Claude routines, claude.ai connectors and ChatGPT scheduled tasks run on the provider's servers and can't reach your laptop. For them, run linkedin-mcp permanently on a small Linux server. Tested on Ubuntu with Caddy for automatic HTTPS; the files are in deploy/.
Requirements: a server with a public IP, SSH as root, and a (sub)domain whose DNS A record points to the server (e.g. mcp.example.com).
1. Install (on the server)
apt-get update && apt-get install -y git caddy nodejs npmuseradd --system --home /var/lib/linkedin-mcp --create-home --shell /usr/sbin/nologin linkedin-mcpgit clone https://github.com/vlpmedialtd/linkedin-mcp.git /opt/linkedin-mcp && cd /opt/linkedin-mcp && npm ci && npm run buildNode must be 22 or newer (node -v). Otherwise install it from NodeSource.
2. Copy your LinkedIn token (run auth on your computer first, then from your computer)
scp ~/.config/linkedin-mcp/token.json root@SERVER:/root/token.jsonOn the server:
install -d -m 700 -o linkedin-mcp -g linkedin-mcp /etc/linkedin-mcp && install -m 600 -o linkedin-mcp -g linkedin-mcp /root/token.json /etc/linkedin-mcp/token.json && rm /root/token.json3. Service, HTTPS and firewall
cp /opt/linkedin-mcp/deploy/linkedin-mcp.service /etc/systemd/system/ && systemctl daemon-reload && systemctl enable --now linkedin-mcpcp /opt/linkedin-mcp/deploy/Caddyfile /etc/caddy/Caddyfile && sed -i 's/mcp.example.com/YOUR.DOMAIN/' /etc/caddy/Caddyfile && systemctl reload caddyufw allow OpenSSH && ufw allow 80/tcp && ufw allow 443/tcp && ufw --force enable4. Get your connector URL
echo "https://YOUR.DOMAIN/linkedin/mcp/$(cat /etc/linkedin-mcp/http-token)"Check https://YOUR.DOMAIN/linkedin/health → {"status":"ok"}.
5. Add it as a connector
claude.ai (also used by Claude routines, the desktop and mobile apps): Settings → Connectors → Add custom connector → name
LinkedIn, paste the URL, no OAuth needed.ChatGPT: see 3b, step 3, with this URL instead of the tunnel.
Maintenance
Task | Command (on the server) |
Renew LinkedIn token (every 60 days) | run |
Update to the latest version |
|
New secret URL |
|
Logs |
|
Example prompts
"Who am I on LinkedIn?" (connection test, read-only)
"Write a LinkedIn post about our new open-source release, link https://github.com/…, show me the draft first."
"Post this image
/Users/me/Desktop/chart.pngwith the text '…' and alt text 'Revenue chart Q3'.""Publish it for my connections only."
"Delete the post you just published."
"Like urn:li:share:7234… and comment 'Congratulations!'"
Automated posting
The server provides the tools; something has to trigger them:
Claude: scheduled tasks, e.g. "Every Tuesday at 9:00, write a short post about this week's topic from my notes and publish it."
ChatGPT: scheduled tasks with the developer-mode app enabled
n8n, cron or an agent framework that can act as an MCP client
Keep in mind:
Token lifetime: standard LinkedIn apps get no refresh token. The access token expires after 60 days and the server then reports a clear error. Put a reminder in your calendar to run
authagain.Confirmation: the post tool asks the model to confirm the text with you first. For unattended runs, say explicitly in your prompt that publishing without confirmation is intended.
Fair use: posting through the official API is allowed, but LinkedIn's User Agreement prohibits spam and bulk posting. Keep the cadence human.
Troubleshooting
Problem | Cause & fix |
"Do I need a company account?" | No. You only need a Page to create the developer app (step 1.1). Posts go to your personal profile. |
Terminal shows | A value was pasted directly behind the command. Press |
Browser: "The redirect_uri does not match the registered value" | The redirect URL is missing or differs in the app's Auth tab. Add exactly |
| The Client Secret is wrong. If it says |
Browser: | One of the two products isn't added yet. Check Products → Added products for Share on LinkedIn and Sign In with LinkedIn using OpenID Connect. |
|
|
| 60 days are over. Run |
| npx cached an old version. Run |
| Something else uses the port. Run |
| Expected for personal profiles. Reading posts, comments and engagement needs |
| Fixed in v0.2.1: comments and reactions now use the v2 endpoints that work with |
LinkedIn API | Set |
ChatGPT: "Error creating connector" / | Check the URL: tunnel address + |
ChatGPT worked yesterday, not today | The quick tunnel got a new address, or the computer slept. Restart both terminals and update the URL in ChatGPT. |
Claude Code: | Run |
Claude routine / claude.ai: "LinkedIn connector missing" | Routines and claude.ai run in the cloud and only see connectors added at claude.ai → Settings → Connectors, not local MCP servers. Host the server (3c) and add its URL as a custom connector. |
Claude Desktop chat has no LinkedIn tools (but Claude Code does) |
|
Claude Desktop: | The app can't find Node. Use the absolute path from |
Still stuck? Open an issue with the error message. Never post your Client Secret, access token or MCP URL.
Tools reference
Tool | What it does | LinkedIn permission |
| Name, email, picture and person URN of the signed-in member |
|
| Publish a text post, optionally with link preview ( |
|
| Delete a post you authored |
|
| Comment on a post |
|
| React to a post |
|
| Fetch a post by URN |
|
| List recent posts |
|
| Like and comment summary |
|
| Pages you administer |
|
* Restricted by LinkedIn to approved partners.
All write tools accept an optional organization_id to act as a company page. Tools carry MCP annotations (readOnlyHint, destructiveHint), so clients like ChatGPT and Claude can ask before write actions.
Configuration
Variable | Default | Description |
| – | Access token; takes precedence over the token file (useful for hosting) |
| prompted | Used by |
|
| Must match the app's Auth settings |
|
| Scopes requested by |
|
|
|
|
| Token storage |
| generated | Secret for the HTTP endpoint |
|
| HTTP mode listen address |
CLI:
linkedin-mcp stdio server (Claude Code, Claude Desktop, Cursor, …)
linkedin-mcp auth sign in and store the token
linkedin-mcp http Streamable HTTP server (ChatGPT, remote clients)
--port <port> --host <host> --new-tokenHTTP endpoints: GET /health; MCP at /mcp/<secret> or /mcp with Authorization: Bearer <secret>.
Company pages
To post, comment and read statistics as a company page:
Create a separate LinkedIn app. LinkedIn requires the Community Management API to be the only product in its app.
Request Community Management API (LinkedIn reviews the request).
Sign in with the extra scopes:
LINKEDIN_SCOPES="openid profile email w_member_social w_organization_social r_organization_social rw_organization_admin" npx -y github:vlpmedialtd/linkedin-mcp authAsk "Which LinkedIn pages do I manage?", then "Post … on page 12345".
Security
Tokens and the HTTP secret are stored locally with
600permissions and are never logged.The Client Secret is only used during
authand is not saved.Anyone with your HTTP MCP URL can post as you. Don't share it. Rotate it with
linkedin-mcp http --new-token, then update the URL in ChatGPT.The HTTP server listens on
127.0.0.1by default and is only reachable through your tunnel.Revoke access any time at https://www.linkedin.com/psettings/permitted-services.
Development
git clone https://github.com/vlpmedialtd/linkedin-mcp.git
cd linkedin-mcp
npm install
npm test # build + tests (LinkedIn API is mocked)
npx @modelcontextprotocol/inspector node dist/index.js # try tools interactivelysrc/
index.ts CLI (stdio, auth, http)
server.ts MCP tool definitions
http.ts Streamable HTTP transport with secret-token protection
linkedin.ts LinkedIn REST client (Posts, Assets, Organizations, Social Actions, Reactions)
auth.ts OAuth 2.0 authorization-code flow with local callback
config.ts Token storage
text.ts LinkedIn "little text" escaping + hashtags
test/ node:test suitesIssues and pull requests are welcome.
License
MIT © Andreas Henkel
Not affiliated with, endorsed or sponsored by LinkedIn Corporation or OpenAI. LinkedIn is a trademark of LinkedIn Corporation; ChatGPT is a trademark of OpenAI.
Available Tools
9 toolslinkedin_comment_on_postComment on a LinkedIn postA
Adds a comment to a post as yourself or an organization. Publishes immediately — confirm with the user first.
Inputs: text (required), post_urn (required), organization_id.
linkedin_create_postPublish a LinkedIn postA
Publishes a post on LinkedIn as the authenticated member (or an organization). Supports plain text, a link preview (article) or a single image. #hashtags in the text become real hashtags; all other special characters are escaped automatically. This publishes publicly and immediately — confirm the final text with the user before calling.
Inputs: text (required), image, link_url, link_title, +5 more.
linkedin_delete_postDelete a LinkedIn postADestructiveIdempotent
Deletes a post you (or your organization) authored. Irreversible — confirm with the user first.
Inputs: post_urn (required).
linkedin_get_postGet a LinkedIn postARead-only
Fetches a single post by URN. Reading member posts requires the r_member_social permission (restricted); organization posts require r_organization_social.
Inputs: post_urn (required).
linkedin_get_post_statsGet likes/comments summary of a postARead-only
Returns the like and comment summary of a post (socialActions).
Inputs: post_urn (required).
linkedin_get_profileGet my LinkedIn profileARead-only
Returns the authenticated member's basic profile (name, email, picture) and their person URN. Use this to verify the connection.
Inputs: no named parameters.
linkedin_list_organizationsList my LinkedIn organizationsARead-only
Lists LinkedIn company pages the authenticated member administers (Community Management API, scope rw_organization_admin).
Inputs: role.
linkedin_list_postsList LinkedIn postsARead-only
Lists recent posts by an author (default: yourself). Requires r_member_social (restricted) for members or r_organization_social for organizations.
Inputs: count, start, organization_id.
linkedin_react_to_postReact to a LinkedIn postAIdempotent
Adds a reaction (like, celebrate, support, …) to a post as yourself or an organization.
Inputs: post_urn (required), reaction, organization_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool targets a distinct resource-action pair: profile, post CRUD, organization listing, commenting, reacting, and stats. There is no overlap between getting a single post vs. listing posts, and comment/react/stats are clearly separate operations. The descriptions further clarify any potential boundary (e.g., get_post vs. list_posts).
All tools follow the same linkedin_<verb>_<noun> pattern with snake_case throughout. Each name starts with the domain prefix and then uses a clear action verb (get, create, delete, list, comment, react). Even the phrasal verbs like comment_on_post and react_to_post are internally consistent.
The 9 tools are well-scoped for a LinkedIn social API surface. The count covers profile verification, post management, engagement actions, and stats without being bloated. It sits comfortably in the ideal 3–15 range.
The tool set covers the core social workflow: create/read/delete posts, comment, react, and fetch stats. Missing operations like updating a post or listing individual comments/reactions are minor since LinkedIn edits are limited and stats provide summaries. No major dead ends exist for the stated purpose.
Maintenance
Related MCP Connectors
Publish and schedule LinkedIn posts from your AI assistant.
Schedule and publish LinkedIn posts to profiles and company pages from AI agents.
LinkedIn for AI agents: search people, read profiles, posts and connections via a connected account
LinkedIn for AI agents: inbox, invitations, Sales Navigator search, posts, jobs, quotas, webhooks.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables AI agents to manage LinkedIn profiles, posts, connections, skills, education, and certifications through the LinkedIn API.18176 npm64MIT
- AlicenseBqualityCmaintenanceEnables AI agents with read/write access to LinkedIn API, including profile, posts, media, organizations, comments, reactions, and analytics.207 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with LinkedIn using the official API for profile access, company management, and job postings.Apache 2.0
- AlicenseAqualityDmaintenanceEnables AI agents to publish posts, images, videos, and articles to LinkedIn.10MIT