npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sindhujaks/linkedin-mcp

v1.0.0

Published

MCP server for posting, commenting, and reading analytics on LinkedIn — for your personal profile and any company page you administer.

Readme

linkedin-mcp

An MCP (Model Context Protocol) server that lets an AI agent post, comment, and read analytics on LinkedIn — for your personal profile, and optionally a company page you administer.

Point Claude (or any MCP-compatible agent) at this server and it can:

  • post_to_profile — publish a post to your personal LinkedIn profile
  • post_to_company_page — publish a post to a company page you administer
  • comment_on_post — comment on a post as your profile or a company page
  • get_recent_posts — list recent posts with their URNs, so the agent can find something to comment on or check analytics for
  • get_post_analytics — impressions, reactions, comments, shares, and clicks for a post

Nothing here talks to LinkedIn except LinkedIn's own official REST API. Your access token stays local, in a .env file you control.


1. Create a LinkedIn Developer App

  1. Go to linkedin.com/developers/apps and create a new app.
  2. Under Products, add:
    • Sign In with LinkedIn using OpenID Connect — lets you look up your own person URN
    • Share on LinkedIn — gives you w_member_social, the scope that lets you post and comment as yourself
  3. If you also want company page posting and analytics, add the product that grants w_organization_social / r_organization_social on your app (LinkedIn calls this the Community Management API in newer developer accounts, Marketing Developer Platform in older ones). This product is gated — you apply for access from the app's Products tab, and LinkedIn reviews the request. Skip this if you only want personal posting; post_to_profile, comment_on_post, and get_recent_posts/get_post_analytics for your profile all work without it.

2. Run the OAuth 2.0 flow to get an access token

LinkedIn uses the standard OAuth 2.0 authorization code flow.

Authorize (open in a browser, replace CLIENT_ID and REDIRECT_URI with your app's values):

https://www.linkedin.com/oauth/v2/authorization
  ?response_type=code
  &client_id=CLIENT_ID
  &redirect_uri=REDIRECT_URI
  &scope=openid%20profile%20w_member_social

Add %20r_organization_social%20w_organization_social to the scope if you added company page access in step 1.

LinkedIn redirects you to REDIRECT_URI?code=AUTH_CODE. Grab AUTH_CODE from that URL.

Exchange the code for an access token:

curl -X POST https://www.linkedin.com/oauth/v2/accessToken \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=authorization_code" \
  -d "code=AUTH_CODE" \
  -d "redirect_uri=REDIRECT_URI" \
  -d "client_id=CLIENT_ID" \
  -d "client_secret=CLIENT_SECRET"

The response includes access_token. It's valid for 60 days — after that, repeat this flow to refresh it.

3. Get your person URN

curl https://api.linkedin.com/v2/userinfo \
  -H "Authorization: Bearer ACCESS_TOKEN"

The sub field in the response is your person ID. Your person URN is urn:li:person:SUB_VALUE.

4. (Optional) Get your organization URN

Only needed for company page features:

curl "https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee" \
  -H "Authorization: Bearer ACCESS_TOKEN"

Find your organization's ID in the response; the URN is urn:li:organization:ORG_ID.

5. Install

Option A — npm package:

npm install -g @sindhujaks/linkedin-mcp

Option B — clone and build:

git clone https://github.com/sindhujaIBM/linkedin-mcp.git
cd linkedin-mcp
npm install
npm run build

6. Configure your credentials

If you installed via npm, create a .env file in the directory you'll run the server from (see .env.example in this repo for the template). If you cloned the repo:

cp .env.example .env

Fill in LINKEDIN_ACCESS_TOKEN and LINKEDIN_PERSON_URN from steps 2–3. Add LINKEDIN_ORGANIZATION_URN if you did step 4.

7. Add it to Claude

Claude Code (npm install):

claude mcp add linkedin -- linkedin-mcp

Claude Code (cloned repo):

claude mcp add linkedin -- node /absolute/path/to/linkedin-mcp/dist/index.js

Claude Desktop — add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "linkedin": {
      "command": "linkedin-mcp"
    }
  }
}

(Or "command": "node", "args": ["/absolute/path/to/linkedin-mcp/dist/index.js"] if you cloned the repo instead of installing via npm.)

Restart Claude, and the five tools above will be available. You can then just ask, in plain language: "post this to my LinkedIn profile," or "comment 'thanks for reading' on my most recent post," or "how did my last post do?"


Notes

  • Access tokens expire after 60 days. When yours does, tool calls will fail with an auth error — re-run the OAuth flow in step 2 and update .env.
  • post_to_company_page, and using as: "company" on the other tools, all require LINKEDIN_ORGANIZATION_URN to be set — otherwise they return a clear error telling you what's missing.
  • This uses LinkedIn's /v2/ugcPosts and related endpoints. LinkedIn occasionally changes API versioning requirements for newer developer apps; if a call fails with a version-related error, check LinkedIn's API versioning docs for the current required header.

License

MIT