Repository avatar
AI Tools
v0.2.0
active

linkedin-mcp

io.github.davidchimbueze/linkedin-mcp

39-tool LinkedIn MCP server with local Chrome, encrypted sessions, and /in/me guardrails.

Documentation

Universal LinkedIn MCP Server

Model Context Protocol Python 3.10+ Tools: 39 CI Glama MCP Server License: MIT

A Model Context Protocol (MCP) server that connects AI assistants (Claude, Grok, Cursor, Windsurf, Antigravity) to your LinkedIn account using your local Google Chrome browser, encrypted session storage, and strict /in/me account-boundary guardrails.


Prerequisites

  1. Google Chrome installed on your machine.
  2. Python 3.10+ (python.org/downloads).
  3. uv package runner:
    • Windows (PowerShell): powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    • macOS / Linux: curl -LsSf https://astral.sh/uv/install.sh | sh

Step 1: One-Time Login

Log in once interactively so your encrypted session is saved to ~/.linkedin_mcp:

uvx --from git+https://github.com/davidchimbueze/linkedin-mcp python -c "import asyncio; from linkedin_mcp.tools.auth import linkedin_start_login; asyncio.run(linkedin_start_login())"
  1. A Google Chrome window opens to LinkedIn's login page.
  2. Sign in and complete any 2FA or verification prompt.
  3. Once your feed loads, your encrypted session is saved and the browser closes automatically.

Step 2: Connect Your AI Client

Option A: Desktop AI Clients (stdio via uvx)

Add the following linkedin server entry to your client's MCP config:

{
  "mcpServers": {
    "linkedin": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/davidchimbueze/linkedin-mcp",
        "linkedin-mcp"
      ]
    }
  }
}

Where to paste this config:

  • Claude Desktop:
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  • Antigravity: Settings → MCP (mcp_config.json)
  • Cursor: .cursor/mcp.json (project) or global MCP settings
  • Windsurf: ~/.codeium/windsurf/mcp_config.json

Claude Code CLI:

claude mcp add linkedin -- uvx --from git+https://github.com/davidchimbueze/linkedin-mcp linkedin-mcp

Option B: Cloud Web AI (Grok.com / Streamable HTTP)

Remote web clients need a public HTTPS URL with Bearer token authentication:

git clone https://github.com/davidchimbueze/linkedin-mcp.git
cd linkedin-mcp
  • Windows (PowerShell):
    powershell -ExecutionPolicy Bypass -File .\run_for_grok.ps1
    
  • macOS / Linux:
    # Terminal 1: Start Streamable HTTP server
    uv run linkedin-mcp --transport streamable-http --port 8765
    
    # Terminal 2: Expose via Cloudflare Tunnel
    cloudflared tunnel --url http://127.0.0.1:8765
    

In grok.com/connectors, add a Custom MCP Server using the tunnel URL and the Bearer token printed in your terminal (stored in ~/.linkedin_mcp/auth_token):

  • URL: https://<your-tunnel>.trycloudflare.com/mcp?token=<YOUR_AUTH_TOKEN> (or pass Authorization: Bearer <YOUR_AUTH_TOKEN>)

[!TIP] Always use /mcp (Streamable HTTP) rather than /sse when tunneling through Cloudflare quick tunnels.


Option C: Local Development

git clone https://github.com/davidchimbueze/linkedin-mcp.git
cd linkedin-mcp
uv sync

Point your MCP client to your local checkout:

{
  "mcpServers": {
    "linkedin": {
      "command": "uv",
      "args": ["--directory", "<ABSOLUTE_PATH_TO_LINKEDIN_MCP>", "run", "linkedin-mcp"]
    }
  }
}

Configuration (Optional Environment Variables)

VariableDefaultDescription
LINKEDIN_MCP_DATA_DIR~/.linkedin_mcpDirectory for encrypted session, keys, and rate limits.
LINKEDIN_HEADLESStrueRun Chrome headlessly (false to watch browser actions).
LINKEDIN_BROWSER_CHANNELchromeBrowser channel passed to Playwright.
LINKEDIN_BROWSER_IDLE_TIMEOUT_S300Seconds before idle warm browser context closes.
LINKEDIN_TIMEZONE_ID(host default)Optional browser timezone override.
LINKEDIN_MCP_AUTH_TOKEN(auto-generated)Bearer token required for HTTP/SSE transports.
LINKEDIN_MCP_ALLOWED_ORIGINShttps://grok.com,https://x.comComma-separated allowed CORS origins.
LINKEDIN_MAX_DAILY_INVITES20Daily cap for send_connection_request.
LINKEDIN_MAX_DAILY_MESSAGES30Daily cap for send_message.
LINKEDIN_MAX_DAILY_POSTS10Daily cap for posts, polls, and reposts.
LINKEDIN_MAX_DAILY_COMMENTS25Daily cap for comment_on_post.

Available MCP Tools (39 Tools)

All tools enforce @require_auth and operate strictly within your authenticated account.

CategoryTool NameKey ArgumentsDescription
Auth & Sessioncheck_login_status(none)Checks session validity, active identity, and sliding-window health.
start_logintimeout_secondsOpens Chrome for interactive sign-in and 2FA.
logout(none)Clears stored session credentials, cookies, and cached identity.
refresh_session(none)Runs a silent heartbeat to renew LinkedIn's 30-day session window.
Self-Profileget_my_profile(none)Reads your authenticated profile details.
(Locked to /in/me)update_my_headlineheadlineUpdates your profile headline.
update_my_aboutsummaryUpdates your About summary.
add_educationschool, degree, field_of_study, start_year, end_year
Show all 10 argsschool, degree, field_of_study, start_month, start_year, end_month, end_year, grade, activities, description
Adds an education entry.
add_experiencetitle, company, employment_type, location, description
Show all 11 argstitle, company, employment_type, location, location_type, is_current, start_month, start_year, end_month, end_year, description
Adds a work experience entry.
add_skillskill_nameAdds a skill to your profile.
add_projecttitle, description, url, start_year, end_yearAdds a project to your profile.
update_job_preferencesjob_titles, location_types, locations, employment_typesUpdates "Open to work" preferences.
update_my_servicesservices_to_add, services_to_remove, descriptionUpdates your Services section.
Browsing & Searchsearch_peoplekeywords, location, current_company, limitSearches LinkedIn members with connection degree badges.
view_profileprofile_urlReads a member's profile (read-only).
view_companycompany_urlReads a LinkedIn Company Page (overview, industry, size, HQ).
Jobs & Careerssearch_jobskeywords, location, remote_filter, experience_level, limitSearches LinkedIn Jobs with workplace and level filters.
get_job_detailsjob_urlExtracts full job description and metadata.
save_jobjob_urlBookmarks a job to your Saved Jobs list.
Feed, Posts & Pollsget_feedlimitReads recent posts from your home feed.
read_postpost_url, include_comments, comment_limitReads a post or Pulse article by URL (read-only).
search_postskeywords, sort_by, limitSearches LinkedIn posts by keyword or hashtag.
create_posttext, media_path, dry_runPublishes a post (supports image/PDF attachment and dry_run).
create_pollquestion, options, duration, dry_runPublishes a poll (2–4 options, supports dry_run).
comment_on_postpost_url, comment_text, dry_runComments on a post (supports dry_run).
react_to_postpost_url, reaction_typeReacts to a post (like, celebrate, support, love, insightful, funny).
repost_with_thoughtspost_url, commentary, dry_runReposts with commentary (supports dry_run).
Analyticsget_post_analyticslimitFetches impressions, reactions, and comments for your recent posts.
get_profile_views(none)Fetches profile view counts and viewer demographics.
Messaginglist_conversationslimitLists recent inbox conversation threads.
get_conversation_messagesrecipient_name, limitReads message history for a specific conversation.
send_messagerecipient_profile_url, message_text, dry_runSends a direct message (supports dry_run).
Networksend_connection_requestprofile_url, custom_note, dry_runSends a connection invite (supports dry_run).
get_pending_invitations(none)Lists pending incoming connection invitations.
manage_invitationsender_name, actionAccepts or ignores a pending invitation.
withdraw_connection_requestprofile_urlWithdraws a pending outgoing invitation.
endorse_skillprofile_url, skill_nameEndorses a skill on a 1st-degree connection's profile.
Agentic Skillsget_network_briefinglimitGenerates a digest of inbox, invitations, analytics, and feed trends.
analyze_profile_strength(none)Audits profile completeness and suggests improvements.

Security & Privacy

  • No Password Storage: Authentication is interactive via Chrome; passwords are never read or stored.
  • Encrypted Local State: storage_state.json is encrypted at rest with Fernet (~/.linkedin_mcp/.session.key).
  • Authenticated Remote Access: HTTP/SSE transports require a Bearer token and restrict CORS origins.
  • Safety Guardrails: Self-profile edits are hard-locked to /in/me/, high-risk actions support dry_run=True and daily rate limits, and external read responses include untrusted-content notices.

Testing

uv run python -m unittest discover tests

Changelog & License

PYPI
davidchimbueze-linkedin-mcp
Install Command
pip install davidchimbueze-linkedin-mcp