linkedin-mcp-server
Allows AI agents to autonomously draft and publish text updates, share rich link previews, upload images, create interactive polls, manage existing posts, and engage with reactions and threaded comments on LinkedIn.
Allows AI agents to autonomously draft and publish text updates, share rich link previews, upload images, create interactive polls, manage existing posts, and engage with reactions and threaded comments on LinkedIn.
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 a status update about my new blog post"
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
A production-ready Model Context Protocol (MCP) server connecting AI agents (Google Gemini Spark, OpenAI Codex, Claude Desktop, Cursor, Windsurf) to the official LinkedIn REST API.
Enables AI agents to autonomously draft and publish text updates, share rich link previews, upload images, create interactive polls, manage existing posts, and engage with reactions and threaded comments.
https://github.com/user-attachments/assets/cda965be-d6a2-4a37-8d3c-29a68a9959e1
Features
Dual-Mode MCP Transport:
Server-Sent Events (SSE) via
GET /mcpandPOST /messagesfor clients like Google Gemini Spark and Claude.Streamable HTTP via
POST /mcpfor modern command-line and agent runtimes like OpenAI Codex (rmcp).
12 Comprehensive Tools:
Content Creation: Text updates, article link preview cards, binary image uploads (3-step pipeline), and multi-option polls.
Content Management: Delete posts by URN, fetch engagement statistics (likes, comments, shares), and verify account profile connections.
Social Engagement: Add reactions (
LIKE,CELEBRATE,LOVE,INSIGHTFUL,FUNNY,EMPATHY), delete reactions, add comments, reply in threads, and remove comments.
Robust Validation: Powered by Zod schemas for all tool input parameters.
Enterprise-Ready: Automated unit and integration test suite with 100% endpoint coverage.
Related MCP server: @isteam/linkedin-mcp
Tool Reference
Tool | Category | Description | Parameters |
| Content | Publish a standard text post to your LinkedIn feed |
|
| Content | Publish a post with a clickable preview card |
|
| Content | Download an image from a URL, upload it to LinkedIn, and publish |
|
| Content | Create a poll with customizable duration |
|
| Management | Delete a post using its Post URN |
|
| Management | Retrieve authenticated profile details (name, member ID) | None |
| Management | Fetch engagement metrics (likes, comments, shares) |
|
| Engagement | Add a reaction to a post |
|
| Engagement | Remove your reaction from a post |
|
| Engagement | Add a top-level comment on a post |
|
| Engagement | Delete a comment you made |
|
| Engagement | Post a threaded reply to an existing comment |
|
Setup & Authentication
1. LinkedIn Developer Portal Setup
Create a LinkedIn application in the LinkedIn Developer Portal.
Under the Products tab, request access to:
Share on LinkedIn (provides
w_member_socialpermission)Sign In with LinkedIn using OpenID Connect (provides
openidandprofilepermissions)
In the Auth tab, add a redirect URL (e.g.
https://httpbin.org/getor your domain).
2. Generate a User Access Token
Construct the authorization URL in your browser:
https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&scope=openid%20profile%20w_member_socialAuthorize the application and copy the
codequery parameter from the redirection URL.Exchange the code for a 60-day access token:
curl -X POST https://www.linkedin.com/oauth/v2/accessToken \ -d "grant_type=authorization_code" \ -d "code=YOUR_AUTHORIZATION_CODE" \ -d "client_id=YOUR_CLIENT_ID" \ -d "client_secret=YOUR_CLIENT_SECRET" \ -d "redirect_uri=YOUR_REDIRECT_URI"Fetch your member ID:
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" https://api.linkedin.com/v2/userinfoThe
subfield is your member identifier (e.g.,urn:li:person:<sub_id>).
Configuration
Copy the sample environment file:
cp .env.example .envConfigure your .env variables:
LINKEDIN_ACCESS_TOKEN=your_oauth2_access_token
LINKEDIN_AUTHOR_URN=urn:li:person:your_member_sub_id
PORT=3000Running Locally
# Install dependencies
npm install
# Run unit and integration tests
npm test
# Start the server
npm start
# Start in development mode (with live reload)
npm run devClient Integration
OpenAI Codex CLI
Add the server using the Codex CLI:
codex mcp add linkedin --url https://your-server-domain.com/mcpOr add it directly to ~/.codex/config.toml:
[mcp_servers.linkedin]
url = "https://your-server-domain.com/mcp"Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"linkedin": {
"command": "node",
"args": ["/path/to/linkedin-mcp-server/server.js"],
"env": {
"LINKEDIN_ACCESS_TOKEN": "your_access_token",
"LINKEDIN_AUTHOR_URN": "urn:li:person:your_sub_id"
}
}
}
}Google Gemini Spark
In your Gemini Spark custom applications settings, enter your public SSE endpoint URL:
https://your-server-domain.com/mcpDeployment
Deploy to Railway
Install the Railway CLI:
npm i -g @railway/cliLink or create a project:
railway init railway upSet environment variables:
railway variable set LINKEDIN_ACCESS_TOKEN="your_token" LINKEDIN_AUTHOR_URN="urn:li:person:your_sub_id"Generate a public domain:
railway domain
Development & Testing
The test suite includes 62 automated unit and integration tests covering the LinkedIn API client, all 12 tool registrations and execution handlers, and SSE / Streamable HTTP transports.
# Run tests once
npm test
# Run tests in watch mode
npm run test:watchLicense
This project is licensed under the MIT License.
This server cannot be installed
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
- AlicenseAqualityCmaintenanceFully featured MCP server that provides automation tools for LinkedIn, supporting browser-based scraping and API-based operations for content management, media uploads, and reactions.63MIT
- AlicenseAqualityDmaintenanceMCP server for LinkedIn that enables AI agents to post, comment, like, and manage content on LinkedIn.1061MIT
- AlicenseAqualityDmaintenanceHigh-performance autonomous MCP server that turns LinkedIn into an API for AI workflows, enabling profile management, job search, content posting, and document generation.141MIT
- Alicense-qualityCmaintenanceAI-powered LinkedIn automation server for content generation, profile/company data extraction, and connection request automation, integrating with MCP clients like Claude Desktop.MIT
Related MCP Connectors
Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.
MCP server for LeadDelta — manage LinkedIn connections and CRM data via AI assistants.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
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/vahabcore/linkedin-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server