LinkedIn MCP Server for Claude Desktop - OAuth integration with Clean Architecture
claude mcp add --transport stdio greg0r1-linkedin-mcp-server node /ABSOLUTE/PATH/TO/linkedin-mcp-server/dist/index.js \ --env LINKEDIN_CLIENT_ID="your_client_id_here" \ --env LINKEDIN_COMPANY_ID="optional_company_id_here" \ --env LINKEDIN_REDIRECT_URI="http://localhost:3000/auth/callback" \ --env LINKEDIN_CLIENT_SECRET="your_client_secret_here"
How to use
This MCP server enables Claude Desktop to interact with your LinkedIn profile and, if configured, your company pages. It supports core Personal Profile operations such as fetching profile information, creating and publishing posts, reading posts, and deleting posts. Company Page features allow publishing posts on behalf of a company page, reading company page information, and retrieving company posts. Some advanced capabilities like company analytics, job search, and messaging are restricted or deprecated by LinkedIn API policies, so they are not available in standard API access. To use it, run the MCP server and point Claude Desktop to the absolute path of dist/index.js in your project, after performing the initial OAuth authentication described in the setup steps. Once authenticated, Claude Desktop will automatically launch the MCP server when needed and use saved tokens for subsequent requests.
How to install
Prerequisites:
- Node.js 18+ installed on your system
- A LinkedIn application (see LinkedIn Developer portal)
- Claude Desktop installed
Installation steps:
# 1. Clone the repository
git clone <your-repo-url>
cd linkedin-mcp-server
# 2. Install dependencies
npm install
Configure LinkedIn credentials and environment:
cp .env.example .env
Edit .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 features
Build the project:
npm run build
Authenticate with LinkedIn (one-time setup):
npm start
This starts a temporary HTTP server on port 3000, opens your browser to LinkedIn authentication, and saves tokens to ~/.linkedin-mcp-tokens.json. After this initial step, Claude Desktop will use the stored tokens automatically and you don’t need to re-run npm start.
Additional notes
Tips and considerations:
- Never commit your
.envfile. Use.gitignoreto protect credentials. - Tokens are stored at
~/.linkedin-mcp-tokens.jsonby default; you can customize storage using theTOKEN_STORAGE_PATHenvironment variable. - Ensure the redirect URI in LinkedIn Developer portal exactly matches
http://localhost:3000/auth/callback. - In Claude Desktop configuration, use an absolute path to the built MCP server entry point (e.g.,
/ABSOLUTE/PATH/TO/linkedin-mcp-server/dist/index.js). Restart Claude Desktop after updating the config. - Job search and messaging features are not available with standard LinkedIn API access; plan to use only the supported features.
- If you encounter authentication issues, delete
~/.linkedin-mcp-tokens.jsonand re-run the authentication flow. - For company posts, you may need to provide the LinkedIn company ID and have admin rights on the page.
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud