Skip to main content
Glama
LinkedIn MCP Server

LinkedIn MCP Server

by ni-ti-n

LinkedIn MCP Server (Python)

A Model Context Protocol server that lets any MCP client — Amazon Quick, Amazon Q, Claude Desktop, Cline, Continue — publish and manage LinkedIn content in natural language: create posts (text, image, multi-image, video, document, article, poll), upload media, edit/delete, comment, and reshare on a self-serve token. Reactions, engagement reads, and company-Page tools are also built in, gated behind opt-in flags because LinkedIn requires partner approval for them.

By default the server advertises the 10 tools that work on a self-serve token; the 7 partner-scoped tools stay hidden until you opt in (see Feature tiers).

Built with Python + FastMCP, plain LinkedIn REST, and OAuth 2.0. Runs over stdio (local) or streamable HTTP (hosted) from the same codebase.

Unofficial integration. Not affiliated with LinkedIn. Use within LinkedIn's API Terms.


Amazon Quick Desktop vs Amazon Quick Web — read this first

Amazon Quick comes in two forms with different MCP requirements:

Surface

Transport it needs

How to run this server

Amazon Quick Desktop (native app)

Local connector (runs a command) or remote HTTP

Run over stdio (default). Add as a Local connector.

Amazon Quick Web (browser / cloud, aka Quick Suite)

Remote only — streamable HTTP / SSE over HTTPS; stdio not supported

Run over HTTP and host it (e.g. behind Bedrock AgentCore Runtime), then add as a remote MCP connector.

Every other MCP client — Amazon Q Developer CLI, Claude Desktop, Cline, Continue — runs the default stdio server locally, exactly like Quick Desktop.

The transport is a single env var (LINKEDIN_MCP_TRANSPORT=stdio|http) — no code change between the two.


Related MCP server: Postoir

Feature tiers (what your token can actually reach)

The server advertises 10 tools by default — exactly the ones that work on a self-serve token. The other 7 are built in full but hidden behind two default-off flags, because LinkedIn requires partner approval for the scopes they need. Flip a flag only once your app is approved for that program; otherwise those tools would only return a ScopeError.

Flag

Default

Adds

Needs

(none)

—

the 10 self-serve tools below

openid profile email w_member_social

LINKEDIN_ENABLE_SOCIAL_FEED

false

3 reaction/metadata tools

Community Management (*_social_feed)

LINKEDIN_ENABLE_ORG

false

4 organization tools

Marketing/Org scopes + Page admin role

Tool count: default 10 → +SOCIAL_FEED 13 → +ORG 14 → both 17.

✅ Self-serve — advertised by default (10 tools)

Scopes openid profile email w_member_social, granted instantly by adding the Sign In with LinkedIn (OIDC) and Share on LinkedIn products to your app.

Tool

What it does

linkedin_get_profile

Your name, email, picture, and person URN

linkedin_create_post

Text / image / multi-image / video / document / article post

linkedin_create_poll

Poll post (2–4 options, 1/3/7/14-day)

linkedin_reshare_post

Reshare an existing post with commentary

linkedin_update_post

Edit a post's text

linkedin_delete_post

Delete a post

linkedin_upload_image

Upload an image → image URN

linkedin_upload_video

Upload a video → video URN

linkedin_upload_document

Upload a PDF/document → document URN

linkedin_comment

Comment on a post / reply to a comment

⚠️ Community Management — gated behind LINKEDIN_ENABLE_SOCIAL_FEED (3 tools)

Need w_member_social_feed (reactions) / r_member_social_feed (metadata, which LinkedIn marks Restricted — granted to select developers only). Plain w_member_social is not sufficient — these endpoints return 403 until your app is approved for the Community Management API.

Tool

What it does

Scope

linkedin_react

Add a reaction to a post/comment

w_member_social_feed

linkedin_unreact

Remove your reaction

w_member_social_feed

linkedin_get_social_metadata

Like/comment counts + reaction summary

r_member_social_feed

🏢 Organization — gated behind LINKEDIN_ENABLE_ORG (4 tools)

Need Marketing Developer Platform approval or a Page admin role (rw_organization_admin, r_organization_social). Fully implemented; until approved they return a clear ScopeError.

Tool

What it does

linkedin_get_organization

Look up a company Page by org ID

linkedin_find_organization_by_vanity

Find a Page by its URL slug

linkedin_get_org_follower_count

Follower statistics for a Page

linkedin_list_admined_organizations

Pages you can administer

Posting as an organization also works through linkedin_create_post — pass an urn:li:organization:... author URN (needs w_organization_social + a Page role).

Clear errors, not opaque failures. Every tool is wrapped so a LinkedIn error comes back as a structured {error, status, linkedin_response, hint} dict — a missing-scope 403 names the exact permission required instead of failing silently.

No native scheduling. LinkedIn's public Posts API only accepts lifecycleState: PUBLISHED. Scheduling must live in your own layer.


Install

git clone <this-repo>
cd linkedin-mcp-server
python3 -m venv .venv && source .venv/bin/activate
pip install -e .

Get a LinkedIn access token (quickest path)

  1. Create a Company Page (LinkedIn requires every app to be linked to one): linkedin.com/company/setup/new.

  2. Create an app at the Developer Portal linked to that Page.

  3. Products tab → request access to Sign In with LinkedIn using OpenID Connect and Share on LinkedIn (both auto-approved).

  4. Auth tab → add redirect URL https://www.linkedin.com/developers/tools/oauth/redirect (for the token generator) and http://localhost:8765/callback (for this server's interactive login).

  5. Generate a token at the token generator with scopes openid profile email w_member_social (expires in 60 days), or let this server run the interactive login (see Config below).

Configure

Copy .env.example → .env, or set the vars in your MCP client. Two auth modes:

  • Bring your own token (simplest / headless): set LINKEDIN_ACCESS_TOKEN.

  • Interactive OAuth (PKCE): set LINKEDIN_CLIENT_ID (+ LINKEDIN_CLIENT_SECRET if your app is confidential). The server opens a browser on first use and caches the token at ~/.linkedin-mcp/token.json.

Partner-scoped tool groups are off by default. Once LinkedIn approves your app for the relevant program, set LINKEDIN_ENABLE_SOCIAL_FEED=true (reactions / social metadata) and/or LINKEDIN_ENABLE_ORG=true (organization tools) to make them appear. See Feature tiers.


Client setup

Amazon Quick Desktop (Local connector)

Desktop App → Customize → Connectors → Create → Create local connector → Local:

  • Command: /absolute/path/to/.venv/bin/python

  • Arguments: -m linkedin_mcp.server

  • Environment variables: LINKEDIN_ACCESS_TOKEN = your token

Amazon Quick Web (browser / cloud, remote HTTP)

Host the server with LINKEDIN_MCP_TRANSPORT=http behind an HTTPS endpoint (e.g. Bedrock AgentCore Runtime). Then in the Quick console → Connectors → Model Context Protocol (MCP) → set the MCP server endpoint to your https://.../mcp URL and pick an auth method (No Auth / OAuth / S2S).

Amazon Q Developer CLI

q mcp add --name linkedin \
  --command /absolute/path/to/.venv/bin/python \
  --args '["-m", "linkedin_mcp.server"]'
# then set LINKEDIN_ACCESS_TOKEN in the environment / agent config

Claude Desktop / Cline / Continue

{
  "mcpServers": {
    "linkedin": {
      "command": "/absolute/path/to/.venv/bin/python",
      "args": ["-m", "linkedin_mcp.server"],
      "env": { "LINKEDIN_ACCESS_TOKEN": "paste-your-token-here" }
    }
  }
}

Try it

"What's my LinkedIn profile?" → returns your name, email, and person URN. "Post on LinkedIn: Excited to share our new MCP server!" "Upload ~/pic.png and post it with the caption 'Launch day 🚀'." "Reshare urn:li:share:123 with the note 'This is great.'" "Delete my last post."

Development

pip install -e ".[dev]"
pytest           # LinkedIn calls are mocked with respx — no network, no token

Architecture

src/linkedin_mcp/
  server.py          FastMCP app + stdio|http transport
  config.py          env-driven config
  auth.py            OAuth 2.0 PKCE loopback flow + token cache + env fallback
  client.py          REST client: versioned headers, URN encoding, media upload, error mapping
  errors.py          AuthError / ScopeError / APIError + tool_safe (structured-error wrapper)
  tools/
    profile.py       whoami
    posts.py         create / poll / reshare / update / delete
    media.py         image / video / document upload
    social.py        comment (always) + react / unreact / social metadata (LINKEDIN_ENABLE_SOCIAL_FEED)
    organizations.py company tools, gated behind LINKEDIN_ENABLE_ORG

License

MIT

Available Tools

10 tools
linkedin_commentA

Comment on a post, or reply to a comment.

Scope: w_member_social.

Args: actor_urn: Who is commenting (urn:li:person:... or org URN). object_urn: The post URN being commented on. text: The comment body. parent_comment_urn: If replying to a comment, that comment's URN.

Inputs: text (required), actor_urn (required), object_urn (required), parent_comment_urn.

linkedin_create_pollA

Create a poll post with 2–4 options.

Poll content cannot be edited after creation. Do not ask for political opinions, health status, or other sensitive data (LinkedIn policy).

Args: author_urn: The author URN. question: The poll question (used as the post commentary). options: 2 to 4 answer options. duration: ONE_DAY, THREE_DAYS, SEVEN_DAYS, or FOURTEEN_DAYS.

Inputs: options (required), question (required), author_urn (required), duration, +1 more.

linkedin_create_postA

Create a LinkedIn post. Supports text, image, multi-image, video, document, and article/link posts — pick ONE media type per call.

  • Text only: pass just commentary.

  • Image: upload with linkedin_upload_image first, pass its URN in image_urns (1 = single image, 2–20 = multi-image carousel).

  • Video: pass video_urn from linkedin_upload_video.

  • Document: pass document_urn from linkedin_upload_document.

  • Article/link: pass article_url (+ optional title/description); no upload needed.

Args: author_urn: urn:li:person:... (self) or urn:li:organization:... (page). commentary: The post text (an empty string is coerced to a single space). visibility: PUBLIC, CONNECTIONS, or LOGGED_IN. image_urns: Image URNs for an image/multi-image post. image_alt_texts: Optional alt text per image (same order as image_urns). video_urn: A video URN for a video post. document_urn: A document URN for a document post. article_url: A URL for an article/link post.

Inputs: author_urn (required), commentary (required), video_urn, image_urns, +8 more.

linkedin_delete_postC

Delete a post.

Args: post_urn: The post URN to delete.

Inputs: post_urn (required).

linkedin_get_profileA

Get the authenticated member's LinkedIn profile.

Returns name, email, profile picture, locale and — most importantly — the member's person URN (e.g. urn:li:person:abc123), which is the author_urn required by all post-creation tools. Call this first and reuse the URN.

Inputs: no named parameters.

linkedin_reshare_postC

Reshare an existing post, optionally with your own commentary.

Args: author_urn: The resharing author's URN. reshared_post_urn: URN of the post to reshare (urn:li:share:... or urn:li:ugcPost:...). commentary: Optional text to add above the reshare.

Inputs: author_urn (required), reshared_post_urn (required), commentary, visibility.

linkedin_update_postA

Edit an existing post's commentary (text).

LinkedIn's partial-update only supports editing the commentary of an existing post; author, media, and poll content cannot be changed.

Args: post_urn: The post URN (urn:li:share:... or urn:li:ugcPost:...). commentary: New post text.

Inputs: post_urn (required), commentary.

linkedin_upload_documentA

Upload a local document (e.g. PDF) and return its document URN.

Reference the returned urn:li:document:... via document_urn on linkedin_create_post to publish a document/carousel-style post.

Args: author_urn: The owner URN. file_path: Absolute path to a local document (PDF).

Inputs: file_path (required), author_urn (required).

linkedin_upload_imageA

Upload a local image file and return its image URN.

Pass the returned urn:li:image:... to linkedin_create_post as one of image_urns (one image = single-image post, 2–20 = multi-image).

Args: author_urn: The owner URN (urn:li:person:... or urn:li:organization:...). file_path: Absolute path to a local image (PNG/JPG/GIF).

Inputs: file_path (required), author_urn (required).

linkedin_upload_videoB

Upload a local video file and return its video URN.

LinkedIn processes video asynchronously; a freshly uploaded video may take a short while before a post referencing it goes fully live.

Args: author_urn: The owner URN. file_path: Absolute path to a local video (MP4).

Inputs: file_path (required), author_urn (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool targets a distinct resource+action: three upload tools split cleanly by media type (image/video/document), and the post operations (create, create_poll, reshare, update, delete) plus comment and get_profile are mutually exclusive in purpose. Descriptions reinforce the boundaries, e.g. noting that create_post takes exactly one media type.

    Naming Consistency5/5

    Every tool follows a uniform linkedin_verb_noun snake_case pattern (upload_video, create_post, create_poll, reshare_post, update_post, delete_post, get_profile). No mixed conventions or vague verbs appear.

    Tool Count5/5

    Ten tools is well-scoped for the domain: uploads, post lifecycle, engagement, and identity lookup each earn their place with no redundancy or filler.

    Completeness4/5

    Post creation lifecycle (create/update/delete), media uploads, polls, reshares, comments, and profile lookup are all covered, forming a coherent surface. Minor gaps remain: no read/list tools for existing posts or comments, and no reaction/like operations, but core publishing workflows are fully achievable.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables managing social media posts, accounts, and AI-powered content features from any MCP client, including scheduling, publishing, analysis, and AI caption generation.
      14
      23 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP-compatible assistants to manage social publishing workflows, including creating drafts, uploading media, scheduling, publishing, and monitoring delivery.
      11 npm
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables signed-in users to create, edit, and delete their own LinkedIn posts, including text, images, video, documents, or article links, and to list locally tracked posts and check the authenticated account.
      3 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to schedule and publish social media posts across connected channels, manage posts and media, and retrieve channel or post analytics.
      MIT