linkedin-mcp-server
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-serverShow me my last 5 LinkedIn posts"
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 Model Context Protocol (MCP) server that enables Claude Desktop to interact with your LinkedIn profile and company pages. Connect your LinkedIn account to Claude AI and manage your professional presence directly through conversations.
π― Features
β Fully Supported (Standard API Access)
Personal Profile
Fetch your profile information
Create and publish posts
Read your posts
Delete posts
Company Pages
Publish posts on behalf of your company page
Read company page information
Get company posts
β οΈ Limited or Requires Special Access
Company Analytics
β οΈ Requires Marketing Developer Platform access
Not available with standard API permissions
Job Search
β LinkedIn deprecated the public job search API
Feature code exists but is not functional
Messaging
β Requires additional LinkedIn API permissions
Not available with standard API access
Feature code exists but is not functional
π Quick Start
Prerequisites
Node.js 18+ installed on your system
A LinkedIn application - Create one here
Claude Desktop - Download here
Installation Steps
1. Clone and install dependencies
git clone <your-repo-url>
cd linkedin-mcp-server
npm install2. Create a LinkedIn Application
Go to LinkedIn Developers
Create a new app with these settings:
App name: Choose any name (e.g., "My LinkedIn MCP Server")
LinkedIn Page: Select your company page or create one
App logo: Optional
In the Auth tab:
Add redirect URL:
http://localhost:3000/auth/callbackCopy your Client ID and Client Secret
In the Products tab, request access to:
"Sign In with LinkedIn using OpenID Connect"
"Share on LinkedIn"
3. Configure environment variables
cp .env.example .envEdit .env and add your credentials:
LINKEDIN_CLIENT_ID=your_client_id_here
LINKEDIN_CLIENT_SECRET=your_client_secret_here
LINKEDIN_REDIRECT_URI=http://localhost:3000/auth/callback
LINKEDIN_COMPANY_ID=your_company_id_here # Optional, for company page features4. Build the project
npm run build5. Authenticate with LinkedIn (one-time setup)
npm startThis step is only needed once to obtain your LinkedIn OAuth token:
Starts a temporary HTTP server on port 3000
Opens your browser to LinkedIn authentication
Saves your access tokens to
~/.linkedin-mcp-tokens.json(in your home directory)The server will automatically close after authentication
Note: After this initial authentication, you don't need to run npm start again. Claude Desktop will use the saved token automatically.
π§ Claude Desktop Configuration
After building and authenticating, configure Claude Desktop to use your MCP server:
Add this configuration to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"linkedin": {
"command": "node",
"args": [
"/ABSOLUTE/PATH/TO/linkedin-mcp-server/dist/index.js"
]
}
}
}Important: Replace /ABSOLUTE/PATH/TO/linkedin-mcp-server with the actual path to your project directory.
To get the absolute path:
# On macOS/Linux
pwd
# On Windows (PowerShell)
Get-LocationThen restart Claude Desktop completely (quit and reopen).
How it works: Claude Desktop will automatically launch the MCP server (via dist/index.js) when needed. You don't need to run npm start - that was only for the initial OAuth authentication.
π― Usage
Once configured, you can ask Claude Desktop:
Personal Profile
"Get my LinkedIn profile information"
"Show me my LinkedIn profile"Publishing Posts
"Post on LinkedIn: Just learned about MCP servers, amazing technology!"
"Show me my last 5 LinkedIn posts"
"Delete my last LinkedIn post"Company Page (if configured)
"Post on my company page: We're hiring a Senior Developer!"
"Show posts from my company page"
"Get information about my company page"Note: Job search and messaging features are not available with standard LinkedIn API access. See the Features section for details.
π’ Getting Your Company ID (Optional)
To publish on your company page, you need to find your Company ID:
Method 1: Use the provided script
npm run get-company-idThis will authenticate and show all company pages you administrate.
Method 2: From LinkedIn URL
Go to your company page on LinkedIn
Look at the URL:
linkedin.com/company/your-company-name/Use browser developer tools to find the numeric ID in the page source
Add the Company ID to your .env file:
LINKEDIN_COMPANY_ID=123456789Note: You must be an administrator of the company page to post on its behalf.
π Project Architecture
Built with Clean Architecture principles:
src/
βββ domain/ # Business entities
β βββ entities/ # LinkedIn entities
β βββ interfaces/ # Contracts & interfaces
βββ application/ # Use cases
β βββ use-cases/ # Business logic
βββ infrastructure/ # External services
β βββ linkedin/ # LinkedIn API client
β βββ storage/ # Token storage
βββ presentation/ # MCP layer
β βββ tools/ # Exposed MCP tools
βββ index.ts # Entry pointπ Security
β οΈ NEVER commit your
.envfileβ οΈ OAuth tokens are stored locally in
~/.linkedin-mcp-tokens.json(in your home directory)β οΈ Keep
.envin.gitignoreβ οΈ Tokens are automatically refreshed when needed
β οΈ You can customize the token storage path with the
TOKEN_STORAGE_PATHenvironment variable
π οΈ Development
# Build TypeScript (required before using with Claude Desktop)
npm run build
# Development mode with auto-reload (for testing changes)
npm run dev
# Authenticate with LinkedIn (one-time setup only)
npm start
# Get your company ID (for posting on company pages)
npm run get-company-idImportant:
npm run buildis required before using the MCP server with Claude Desktopnpm startis only needed once for OAuth authenticationAfter authentication, Claude Desktop launches the server automatically via the config file
π Resources
π Troubleshooting
"Invalid environment variables"
Check that your .env file contains valid values (not placeholders like your_client_id_here)
"Authentication failed"
Verify your Redirect URI matches exactly:
http://localhost:3000/auth/callbackCheck that you've requested access to required Products in LinkedIn Developer Portal
Delete
~/.linkedin-mcp-tokens.jsonand try authenticating again
MCP server not starting in Claude Desktop
Verify the path in
claude_desktop_config.jsonis absolute and correctEnsure
npm run buildcompleted successfullyCheck Claude Desktop logs:
macOS:
~/Library/Logs/Claude/mcp*.logWindows:
%APPDATA%\Claude\logs\mcp*.log
"Company not found"
Make sure you're an administrator of the company page on LinkedIn
"Failed to retrieve LinkedIn posts" or rate limit errors
LinkedIn API has strict rate limits and restrictions:
Personal posts (
get_my_posts): May be limited or require additional permissionsCompany posts (
get_company_posts): May require Marketing Developer Platform accessTry reducing the number of posts requested (use a smaller limit)
Check your LinkedIn app's permissions and products in the Developer Portal
Some endpoints may not be available with standard API access
MCP protocol errors or "broken pipe"
If you see errors in Claude Desktop logs about the MCP protocol:
This has been fixed in recent versions - ensure you have the latest code
All logging now goes to stderr (not stdout) to avoid interfering with the MCP protocol
Restart Claude Desktop after updating
π License
MIT
π€ Author
Created with β€οΈ by GrΓ©gory Dernaucourt
π€ Contributing
Contributions, issues, and feature requests are welcome!
β Show your support
Give a βοΈ if this project helped you connect your LinkedIn to Claude AI!
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.
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/greg0r1/linkedin-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server