This MCP server allows you to post text and media directly to LinkedIn from Claude Desktop. The server supports text updates, image and video attachments, control over post visibility, and handles authentication securely.
Before installing the MCP server, you need to create a LinkedIn Developer App:
http://localhost:3000/callback
Install pipx
if not already installed:
pip install pipx
Install the LinkedIn MCP server:
pipx install linkedin-mcp
Create a .env
file with your LinkedIn Developer App credentials:
LINKEDIN_CLIENT_ID=your_client_id
LINKEDIN_CLIENT_SECRET=your_client_secret
LINKEDIN_REDIRECT_URI=http://localhost:3000/callback
Add the following configuration to your claude-desktop.json
file:
{
"mcpServers": {
"linkedin-mcp": {
"command": "linkedin-mcp",
"env": {
"LINKEDIN_CLIENT_ID": "<yours>",
"LINKEDIN_CLIENT_SECRET": "<yours>",
"LINKEDIN_REDIRECT_URI": "<yours>"
}
}
}
}
The LinkedIn MCP server provides two main tools:
The first time you use the server, you'll need to authenticate with LinkedIn. Claude will guide you through this process when you attempt to use the LinkedIn tools.
To create a post on LinkedIn, you can instruct Claude to:
For a simple text post:
Can you post this update to LinkedIn: "Excited to share my latest project using Claude Desktop!"
For a post with an image attachment:
Please post this to LinkedIn with the attached image: "Beautiful sunset from my office window today." The image is located at C:\Images\sunset.jpg
For a post with specific visibility settings:
Post this message to LinkedIn for my connections only: "Working on some interesting private projects this week!"
When you want to attach media, simply provide the file path to the media file you want to include with your post, and the server will handle the attachment process.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "linkedin-mcp" '{"command":"linkedin-mcp","env":{"LINKEDIN_CLIENT_ID":"<yours>","LINKEDIN_CLIENT_SECRET":"<yours>","LINKEDIN_REDIRECT_URI":"<yours>"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"linkedin-mcp": {
"command": "linkedin-mcp",
"env": {
"LINKEDIN_CLIENT_ID": "<yours>",
"LINKEDIN_CLIENT_SECRET": "<yours>",
"LINKEDIN_REDIRECT_URI": "<yours>"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"linkedin-mcp": {
"command": "linkedin-mcp",
"env": {
"LINKEDIN_CLIENT_ID": "<yours>",
"LINKEDIN_CLIENT_SECRET": "<yours>",
"LINKEDIN_REDIRECT_URI": "<yours>"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect