Skip to main content
Glama
linkedin-post-mcp

linkedin-post-mcp

by 4nd3r5on

linkedin-post

A wrapper around mcp-server-linkedin (Apache-2.0) that adds two tools: create_post and delete_post. MIT licensed.

It isn't a fork. The upstream package is a pinned dependency (==4.29.0) and runs unchanged. This project only registers extra tools next to upstream's.

Features

  • All upstream tools (profiles, jobs, feed, messaging, ...) work as before.

  • create_post(text, confirm_post) publishes a text post to your feed.

    • confirm_post: false is a dry run: the text is inserted and then the draft is discarded.

    • The post goes out with the share dialog's current audience (normally "Anyone"), and the result reports which one was used.

    • The result's status is posted, dry_run, outcome_unknown, invalid_text, editor_not_found or insert_failed. retry_safe: false means Post was clicked, so check the feed before calling again.

    • On a failure, trace_dir points at upstream's trace run (screenshot, URL, page title) under ~/.linkedin-mcp/trace-runs/. LINKEDIN_TRACE_MODE=off disables it.

  • delete_post(post, confirm_delete) deletes one of your own posts. This can't be undone.

    • post is a post URL (including post_url from create_post) or a URN like urn:li:activity:<id>.

    • confirm_delete: false is a dry run that only checks the post exists and is yours.

    • It uses the post's "..." menu and LinkedIn's own confirmation. Someone else's post returns not_deletable.

Related MCP server: linkedin-mcp-server

Architecture

Hexagonal (ports and adapters):

src/linkedin_post/
  domain/
    entities/        PostText (validate + normalize), PostRef (URL/URN -> post page),
                     PublishResult / DeleteResult (status, posted/deleted, retry_safe)
    ports/primary/   Posting: create_post, delete_post
    ports/secondary/ SessionGate, PostComposer, PostRemover
    services/        PostingService: validate first, open the browser only for valid input
  adapters/
    primary/         FastMCP tools (create_post, delete_post)
    secondary/       upstream session gate, share-dialog composer, post remover, failure trace
  composition/       wiring, and the hook that adds our tools next to upstream's post tools
  common/            LinkedIn URLs
tests/               domain, service (with fake ports), MCP tools, remover in Chromium,
                     upstream hook

What comes from upstream instead of our own code:

  • Session: signed-in Patchright browser (get_ready_extractor, get_or_create_browser).

  • Text rules: normalize_message_text and _refused_character.

  • Post URL/URN parsing: feed_payload.permalink_paths_from_payload.

  • Failure diagnostics: debug_trace.record_page_trace and mark_trace_for_retention.

  • Error handling: tool_errors.

  • Text insertion: execCommand('insertText'), adapted from upstream's message_sender.py (Apache-2.0).

  • No private APIs: no Voyager calls and no cookie replay, only the real web UI.

This relies on internal upstream names, so the version is pinned. Re-check composition/upstream.py and the adapters before bumping it; uv run pytest checks the hook.

Development

uv sync
uv run ruff check .          # every ruff rule (select = ["ALL"]), see pyproject.toml
uv run ruff format --check .
uv run pytest                # the remover test runs in a headless Chromium

With Nix, nix develop gives Python 3.12, uv and ruff, and runs uv sync for you.

CI (.github/workflows/ci.yml) runs the same on Python 3.12, 3.13 and 3.14. Ruff is pinned because ALL picks up new rules on every upgrade; bump it on purpose and fix what it finds.

Setup

Replace the original linkedin server. Only one process can own the browser profile, and a second copy would forward its tools to the first one without create_post.

claude mcp remove linkedin -s user
claude mcp add linkedin -s user -- uv run --directory ~/Projects/linkedin-post linkedin-post-mcp --no-auto-import

Then reconnect with /mcp.

Remove

Restore the original server:

claude mcp remove linkedin -s user
claude mcp add linkedin -s user -e UV_HTTP_TIMEOUT=300 -- uvx mcp-server-linkedin@latest --no-auto-import

Available Tools

26 tools
archive_conversationArchive ConversationA
Idempotent

Archive one LinkedIn messaging thread, InMail included, by thread ID.

Opens the thread, which marks it read, and chooses Archive from its options menu. A thread LinkedIn already files as archived is left alone and reported already_archived, so a repeated call clicks nothing. The change is confirmed by loading the thread again. Reversible on LinkedIn; a new message moves the thread back to the inbox.

Inputs: thread_id (required). Returns: object

close_sessionClose SessionA
Destructive

Close the current browser session and clean up resources.

Inputs: no named parameters. Returns: object

connect_with_personConnect With PersonA
Destructive

Send a LinkedIn connection request or accept an incoming one.

The tool is annotated with destructiveHint so MCP clients will prompt for user confirmation before execution.

Inputs: linkedin_username (required), note. Returns: object

create_postCreate PostA

Publish a post, optionally with images, to the signed-in user's LinkedIn feed.

Opens LinkedIn's share dialog, inserts the text, attaches the images and clicks Post. The post uses the dialog's current visibility ("Post to Anyone" by default), which is returned as visibility. With confirm_post False this is a dry run: the text is inserted, then the draft is discarded and nothing is published.

Inputs: text (required), confirm_post (required), images. Returns: object

delete_postDelete PostA
Destructive

Delete one of the signed-in user's LinkedIn posts. Cannot be undone.

Opens the post, uses its "..." menu and LinkedIn's own confirmation. Only works on the user's own posts; anyone else's has no Delete item and returns not_deletable. With confirm_delete False this is a dry run that checks the post exists and is deletable.

Inputs: post (required), confirm_delete (required). Returns: object

dismiss_jobDismiss JobA
DestructiveIdempotent

Dismiss a job from LinkedIn job search so later searches never show it.

For jobs already applied to or rejected. Reads the job's title and company from its posting, clicks the dismiss button on its card in a worldwide search for them, then reloads that search to confirm the job is gone. Irreversible: LinkedIn offers no undo after a reload. A job that search does not list on its first page is an error, since an already dismissed job and a search that missed it look the same.

Inputs: job_id (required). Returns: object

get_company_employeesGet Company EmployeesA
Read-only

List employees at a company from the LinkedIn /people/ page, including the demographics aggregate that this view exposes: where employees live, where they studied, and a function breakdown (Engineering, Sales, Operations, etc.). The demographics are unique to this tool.

For filtered search by network degree (1st/2nd/3rd) or location, prefer search_people with current_company set to the company URN id. That path also returns more result pages than the /people/ tab.

The optional keywords filter narrows results by name, title, or skill.

company_name must be the exact LinkedIn URL slug (the path segment after /company/), not the display name. LinkedIn assigns unique slugs and the display name often does not match. For example, the AI lab Anthropic lives at /company/anthropicresearch/, not /company/anthropic/. If you are unsure of the slug, call search_companies first and pick the slug from the returned references.

Inputs: company_name (required), keywords. Returns: object

get_company_postsGet Company PostsC
Read-only

Get recent posts from a company's LinkedIn feed.

Inputs: company_name (required), max_scrolls. Returns: object

get_company_profileGet Company ProfileC
Read-only

Get a specific company's LinkedIn profile.

Inputs: company_name (required), sections. Returns: object

get_conversationGet ConversationA

Read a specific messaging conversation.

Provide either linkedin_username or thread_id to identify the conversation.

When looked up by linkedin_username, resolution searches the messaging inbox for the participant's display name and click-visits every matching row to capture its thread ID — LinkedIn's sidebar has no anchor hrefs or thread-id attributes, so this is the only available path. Each visit selects the row in the LinkedIn UI and may mark it as read. Pass thread_id directly to skip this enumeration.

Username resolution scans matching rows from a requested compose page first. Its indexable sequence ends before the first unresolved click, missing matching click target, or admitted row that fails the existing exact display-name check. An index outside that verified prefix is refused with its reason. Search is a fallback only when the inbox scan has no observed matching result and no such barrier; it never substitutes a result after a stopped or gapped inbox scan. Pass a known thread_id to bypass username/index resolution.

Inputs: index, thread_id, linkedin_username. Returns: object

get_easy_apply_formGet Easy Apply FormA
Idempotent

Read the questions of a job posting's Easy Apply form, without answering them.

Opens Easy Apply and reads each step: every field's label, type, whether it is required, its options, character limit and prefilled value. Next is clicked only while LinkedIn accepts a step on its prefilled values, so the first step that needs input ends the read. Nothing is typed, Review and Submit are never clicked, and the dialog is closed with its draft discarded.

Inputs: job_id (required). Returns: object

get_feedGet FeedA
Read-only

Get posts from the authenticated user's LinkedIn feed.

Inputs: num_posts. Returns: object

get_inboxGet InboxC
Read-only

List recent conversations from the LinkedIn messaging inbox.

The returned inbox text and result URL come from the ordinary messaging inbox. Click-derived conversation references are collected separately after requesting the compose page, which avoided inbox auto-opening on the measured variant. A row contributes a click-derived reference only after its click is followed by an observed different thread path. The scan stops at its first unverifiable click. section_errors.inbox reports that stop or unavailable scan rows; captured inbox text and independently extracted anchors retain their normal handling. A known thread_id can bypass row attribution when calling get_conversation.

Inputs: limit. Returns: object

get_job_apply_urlGet Job Apply URLA
Read-only

Get how a job posting takes applications, and the employer's application link.

Reads the posting without clicking anything.

Inputs: job_id (required). Returns: object

get_job_detailsGet Job DetailsA
Read-only

Get job details for a specific job posting on LinkedIn.

Inputs: job_id (required). Returns: object

get_my_profileGet My ProfileA
Read-only

Get the authenticated user's own LinkedIn profile.

Navigates to /in/me/ and resolves the redirect to obtain the real username before reading the profile, so the url field in the result is the actual profile URL (e.g. linkedin.com/in/johndoe/) rather than /in/me/.

Inputs: sections, max_scrolls. Returns: object

get_person_profileGet Person ProfileC
Read-only

Get a specific person's LinkedIn profile.

Inputs: linkedin_username (required), sections, max_scrolls. Returns: object

get_saved_jobsGet Saved JobsA
Read-only

List the authenticated user's jobs at one stage of LinkedIn's job tracker.

Returns job_ids that can be passed to get_job_details for full info.

Inputs: stage, max_pages. Returns: object

get_session_statusGet Session StatusA
Read-only

Report local saved-session and serving-process state for requested diagnostics.

Reads local observations without opening a browser, starting setup or login, or contacting LinkedIn. Stored files do not prove current authentication. In shared-browser mode these observations belong to the owner, not to a frontend running a login. It answers during browser work without refreshing the browser idle timer. Use ordinary LinkedIn tools directly for their requested work rather than adding a status preflight.

Inputs: no named parameters. Returns: object

get_sidebar_profilesGet Sidebar ProfilesA
Read-only

Get profile links from sidebar recommendation sections on a LinkedIn profile page.

Extracts profiles from "More profiles for you", "Explore premium profiles", and "People you may know" sidebar sections. Follows "Show all" links to return the full list from each section. Sections that redirect to linkedin.com/premium are skipped.

Inputs: linkedin_username (required). Returns: object

search_companiesSearch CompaniesB
Read-only

Search for companies on LinkedIn.

Inputs: keywords (required). Returns: object

search_conversationsSearch ConversationsC

Search messages by keyword.

Click-derived references require an observed different thread path after each row click. The first unverifiable click stops further row clicks and is reported in section_errors.search_results. Already-read text and independently extracted anchors retain their normal handling. A result without that diagnostic does not guarantee that every conversation was enumerated.

Inputs: keywords (required), limit. Returns: object

search_jobsSearch JobsA
Read-only

Search for jobs on LinkedIn.

Returns job_ids that can be passed to get_job_details for full info.

LinkedIn is moving accounts to a redesigned job search, which keeps only the keywords, date_posted and paging. It drops the filters marked "Classic search only" and reports them in section_errors as filters_dropped. When it drops the location or work type, search again with them in the keywords ("remote python developer in Lyon") and keep doing so; words such as "senior" or "internship" there narrow the results too. Quotes do not make a phrase exact on that search.

Inputs: keywords (required), sort_by, job_type, location, +5 more. Returns: object

search_peopleSearch PeopleC
Read-only

Search for people on LinkedIn.

Inputs: keywords (required), network, location, current_company. Returns: object

search_postsSearch PostsA
Read-only

Search LinkedIn posts/content globally by keyword (the "Posts" tab).

Use this to catch informal hiring posts ("we're hiring", "Buscamos ...", "estamos contratando", "join our team") that often appear before a formal job listing exists. This is global content search, distinct from get_feed (your own home feed) and get_company_posts (one company's page).

Inputs: keywords (required), max_pages, date_posted, content_type. Returns: object

send_messageSend MessageA
Destructive

Compose and send a new message to a LinkedIn user.

Profile-based targeting opens LinkedIn's compose flow. It is not a safe reply path for an existing recruiter/InMail or messaging thread: it may create a separate DM even after you inspect that thread with get_conversation or search_conversations. Those tools only read an existing thread; they do not send a reply. Until a thread-targeted send path is available, do not treat profile-based send_message as a reply.

The recipient must be directly messageable from the profile page. If LinkedIn does not expose a normal Message action, use connect_with_person first, then retry send_message only after the connection request is accepted. A status of enter_to_send_enabled means the account has LinkedIn's "Press Enter to Send" preference on, which hides the Send button; relay the returned instructions to the user, who switches it to "Click Send to send" before retrying. The dry run (confirm_send False) reports it too. Recipient authorization comes from validating one recipient-specific Message action carrying the target URN, then following its browser navigation and pinning the exact final route. Visible profile links or recipient URNs in the composer are optional corroboration; any contradiction fails closed. No Voyager or other private API is used. This is a write operation when confirm_send is True.

thread_id is present only on sent: the conversation the confirmed message was observed in, or null when the page stayed on the compose route. retry_safe stays the authority for whether a retry is safe.

Inputs: message (required), confirm_send (required), linkedin_username (required), profile_urn. 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 26 tools

    Disambiguation4/5

    Most tools target a distinct resource+action (search_jobs vs get_job_details vs get_job_apply_url vs get_easy_apply_form are clearly separated, and the get_feed/search_posts/get_company_posts trio is explicitly differentiated). A few clusters like get_person_profile/get_my_profile/get_sidebar_profiles and get_inbox/search_conversations/get_conversation are adjacent but the descriptions draw adequate boundaries.

    Naming Consistency4/5

    Nearly all tools follow a verb_noun pattern (get_*, search_*, create_*, delete_*, send_*, archive_*, dismiss_*). Minor deviations like connect_with_person and close_session are still readable and predictable. No mixed camelCase/snake_case chaos.

    Tool Count3/5

    26 tools is on the heavy side and each surface (jobs, messaging, posts, people, companies, session) could arguably be trimmed, but the broad LinkedIn domain justifies most of them. It sits at the borderline rather than being excessive.

    Completeness3/5

    Strong coverage of jobs (search, details, apply URL, easy-apply form, saved, dismiss), posts (feed, search, create, delete), and messaging (inbox, read, search, archive, send). Notable gaps: send_message explicitly cannot reply to an existing thread, no withdraw/save application action, and no like/comment on posts or people-follow operations.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables full control over LinkedIn profiles through browser automation, allowing reading, editing, adding, removing entries, and publishing posts directly from conversations.
      41
      18 npm
      4
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables managing LinkedIn posts (create, delete) and making arbitrary LinkedIn API calls through natural language.
      4
      6 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Controls the user's LinkedIn account through a logged-in browser session, enabling post publishing, profile viewing and editing, job searching, and Easy Apply submissions from chat.
      11
      20 PyPI
      1
      MIT