Skip to main content
Glama
LinkedIn MCP

LinkedIn MCP

LinkedIn MCP

An approval-first Model Context Protocol (MCP) server for authorized LinkedIn workflows. It supports OAuth token exchange, basic OpenID profile retrieval, profile rewrite planning, post drafts, and explicit-approval publishing through LinkedIn's official Posts API.

API limitation: LinkedIn does not generally allow ordinary developer apps to edit a member's headline, About, experience, or skills directly. Those features are draft-and-review workflows unless LinkedIn grants a supported API capability. Access to products and scopes is controlled by LinkedIn.

Features

  • MCP tools usable by compatible LLM clients.

  • OAuth 2.0 authorization-code flow; secrets are read from environment variables.

  • Basic member profile fields through OpenID Connect userinfo.

  • Profile restructuring proposals without pretending to write unsupported fields.

  • Post drafting and explicit-approval publishing through the official API.

  • No browser scraping, password collection, or session-cookie automation.

Related MCP server: LinkedIn MCP Server

Quick start

Requirements: Python 3.11+, a LinkedIn developer app, and access to the products/scopes required for your intended operations.

git clone https://github.com/rohankumbhar-01/linkedin-mcp.git
cd linkedin-mcp
python -m venv .venv
source .venv/bin/activate
pip install -e .
cp .env.example .env

Set LINKEDIN_CLIENT_ID, LINKEDIN_CLIENT_SECRET, and LINKEDIN_REDIRECT_URI in .env. Add the exact redirect URI in the LinkedIn Developer Portal. Do not commit .env or token files.

Run locally:

linkedin-mcp

The default transport is stdio, suitable for local MCP clients. The server also supports MCP_TRANSPORT=streamable-http, but do not expose it publicly until authentication, TLS, and network access controls have been configured. A public MCP endpoint needs its own client authentication and authorization layer; LinkedIn OAuth alone does not protect the MCP endpoint.

OAuth flow

  1. Call linkedin_start_oauth.

  2. Open the returned authorization URL and approve the permissions.

  3. The redirect URL includes code and state. Pass both to linkedin_exchange_code in the same running server session.

  4. Call linkedin_connection_status and linkedin_get_my_profile.

The configured redirect URI must exactly match the LinkedIn developer app setting. Requested scopes only work if the app has the relevant product access. The token is stored in ~/.linkedin-mcp/token.json with owner-only permissions where supported. For production, use a managed secret store or encrypted token storage and add refresh/revocation handling.

MCP tools

Tool

Purpose

linkedin_connection_status

Check token status without revealing it

linkedin_start_oauth

Generate authorization URL and CSRF state

linkedin_exchange_code

Exchange the code and store token

linkedin_get_my_profile

Read basic OpenID profile data

linkedin_draft_profile_changes

Prepare profile rewrite instructions; no writes

linkedin_prepare_post

Prepare a post draft

linkedin_publish_approved_post

Publish only when approved=true

linkedin_get_my_posts

Retrieve your posts when LinkedIn approves r_member_social

linkedin_get_post

Retrieve a specific post by URN where permitted

linkedin_delete_approved_post

Delete a post only with explicit approval and API permission

linkedin_capabilities_and_limits

Report implemented capabilities and API limitations

LinkedIn API access

Before production use, confirm the current supported LINKEDIN_API_VERSION, endpoint payload requirements, and app permissions against the official documentation. API access can vary by app/product approval.

Security checklist before remote hosting

  • Add authentication for MCP clients; never expose an unauthenticated public MCP endpoint.

  • Use HTTPS and a reverse proxy with strict access controls.

  • Store client secrets and tokens in a secret manager or encrypted store.

  • Implement token refresh/revocation and OAuth callback handling appropriate for the deployment.

  • Add audit logging without logging secrets or full tokens.

  • Keep publishing approval explicit and show the exact text before publishing.

  • Add tests and CI before using this with a real LinkedIn account.

Current scope and limitations

This is an initial implementation, not a promise that every LinkedIn action is available. It does not scrape LinkedIn pages or bypass access restrictions. Direct edits to headline, About, work experience, and skills are not implemented because those write operations are not generally available through standard member APIs. The initial OAuth exchange expects the authorization code and state to be submitted manually to the MCP tool; a production deployment should add a dedicated callback flow and state/session persistence.

License

MIT

Available Tools

11 tools
linkedin_capabilities_and_limitsA

Explain which features are implemented and which depend on LinkedIn API approval.

Inputs: no named parameters. Returns: object

linkedin_connection_statusA

Check whether a LinkedIn access token is stored; never returns the token.

Inputs: no named parameters. Returns: object

linkedin_delete_approved_postB

Delete a post only after explicit approval. This is irreversible and depends on LinkedIn API access.

Inputs: approved (required), post_urn (required). Returns: object

linkedin_draft_profile_changesB

Prepare suggested headline/About/experience text. This tool drafts only; it does not edit LinkedIn.

Inputs: skills (required), target_role (required), current_profile (required), achievements. Returns: object

linkedin_exchange_codeA

Exchange an OAuth authorization code for a token after checking the state generated in this session.

Inputs: code (required), state (required). Returns: object

linkedin_get_my_postsB

Retrieve the authenticated member's posts. Requires LinkedIn approval for r_member_social.

Inputs: count, start. Returns: object

linkedin_get_my_profileA

Read the signed-in member's basic OpenID profile fields, if the app has the required permissions.

Inputs: no named parameters. Returns: object

linkedin_get_postC

Retrieve a specific post by its LinkedIn URN, if the app has permission.

Inputs: post_urn (required). Returns: object

linkedin_prepare_postB

Validate and prepare a post for review; does not publish it.

Inputs: text (required), visibility. Returns: object

linkedin_publish_approved_postB

Publish a post through LinkedIn's official Posts API only when the caller explicitly confirms approval.

Inputs: text (required), approved (required), visibility. Returns: object

linkedin_start_oauthA

Create a LinkedIn OAuth authorization URL. Open it and sign in to authorize the app.

Inputs: no named parameters. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 11 tools

    Disambiguation4/5

    Tools map cleanly to distinct steps: the three OAuth tools (status/start/exchange) are sequential and separable, and get_my_posts vs get_post vs delete_approved_post are clearly differentiated. Minor overlap between linkedin_connection_status and linkedin_capabilities_and_limits, and between the two 'draft' tools, but descriptions make the boundaries clear.

    Naming Consistency4/5

    Every name uses the linkedin_ prefix with snake_case and mostly verb_noun structure (start_oauth, exchange_code, get_my_profile, prepare_post, publish_approved_post). A couple of names are noun phrases (connection_status, capabilities_and_limits), a small but readable deviation.

    Tool Count5/5

    11 tools is well within the ideal range and each earns its place: three auth steps, profile read/draft, and a full post draft-publish-read-delete lifecycle. No filler or redundant tools.

    Completeness3/5

    Auth, profile read, and the post lifecycle are covered, but linkedin_draft_profile_changes is a dead end with no corresponding apply/publish tool, and there is no token refresh, revoke/logout, or engagement (comment/reaction) surface. Some gaps are attributable to documented LinkedIn API restrictions, but agents still hit walls.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to interact with LinkedIn using the official API for profile access, company management, and job postings.
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to audit professional profiles, check policy compliance, preview posts, and publish explicitly confirmed text posts through LinkedIn's official API.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables ChatGPT to connect to LinkedIn via OAuth and perform authorized actions like posting, commenting, replying, and analyzing profile/content with user approval.
      MIT