Skip to main content
Glama
linkedinmcp

linkedinmcp

by vielhuber

💼linkedinmcp💼

one small php helper and mcp server for linkedin posting and your own member data. two apps, separate tokens, one tool set.

php

composer require vielhuber/linkedinmcp
use vielhuber\linkedinmcp\linkedinmcp;

$linkedin = new linkedinmcp();
$linkedin->profile();
$linkedin->snapshot(domain: 'PROFILE', start: 0);
$linkedin->posts(start: 0);
$linkedin->activity(startTime: $processedAt, count: 10);
$linkedin->memberAuthorization();
$linkedin->createPost(text: 'your approved text');
$linkedin->updatePost(postUrn: $postUrn, text: 'your approved replacement');
$linkedin->deletePost(postUrn: $postUrn);
$linkedin->uploadImage(filePath: '/absolute/path/to/image.png');
$linkedin->uploadVideo(filePath: '/absolute/path/to/video.mp4');
$linkedin->videoStatus(videoUrn: $mediaUrn);

two separate apps and tokens:

app

token environment variable

scopes

posting: openid connect + share on linkedin

LINKEDIN_POSTING_ACCESS_TOKEN

openid profile w_member_social

member data portability api (member)

LINKEDIN_MEMBER_ACCESS_TOKEN

r_dma_portability_self_serve

member access is region-dependent and limited to the app administrator's own data. keep both apps' identities separate. api versions: posting 202610, member 202312; override with LINKEDIN_POSTING_VERSION / LINKEDIN_MEMBER_VERSION.

php oauth: one Authorization(clientId: ..., clientSecret: ..., redirectUri: ...) per app; url($state, $scopes), verify state, exchangeCode($code). refresh only with an issued refresh token. oauth helpers are not mcp tools.

  • snapshots: page index start; no-data response is http 404. no home feed.

  • activity: 28 days after consent; cursor processedAt, deduplicate activityId, poll at most hourly.

  • uploads return id, not a post; videos must be AVAILABLE. image processing checks may require extra permissions.

  • approve writes first. edits change commentary only; use exact share/ugcpost urns. never blindly retry uncertain writes.

Related MCP server: linkedin-mcp

mcp

{
    "mcpServers": {
        "linkedin": {
            "command": "php",
            "args": ["/absolute/path/to/vendor/bin/mcp-server.php"],
            "env": {
                "LINKEDIN_POSTING_ACCESS_TOKEN": "your-posting-access-token",
                "LINKEDIN_MEMBER_ACCESS_TOKEN": "your-member-access-token"
            }
        }
    }
}

11 tools; php methods become snake_case tool names. stdio is private. http requires https and MCP_TOKEN.

posting api · member portability api · oauth

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables LLMs to manage LinkedIn posts and view analytics through a set of MCP tools, including creating, reading, and deleting posts, checking authentication, and retrieving profile info.
    122 npm
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables authenticated LinkedIn profile access, AI-assisted post drafting and publishing, job searching across multiple free boards, and local application tracking—all through MCP tools.
    MIT
  • 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.
    9 npm
    MIT