linkedin-mcp-server
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-server Post a LinkedIn update about 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
LinkedIn MCP Server — post content, share articles, and manage your LinkedIn profile through Claude using the official LinkedIn API.
7 tools for creating posts, sharing articles, posting with images, managing your profile, and more — powered by the official LinkedIn REST API with OAuth 2.0.
Tools
Tool | Description | Permissions Required |
| Get your LinkedIn profile information | Basic (OpenID) |
| Create a text post (up to 3000 chars) with hashtags at the end | Share on LinkedIn |
| Share an article link with commentary and hashtags at the end | Share on LinkedIn |
| Create a single-image post (local path, URL, search query, or generated image) | Share on LinkedIn |
| Get your recent posts | Share on LinkedIn ⚠️ |
| Delete a post by ID | Share on LinkedIn |
| Get your total connection count | ⚠️ May need partner access |
⚠️ API Limitations:
linkedin_get_postsandlinkedin_get_connections_countuse LinkedIn endpoints that may require elevated or partner-level API access depending on your app's approval status. The core tools (get profile, create post, share article, delete post) work with standard access.
Related MCP server: LinkedIn MCP Server
Setup
LinkedIn requires creating a Developer App to get OAuth credentials. This takes about 10 minutes.
Step 1 — Create a LinkedIn Developer App
Click "Create app"
Fill in the required fields:
App name: e.g.
My LinkedIn MCPLinkedIn Page: You need a LinkedIn company page linked — create a simple one at linkedin.com/company/setup/new if you don't have one
App logo: Upload any image (required)
Agree to the terms and click "Create app"
Step 2 — Configure OAuth Redirect URL
In your new app, go to the "Auth" tab
Under "OAuth 2.0 settings", find "Authorized redirect URLs for your app"
Click "Add redirect URL" and enter exactly:
http://127.0.0.1:3000/callbackClick "Update"
Copy your Client ID and Client Secret from this page — you'll need them next
Step 3 — Request API Products
Go to the "Products" tab in your app
Request access to both of these products:
Sign In with LinkedIn using OpenID Connect — click "Request access" → Select → Agree
Share on LinkedIn — click "Request access" → Select → Agree
Both are typically approved instantly for personal use
Step 4 — Install & Configure
# Install globally
pnpm add -g @dev-hitesh-gupta/linkedin-mcp-server
# Create config directory and add your credentials
mkdir -p ~/.linkedin-mcp
cat > ~/.linkedin-mcp/credentials.json << 'EOF'
{
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}
EOF
# Authenticate — opens browser for LinkedIn sign-in
linkedin-mcp-server authYour access token is saved to ~/.linkedin-mcp/token.json and valid for 60 days.
Step 5 — Add to Claude Code
claude mcp add linkedin -- pnpm dlx @dev-hitesh-gupta/linkedin-mcp-serverOr manually in your Claude config (~/.claude/claude_desktop_config.json):
{
"mcpServers": {
"linkedin": {
"command": "npx",
"args": ["@dev-hitesh-gupta/linkedin-mcp-server"]
}
}
}Usage Examples
Create a post:
Post to LinkedIn: "Just shipped a new open-source MCP server for LinkedIn automation! Check it out. #opensource #ai"Share an article:
Share this article on LinkedIn: https://example.com/article
My commentary: "Great read on the future of AI tooling"Create an image post:
Create a LinkedIn image post:
Text: "From messy component to scalable architecture"
imageSearchQuery: "software architecture diagram clean code"
hashtags: ["SoftwareArchitecture", "Refactoring", "CleanCode"]Control visibility:
Value | Who sees it |
| Everyone on LinkedIn (default) |
| Your 1st-degree connections only |
| Any logged-in LinkedIn member |
Automated Niche Posting (Every 3 Days)
The project now includes an auto-post workflow that:
Finds relevant trending articles for your niche from public news feeds
Scores and selects the best recent candidate
Avoids reposting the same article (history file)
Publishes one LinkedIn article post automatically
1) Configure your niche
Run this once:
pnpm build
pnpm autopost:dry-runOn first run, a template config is created at:
~/.linkedin-mcp/automation.json
Fill it with your niche and keywords, for example:
{
"niche": "AI Automation For SMB Operations",
"keywords": [
"ai automation",
"workflow automation",
"small business operations"
],
"audience": "Founders and operations leaders",
"postLanguage": "es",
"visibility": "PUBLIC",
"hashtags": ["AI", "Automation", "BusinessGrowth"],
"maxArticleAgeHours": 96,
"itemsPerKeyword": 8,
"market": "en-US"
}2) Run a single automatic post
pnpm autopost3) Install cron (every 3 days)
Installs a managed cron entry that runs every 3 days at 09:00:
pnpm autopost:cron:installCustom time:
pnpm autopost:cron:install -- --hour=9 --minute=30Remove cron entry:
pnpm autopost:cron:removeAutomation files:
Config:
~/.linkedin-mcp/automation.jsonHistory:
~/.linkedin-mcp/automation-history.jsonCron logs:
~/.linkedin-mcp/autopost.log
Re-authentication
LinkedIn tokens expire after 60 days. Re-authenticate when needed:
rm ~/.linkedin-mcp/token.json
linkedin-mcp-server authData & Auth Storage
All data is stored locally:
~/.linkedin-mcp/
├── credentials.json # Your LinkedIn app Client ID + Secret
└── token.json # OAuth access token (expires in 60 days)Security: Never commit these files to version control.
Troubleshooting
"Not authenticated" error:
linkedin-mcp-server auth"Unable to determine member URN": Ensure the Sign In with LinkedIn using OpenID Connect product is approved in your app's Products tab.
Post creation fails: Ensure the Share on LinkedIn product is approved. Check the Products tab in your LinkedIn Developer app.
"Access blocked" during sign-in: Your LinkedIn app may still be under review. Check the Products tab for approval status.
Token expired:
rm ~/.linkedin-mcp/token.json && linkedin-mcp-server authlinkedin_get_posts or linkedin_get_connections_count returns errors:
These tools use LinkedIn API endpoints that require elevated permissions not available with standard developer access. This is a LinkedIn API restriction.
Requirements
Node.js 18+
A LinkedIn account
LinkedIn Developer App with OAuth credentials (see setup above)
License
MIT — Hitesh Gupta
Available Tools
7 toolslinkedin_create_article_postA
Create a LinkedIn post with an article/link. Great for sharing blog posts, news articles, or any web content with your network.
Inputs: text (required), articleUrl (required), title, hashtags, +2 more.
linkedin_create_image_postA
Create a LinkedIn post with exactly one image. Supports local file path, public image URL, internet image search query, or AI image generation prompt tuned for photorealistic results.
Inputs: text (required), altText, hashtags, imageUrl, +4 more.
linkedin_create_postA
Create a text post on LinkedIn. Supports different visibility options: PUBLIC (everyone), CONNECTIONS (1st degree connections only), or LOGGED_IN (LinkedIn members only).
Inputs: text (required), hashtags, visibility.
linkedin_delete_postA
Delete a LinkedIn post by its ID.
Inputs: postId (required).
linkedin_get_connections_countA
Get the number of LinkedIn connections. Note: This may require additional API permissions.
Inputs: no named parameters.
linkedin_get_postsA
Get the authenticated user's recent LinkedIn posts. Note: This may require additional API permissions.
Inputs: count.
linkedin_get_profileA
Get the authenticated user's LinkedIn profile information including name, email, and profile picture.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Tools are mostly distinct, with the three create_post variants clearly differentiated by content type (text, article, image). The only minor ambiguity is that create_post might be assumed to be the generic post creator, but its description explicitly limits it to text posts.
All tools follow a consistent snake_case convention with the linkedin_ prefix and a verb_noun pattern. The create article and image post tools extend this pattern naturally, and there is no mixing of styles.
Seven tools is well-scoped for a LinkedIn server focused on profile access and post management. Each tool serves a distinct purpose without excessive overlap or bloat.
The core workflows are covered: view profile, create/delete/list posts, and get connection count. Minor gaps like retrieving a single post by ID or managing individual connections are absent, but these are not critical for the server's apparent primary use case.
Maintenance
Related MCP Connectors
Draft LinkedIn posts in your voice, then schedule or publish them through LinkedIn's official API.
Publish and schedule LinkedIn posts from your AI assistant.
Schedule and publish LinkedIn posts to profiles and company pages from AI agents.
Manage LinkedIn messages, connections, posts, and profile data through Linked API.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with LinkedIn for posting, commenting, liking, and managing connections via OAuth2 authentication.27 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with LinkedIn's Community Management API, allowing users to retrieve profile information and create posts via natural language.128 npm41MIT
- AlicenseAqualityDmaintenanceEnables posting content, sharing articles, and managing your LinkedIn profile through Claude using the official LinkedIn API with OAuth 2.0.64 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables natural language interaction with LinkedIn, including profile retrieval, job searching, messaging, and post engagement.3Apache 2.0