Skip to main content
Glama
LinkedIn MCP Server

LinkedIn MCP Server

LinkedIn MCP Server

npm version License: MIT

A Model Context Protocol (MCP) server that provides AI agents with read/write access to the LinkedIn API.

Features

  • Profile Tools: Fetch user profile and email.

  • Post Tools: Create text, link, image, and document posts. Delete posts.

  • Media Tools: Upload images and documents to LinkedIn.

  • Organization Tools: Fetch organization details, post on behalf of an organization, fetch and delete org posts.

  • Social Action Tools: Fetch, create, and delete comments on posts. Add or remove reactions (like, celebrate, etc.).

  • Organization Analytics Tools: Get organization page, follower, and share statistics.

Related MCP server: LinkedIn MCP Server

Prerequisites

You need a LinkedIn Access Token. Create an app on the LinkedIn Developer Portal, then either:

  • Use the built-in OAuth flow (see Development Setup), or

  • Generate a token manually from the developer portal.

The easiest way to use this server is via the published npm package. No cloning required.

Install globally

npm install -g @himanshu31shr/linkedin-mcp-server

Then run it:

LINKEDIN_ACCESS_TOKEN=your-token linkedin-mcp-server

Or run directly with npx

LINKEDIN_ACCESS_TOKEN=your-token npx -y @himanshu31shr/linkedin-mcp-server

MCP Client Configuration

Claude Desktop

Add the following to your claude_desktop_config.json:

Using npx (no install needed):

{
  "mcpServers": {
    "linkedin": {
      "command": "npx",
      "args": ["-y", "@himanshu31shr/linkedin-mcp-server"],
      "env": {
        "LINKEDIN_ACCESS_TOKEN": "your-linkedin-access-token"
      }
    }
  }
}

Using a global install:

{
  "mcpServers": {
    "linkedin": {
      "command": "linkedin-mcp-server",
      "env": {
        "LINKEDIN_ACCESS_TOKEN": "your-linkedin-access-token"
      }
    }
  }
}

Using a local clone:

{
  "mcpServers": {
    "linkedin": {
      "command": "node",
      "args": ["/path/to/linkedin-mcp-server/dist/index.js"],
      "env": {
        "LINKEDIN_ACCESS_TOKEN": "your-linkedin-access-token"
      }
    }
  }
}

Cursor

In Cursor's Settings > AI > MCP Servers, add a new server:

  • Type: command

  • Name: linkedin

  • Command: npx -y @himanshu31shr/linkedin-mcp-server

  • Environment Variables: Add LINKEDIN_ACCESS_TOKEN with your token.

Antigravity / Windsurf / Other MCP Clients

Use the same pattern — point the MCP client to:

npx -y @himanshu31shr/linkedin-mcp-server

And set the LINKEDIN_ACCESS_TOKEN environment variable.

Available Tools

Tool

Description

get_profile

Fetch the authenticated user's LinkedIn profile

get_email

Fetch the authenticated user's email address

create_text_post

Create a text-only post

create_link_post

Create a post with a link attachment

create_image_post

Create a post with an image

create_document_post

Create a post with a document (PDF, etc.)

delete_post

Delete a post by URN

upload_image

Upload an image to LinkedIn

get_organization

Fetch organization details

create_org_post

Create a post on behalf of an organization

get_org_posts

Fetch recent posts for an organization

delete_org_post

Delete an organization post

get_post_comments

Fetch comments on a post

create_comment

Add a comment to a post

delete_comment

Delete a comment

add_reaction

Add a reaction to a post

remove_reaction

Remove a reaction from a post

get_org_page_statistics

Get organization page statistics

get_org_follower_statistics

Get organization follower statistics

get_org_share_statistics

Get organization share statistics

Development Setup

If you want to contribute or run from source:

  1. Clone and install:

    git clone https://github.com/himanshu31shr/linkedin-mcp-server.git
    cd linkedin-mcp-server
    npm install
  2. Build:

    npm run build
  3. Get a LinkedIn Access Token (automated OAuth flow):

    npm run auth

    Follow the prompts — this will save your LINKEDIN_ACCESS_TOKEN to the .env file automatically.

  4. Run locally:

    npm run dev

Scripts

Script

Description

npm run build

Compile TypeScript to JavaScript

npm run dev

Run in development mode with tsx

npm run auth

Run the OAuth token flow

npm test

Run tests with Vitest

npm run test:coverage

Run tests with coverage report

npm run lint

Type-check with TypeScript

npm run inspect

Launch MCP Inspector for debugging

Releasing a New Version

The CD pipeline automatically publishes to npm when a version tag is pushed.

# Bump version (creates commit + tag automatically)
npm version patch   # or: npm version minor / npm version major

# Push commit and tag to trigger publish
git push origin main --tags

The pipeline will:

  1. Validate the tag matches package.json version

  2. Run lint, tests, and build

  3. Publish to npm with provenance

  4. Create a GitHub Release with auto-generated notes

License

MIT

Available Tools

20 tools
add_reactionB

Add a reaction (like, celebrate, etc.) to a LinkedIn post

Inputs: postUrn (required), reactionType (required).

create_commentB

Add a comment to a LinkedIn post

Inputs: postUrn (required), text (required), authorUrn.

create_document_postC

Create a post with a document (PDF, etc.) on LinkedIn

Inputs: text (required), documentUrl (required), title, visibility.

create_image_postC

Create a post with an image on LinkedIn

Inputs: text (required), imageUrl (required), altText, visibility.

create_link_postC

Create a post with a link/article on LinkedIn

Inputs: text (required), linkUrl (required), linkTitle, visibility.

create_org_postC

Create a post on behalf of a LinkedIn organization

Inputs: organizationId (required), text (required), visibility, linkUrl, +1 more.

create_text_postB

Create a text-only post on LinkedIn

Inputs: text (required), visibility.

delete_commentB

Delete a comment from a LinkedIn post

Inputs: commentUrn (required).

delete_org_postA

Delete a LinkedIn organization post by its URN

Inputs: postUrn (required).

delete_postA

Delete a post from LinkedIn by its URN

Inputs: postUrn (required).

get_emailB

Get the authenticated user's LinkedIn email address

Inputs: no named parameters.

get_organizationB

Get LinkedIn organization details by ID or vanity name

Inputs: organizationId, vanityName.

get_org_follower_statisticsC

Get follower statistics for a LinkedIn organization

Inputs: organizationId (required).

get_org_page_statisticsB

Get page view statistics for a LinkedIn organization

Inputs: organizationId (required), timeRange.

get_org_postsC

Get recent posts from a LinkedIn organization

Inputs: organizationId (required), count, start.

get_org_share_statisticsB

Get share/post engagement statistics for a LinkedIn organization

Inputs: organizationId (required), shareUrns.

get_post_commentsB

Get comments on a LinkedIn post

Inputs: postUrn (required), count, start.

get_profileA

Get the authenticated user's LinkedIn profile including name, email, picture, and unique ID

Inputs: no named parameters.

remove_reactionA

Remove a reaction from a LinkedIn post

Inputs: postUrn (required), reactionType (required).

upload_imageA

Upload an image to LinkedIn from a URL and get an image URN for use in posts

Inputs: imageUrl (required), altText.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 20 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: post creation is split by content type, reactions, comments, profile info, and organization analytics are separate. No overlapping functionality.

    Naming Consistency4/5

    Most tools follow verb_noun pattern, but there is minor inconsistency: 'add_reaction' vs 'create_comment', and deletion tools are not parallel (delete_post vs delete_org_post). Overall, the pattern is predictable.

    Tool Count5/5

    20 tools cover a broad range of LinkedIn operations without feeling excessive. Each tool has a specific role, and the count is appropriate for the server's scope.

    Completeness2/5

    Significant gaps exist: no tools to retrieve the user's own posts, list a feed, or view reactions. CRUD is incomplete for posts (no read) and reactions (no get). Agents would struggle to perform common workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers