Skip to main content

LinkedIn via AI: posting, scheduling and comments from Claude

An open-source MCP server that connects a LinkedIn account to Claude: creating and scheduling posts, Gemini images, comments, reactions and content templates, all handled with a plain request.

Industry: Marketing, personal branding, B2B companies

In short

  • Open-source LinkedIn MCP server, MIT license
  • 25 MCP tools
  • 12 built-in content templates
  • The scheduler retries a failed post

About the project

Running a LinkedIn profile means repeating the same steps: write a post, add an image, publish at a good time and reply to comments. linkedin-mcp-server turns them into MCP tools that Claude calls when you ask in a sentence, using the official LinkedIn API.

The challenge

The official LinkedIn API had to be joined with a conversation with AI so that login, publishing, media and scheduling work without manual clicking and tokens refresh by themselves.

Goals

  • Publish, edit and delete posts with a request
  • Schedule posts for a specific time
  • Generate images and attach them to posts
  • Handle comments and reactions

Technical challenges

OAuth 2.0 login

Claude generates an authorization URL, you approve access in the browser and the tokens are saved automatically. They are valid for 60 days and refreshed automatically.

A background scheduler

The built-in scheduler checks every 30 seconds for posts that are due. It retries a failed post up to 3 times at 5-minute intervals and, on startup, catches up on overdue posts from the last 24 hours.

Solution and implementation

Posts and templates

Posts with text, an image, a video or an article, 12 templates (for example case study, lead magnet, lesson learned) and your own templates with variables.

Images from Gemini

An image generated by Google Gemini Imagen 4 goes straight into the post. A scheduled post can generate its image just before publishing.

Brand voice

Settings for tone, emoji, hashtags and post structure, plus built-in guidance on how the LinkedIn algorithm works.

Manual token mode

If you already have a LinkedIn access token, for example from n8n or another tool, you put it in the configuration and skip the OAuth login.

Results

A profile run from a conversation

Instead of switching between an editor, an image tool and a calendar, you tell Claude what should go out and when.

On-time publishing without babysitting

A scheduled post goes out by itself, and if publishing fails, the server tries again.

Takeaways

MCP instead of another app

Instead of another post scheduling tool, you get the capability inside the AI assistant you already use.

Scope

  • Publishing and editing posts
  • Post scheduling
  • AI images
  • Comments and reactions

Technologies

  • MCP
  • Node.js
  • LinkedIn API
  • Gemini Imagen 4

Open-source project

Language: JavaScript, Node.js. License: MIT.

Installation

claude mcp add --scope user linkedin npx -- -y linkedin-mcp-server \
  -e LINKEDIN_CLIENT_ID=your_client_id \
  -e LINKEDIN_CLIENT_SECRET=your_client_secret

Usage example

After connecting your account (ask: connect my LinkedIn account), ask Claude to schedule a post. Gemini images also need a Gemini key, described in the README.

> Schedule a post about AI automation for Monday 9am with a Gemini-generated image
# linkedin_schedule_create + linkedin_gemini_image

Frequently asked questions

What do I need to get started?

An app in the LinkedIn Developer Portal with the Share on LinkedIn and Sign In with LinkedIn using OpenID Connect products enabled, plus its Client ID and Client Secret. Images need a Gemini key.

Do posts publish when my computer is off?

The scheduler runs together with the MCP server or as a separate process. After a restart it catches up on overdue posts from the last 24 hours.

Can I reply to comments?

Yes. The server has tools to add comments and replies, list comments on a post and add reactions.

Which tools does it work with?

Claude Code and Claude Desktop, as well as other MCP clients.

Can the scheduler run without Claude?

Yes. The scheduler can run as a separate process with npx linkedin-mcp-server --scheduler. It then publishes scheduled posts independently of any AI session.

All case studies