flin-linkedin-posts-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@flin-linkedin-posts-mcplist my recent LinkedIn posts"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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:
3-legged OAuth: https://learn.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow
Native OAuth PKCE: https://learn.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow-native
Member Snapshot API: https://learn.microsoft.com/en-us/linkedin/dma/member-data-portability/shared/member-snapshot-api
Snapshot domains: https://learn.microsoft.com/en-us/linkedin/dma/member-data-portability/shared/snapshot-domain
API access overview: https://learn.microsoft.com/en-us/linkedin/shared/authentication/getting-access
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_INFOPost 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
socialMetadataandmemberCreatorPostAnalytics
MCP Tools
auth_statusloginlogoutlist_snapshot_domainslist_member_postsanalyze_member_postsmatch_drafts_to_member_postsget_post_social_metadataget_member_post_analyticsenrich_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_FLOWdefaults toauthorization_code.LINKEDIN_REDIRECT_URI: exact local callback URI registered in the LinkedIn app, for examplehttp://127.0.0.1:63141/callback.
Optional:
LINKEDIN_OAUTH_FLOW:authorization_codeornative_pkce. Defaults toauthorization_codewhenLINKEDIN_CLIENT_SECRETis set, otherwisenative_pkce.LINKEDIN_SCOPES: defaults tor_dma_portability_self_serveLINKEDIN_API_VERSION: defaults to202312LINKEDIN_RESTLI_PROTOCOL_VERSION: defaults to2.0.0LINKEDIN_TIMEOUT_SECONDS: defaults to30LINKEDIN_MAX_RETRIES: defaults to3LINKEDIN_OAUTH_TIMEOUT_SECONDS: defaults to300LINKEDIN_TOKEN_FILE: defaults to~/.flin-linkedin-posts-mcp/tokens.json
Additional LinkedIn access may be required for engagement enrichment:
socialMetadataaccess for comment and reaction summariesr_member_postAnalyticsfor member post impressions, reach, reactions, comments, and reshares
The MCP intentionally does not require LINKEDIN_ACCESS_TOKEN anymore. Tokens are created through the login tool.
LinkedIn Developer App Setup
Create or open a LinkedIn Developer app.
Add/obtain access to
Member Data Portability API (Member).Make sure the app can request
r_dma_portability_self_serve.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.Set
LINKEDIN_CLIENT_ID,LINKEDIN_CLIENT_SECRET, andLINKEDIN_REDIRECT_URIto the same redirect URL.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 Configuration
For a published package:
{
"mcpServers": {
"flin-linkedin-posts-mcp": {
"command": "uvx",
"args": ["--refresh", "flin-linkedin-posts-mcp@latest"],
"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": "202312"
}
}
}
}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": "202312"
}
}
}
}After adding the config, restart the MCP host and call:
auth_statusloginlist_snapshot_domainslist_member_postsoranalyze_member_postsmatch_drafts_to_member_postsif you want to compare draft text to published postsget_post_social_metadata,get_member_post_analytics, orenrich_member_posts_with_engagementif your LinkedIn app has the required engagement scopes
Local Development
python3 -m pip install -e '.[dev]'
pytest -q
ruff check .Packaging
python3 -m buildThe package entry point is:
flin-linkedin-posts-mcpTroubleshooting
LINKEDIN_CLIENT_ID is required before running login: setLINKEDIN_CLIENT_IDin the MCP config.Not enough permissions to access Native PKCE protocol: the LinkedIn app does not have Native PKCE enabled. SetLINKEDIN_CLIENT_SECRETandLINKEDIN_REDIRECT_URIto 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_DENIEDforpartnerApiMemberSnapshotData: the LinkedIn Developer app/token likely does not have Member Data Portability API access orr_dma_portability_self_serve.LinkedIn token has expired: runloginagain. If LinkedIn issued a refresh token, the MCP attempts a refresh automatically before requiring login.Timed out waiting for LinkedIn OAuth callback: rerunloginand complete the browser flow withinLINKEDIN_OAUTH_TIMEOUT_SECONDS.403 ACCESS_DENIEDonsocialMetadataormemberCreatorPostAnalytics: the LinkedIn app/token does not have the extra engagement permissions needed for those tools.
Notes
The MCP reads only the authenticated member's own snapshot data.
It does not support arbitrary-author LinkedIn post lookup.
MEMBER_SHARE_INFOis snapshot/export-style data, so field names can vary. The normalizer is intentionally tolerant and keepsinclude_raw=trueavailable for debugging.LinkedIn's portability data for
Sharesis 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_postscompares draft texts you already have against published posts; it does not fetch drafts from LinkedIn.analyze_member_postscan return very large payloads wheninclude_posts=true. Usepost_limitto cap the embeddedpostslist, or setinclude_posts=falsewhen you only need aggregate metrics.enrich_member_posts_with_engagementkeeps export discovery and engagement lookup separate. It fetches exported posts first, derives post URNs, then merges insocialMetadataand analytics where available.Bulk enrichment is intentionally bounded. Use
limitto keep the number of analytics calls under control and expect per-postengagement_errorswhen a URN cannot be derived or LinkedIn denies a lookup.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/flin-agency/flin-linkedin-posts-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server