Skip to main content

flin-linkedin-posts-mcp

flin-linkedin-posts-mcp is a local MCP server for reading and analyzing the authenticated member's own LinkedIn post/share data.

It uses LinkedIn member OAuth login and the Member Data Portability API. Each user runs the MCP locally, signs into their own LinkedIn account in the system browser, and stores their token on their own machine.

The MCP supports two login flows:

  • Regular 3-legged OAuth with a client secret. This is the recommended local setup for most LinkedIn Developer apps.
  • Native OAuth PKCE. This does not require a client secret, but LinkedIn must explicitly enable the Native PKCE protocol for your app.

Important Access Requirement

This MCP does not bypass LinkedIn API approval. Each user should create their own LinkedIn Developer app with access to Member Data Portability API (Member) and the r_dma_portability_self_serve permission. Without that product/scope, LinkedIn returns 403 ACCESS_DENIED for memberSnapshotData.

Native PKCE is a separate LinkedIn app capability. If LinkedIn shows Not enough permissions to access Native PKCE protocol, use the regular 3-legged OAuth setup below or ask LinkedIn to enable Native PKCE for the app.

Relevant LinkedIn docs:

Features

  • Browser-based LinkedIn login with regular OAuth or native PKCE
  • Local token storage outside the repository
  • Auth status and logout tools
  • Snapshot domain count/debug tool
  • Authenticated member post/share listing from MEMBER_SHARE_INFO
  • Post analysis for counts, text length, hashtags, mentions, and top terms
  • Best-effort extraction of engagement counters when they are present in snapshot rows
  • Draft-to-published matching based on provided draft texts
  • Optional engagement enrichment via LinkedIn socialMetadata and memberCreatorPostAnalytics

MCP Tools

  1. auth_status
  2. login
  3. logout
  4. list_snapshot_domains
  5. list_member_posts
  6. analyze_member_posts
  7. match_drafts_to_member_posts
  8. get_post_social_metadata
  9. get_member_post_analytics
  10. enrich_member_posts_with_engagement

Configuration

Required for login:

  • LINKEDIN_CLIENT_ID: LinkedIn Developer app client ID

Recommended for regular 3-legged OAuth:

  • LINKEDIN_CLIENT_SECRET: LinkedIn Developer app client secret. If set, LINKEDIN_OAUTH_FLOW defaults to authorization_code.
  • LINKEDIN_REDIRECT_URI: exact local callback URI registered in the LinkedIn app, for example http://127.0.0.1:63141/callback.

Optional:

  • LINKEDIN_OAUTH_FLOW: authorization_code or native_pkce. Defaults to authorization_code when LINKEDIN_CLIENT_SECRET is set, otherwise native_pkce.
  • LINKEDIN_SCOPES: defaults to r_dma_portability_self_serve
  • LINKEDIN_API_VERSION: defaults to 202610 for Marketing API requests; engagement requests use at least 202610. Member Snapshot requests always use 202312.
  • LINKEDIN_RESTLI_PROTOCOL_VERSION: defaults to 2.0.0
  • LINKEDIN_TIMEOUT_SECONDS: defaults to 30
  • LINKEDIN_MAX_RETRIES: defaults to 3
  • LINKEDIN_OAUTH_TIMEOUT_SECONDS: defaults to 300
  • LINKEDIN_TOKEN_FILE: defaults to ~/.flin-linkedin-posts-mcp/tokens.json

Additional LinkedIn access may be required for engagement enrichment:

  • socialMetadata access for comment and reaction summaries
  • r_member_postAnalytics for member post impressions, reach, reactions, comments, and reshares

The Marketing API default is LinkedIn's October 2026 version, the latest release as of October 16, 2026. The Member Snapshot API only supports 202312. Post listing, analysis, draft matching, and snapshot-domain discovery always use that version, regardless of LINKEDIN_API_VERSION. The Marketing API version calendar does not apply to this endpoint. Engagement requests use 202610 when configured with an older version, and preserve newer explicit versions. Check the LinkedIn migration table when upgrading. API version updates do not grant additional OAuth permissions.

See docs/linkedin-analytics-access-application.md for Community Management API application steps, request copy, privacy-policy notes, and the MCP configuration to use after LinkedIn approves r_member_postAnalytics.

The MCP intentionally does not require LINKEDIN_ACCESS_TOKEN anymore. Tokens are created through the login tool.

LinkedIn Developer App Setup

  1. Create or open a LinkedIn Developer app.
  2. Add/obtain access to Member Data Portability API (Member).
  3. Make sure the app can request r_dma_portability_self_serve.
  4. For regular 3-legged OAuth, add an exact loopback redirect URL in the app's Auth tab, for example http://127.0.0.1:63141/callback.
  5. Set LINKEDIN_CLIENT_ID, LINKEDIN_CLIENT_SECRET, and LINKEDIN_REDIRECT_URI to the same redirect URL.
  6. For native PKCE only, ask LinkedIn to enable Native PKCE OAuth for the app, omit LINKEDIN_CLIENT_SECRET, and configure loopback redirect URIs as LinkedIn requires.

Claude Desktop on macOS: installable extension

Download the .mcpb file from GitHub Releases and install it in Claude Desktop's Extensions settings. The extension prompts for your LinkedIn app credentials; the client secret is marked sensitive. A current Claude Desktop with MCPB 0.4 / UV support manages Python and the locked dependencies on first start.

Schritt-für-Schritt-Anleitung auf Deutsch · Security review · Security model

The LinkedIn API approval described above is still required. Releases include SHA256SUMS; the bundle is unsigned.

Claude Desktop Configuration (manual alternative)

For the hardened wheel attached to the GitHub release (requires uv):

{
  "mcpServers": {
    "flin-linkedin-posts-mcp": {
      "command": "uvx",
      "args": ["--from", "https://github.com/flin-agency/flin-linkedin-posts-mcp/releases/download/v0.3.0/flin_linkedin_posts_mcp-0.3.0-py3-none-any.whl", "flin-linkedin-posts-mcp"],
      "env": {
        "LINKEDIN_CLIENT_ID": "<YOUR_LINKEDIN_CLIENT_ID>",
        "LINKEDIN_CLIENT_SECRET": "<YOUR_LINKEDIN_CLIENT_SECRET>",
        "LINKEDIN_REDIRECT_URI": "http://127.0.0.1:63141/callback",
        "LINKEDIN_SCOPES": "r_dma_portability_self_serve",
        "LINKEDIN_API_VERSION": "202610"
      }
    }
  }
}

For local development from this repository:

{
  "mcpServers": {
    "flin-linkedin-posts-mcp": {
      "command": "uv",
      "args": ["run", "flin-linkedin-posts-mcp"],
      "cwd": "/path/to/flin-linkedin-posts-mcp",
      "env": {
        "LINKEDIN_CLIENT_ID": "<YOUR_LINKEDIN_CLIENT_ID>",
        "LINKEDIN_CLIENT_SECRET": "<YOUR_LINKEDIN_CLIENT_SECRET>",
        "LINKEDIN_REDIRECT_URI": "http://127.0.0.1:63141/callback",
        "LINKEDIN_SCOPES": "r_dma_portability_self_serve",
        "LINKEDIN_API_VERSION": "202610"
      }
    }
  }
}

After adding the config, restart the MCP host and call:

  1. auth_status
  2. login
  3. list_snapshot_domains
  4. list_member_posts or analyze_member_posts
  5. match_drafts_to_member_posts if you want to compare draft text to published posts
  6. get_post_social_metadata, get_member_post_analytics, or enrich_member_posts_with_engagement if your LinkedIn app has the required engagement scopes

Local Development

python3 -m pip install -e '.[dev]'
pytest -q
ruff check .

Packaging

Build the desktop bundle with python scripts/build_mcpb.py after uv lock --check. Only explicitly allowlisted files enter dist/desktop/; the archive includes uv.lock and a SHA-256 checksum.

python3 -m build

The package entry point is:

flin-linkedin-posts-mcp

Troubleshooting

  • LINKEDIN_CLIENT_ID is required before running login: set LINKEDIN_CLIENT_ID in the MCP config.
  • Not enough permissions to access Native PKCE protocol: the LinkedIn app does not have Native PKCE enabled. Set LINKEDIN_CLIENT_SECRET and LINKEDIN_REDIRECT_URI to use regular 3-legged OAuth, or ask LinkedIn to enable Native PKCE for the app.
  • LINKEDIN_REDIRECT_URI is required when LINKEDIN_OAUTH_FLOW=authorization_code: add the same exact local callback URL to the LinkedIn app's Auth tab and to the MCP config.
  • 403 ACCESS_DENIED for partnerApiMemberSnapshotData: the LinkedIn Developer app/token likely does not have Member Data Portability API access or r_dma_portability_self_serve.
  • LinkedIn token has expired: run login again. If LinkedIn issued a refresh token, the MCP attempts a refresh automatically before requiring login.
  • Timed out waiting for LinkedIn OAuth callback: rerun login and complete the browser flow within LINKEDIN_OAUTH_TIMEOUT_SECONDS.
  • 403 ACCESS_DENIED on socialMetadata or memberCreatorPostAnalytics: the LinkedIn app/token does not have the extra engagement permissions needed for those tools.
  • 426 NONEXISTENT_VERSION on memberSnapshotData: upgrade to 0.2.9 or later and restart the MCP host. Version 0.2.8 incorrectly sent the Marketing API version to the snapshot endpoint; the fix pins snapshot requests to 202312.

Notes

  • The MCP reads only the authenticated member's own snapshot data.
  • It does not support arbitrary-author LinkedIn post lookup.
  • MEMBER_SHARE_INFO is snapshot/export-style data, so field names can vary. The normalizer is intentionally tolerant and keeps include_raw=true available for debugging.
  • LinkedIn's portability data for Shares is documented around fields like date, link, commentary, media URL, and visibility. Likes, comments, and impressions are exposed only if they appear in the snapshot payload returned for that member.
  • Saved LinkedIn drafts are not exposed as a documented portability snapshot domain here. match_drafts_to_member_posts compares draft texts you already have against published posts; it does not fetch drafts from LinkedIn.
  • analyze_member_posts can return very large payloads when include_posts=true. Use post_limit to cap the embedded posts list, or set include_posts=false when you only need aggregate metrics.
  • enrich_member_posts_with_engagement keeps export discovery and engagement lookup separate. It fetches exported posts first, derives post URNs, then merges in socialMetadata and analytics where available.
  • Bulk enrichment is intentionally bounded. Use limit to keep the number of analytics calls under control and expect per-post engagement_errors when a URN cannot be derived or LinkedIn denies a lookup.

Metadata

Release files for flin-linkedin-posts-mcp 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flin-linkedin-posts-mcp 0.3.0
File Size Uploaded Provenance Actions
flin_linkedin_posts_mcp-0.3.0.tar.gz 121.0 kB With provenance Details for flin_linkedin_posts_mcp-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flin-linkedin-posts-mcp 0.3.0
File Interpreter ABI Platform Actions
flin_linkedin_posts_mcp-0.3.0-py3-none-any.whl Python 3 none any Details for flin_linkedin_posts_mcp-0.3.0-py3-none-any.whl

Total release size: 148.8 kB

Release files / flin_linkedin_posts_mcp-0.3.0.tar.gz

Download URL flin_linkedin_posts_mcp-0.3.0.tar.gz
Size 121.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e4a84a051d0b04b73f5fd45e57e309a8f9c42a74b8c88cb14387f1672198bd43
BLAKE2b-256 checksum
How to use checksums
400c348ef2eb4ec78e7f04d3f2310c99a375b2c1a00c3308d4a2f50e9080680d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / flin_linkedin_posts_mcp-0.3.0-py3-none-any.whl

Download URL flin_linkedin_posts_mcp-0.3.0-py3-none-any.whl
Size 27.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f1adf4eef7f0dc22982a7fb53758be3d72d72636e57cdc97903656523f662a8
BLAKE2b-256 checksum
How to use checksums
f17b8c885c75172c16327e9f60f67f73d5de5fa9d1b07f10b7c492edeae29d66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for flin-linkedin-posts-mcp 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for flin_linkedin_posts_mcp-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page