Local MCP server for authenticated LinkedIn member post snapshots
Project description
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 native OAuth PKCE 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.
Important Access Requirement
This MCP does not bypass LinkedIn API approval. The LinkedIn Developer app used by the local user must have access to Member Data Portability API (3rd Party) and the r_dma_portability_3rd_party permission. Without that product/scope, LinkedIn returns 403 ACCESS_DENIED for memberSnapshotData.
Relevant LinkedIn docs:
- 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 OAuth 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
MCP Tools
auth_statusloginlogoutlist_snapshot_domainslist_member_postsanalyze_member_posts
Configuration
Required for login:
LINKEDIN_CLIENT_ID: LinkedIn Developer app client ID
Optional:
LINKEDIN_SCOPES: defaults tor_dma_portability_3rd_partyLINKEDIN_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
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 (3rd Party). - Make sure the app can request
r_dma_portability_3rd_party. - Configure native PKCE OAuth support with loopback redirect URIs.
- Add a loopback redirect URI pattern supported by LinkedIn, for example
http://127.0.0.1:{port}/callbackif the portal allows dynamic loopback ports. If the portal requires exact ports, run the MCP with a matching callback port after extending the config. - Use the app's Client ID as
LINKEDIN_CLIENT_ID.
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_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_API_VERSION": "202312"
}
}
}
}
After adding the config, restart the MCP host and call:
auth_statusloginlist_snapshot_domainslist_member_postsoranalyze_member_posts
Local Development
python3 -m pip install -e '.[dev]'
pytest -q
ruff check .
Packaging
python3 -m build
The package entry point is:
flin-linkedin-posts-mcp
Troubleshooting
LINKEDIN_CLIENT_ID is required before running login: setLINKEDIN_CLIENT_IDin the MCP config.403 ACCESS_DENIEDforpartnerApiMemberSnapshotData: the LinkedIn Developer app/token likely does not have Member Data Portability API access orr_dma_portability_3rd_party.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.
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flin_linkedin_posts_mcp-0.2.0.tar.gz.
File metadata
- Download URL: flin_linkedin_posts_mcp-0.2.0.tar.gz
- Upload date:
- Size: 21.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef51f2dad7eb4b906499e7f6d026b45adaf6161f27d781908119d20c3d08318e
|
|
| MD5 |
a69b60c33bd01ed066c4316f73bfae1b
|
|
| BLAKE2b-256 |
22dfda1bb8cbbe76650c4799261e98d810e4a54be72c80c98fa2546ed9418572
|
Provenance
The following attestation bundles were made for flin_linkedin_posts_mcp-0.2.0.tar.gz:
Publisher:
release.yml on flin-agency/flin-linkedin-posts-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flin_linkedin_posts_mcp-0.2.0.tar.gz -
Subject digest:
ef51f2dad7eb4b906499e7f6d026b45adaf6161f27d781908119d20c3d08318e - Sigstore transparency entry: 1429098661
- Sigstore integration time:
-
Permalink:
flin-agency/flin-linkedin-posts-mcp@4f31edfefe79408a6ad7bdf54b2b36b53deb0698 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/flin-agency
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4f31edfefe79408a6ad7bdf54b2b36b53deb0698 -
Trigger Event:
push
-
Statement type:
File details
Details for the file flin_linkedin_posts_mcp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: flin_linkedin_posts_mcp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 19.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab4e0dca145959d276ba25791772e4f331e61edb99fa405b61c0520f79e1887d
|
|
| MD5 |
f944dcb2e814ef0cdf33b0bb09063d18
|
|
| BLAKE2b-256 |
a2fd86f9615411ce2c00246b3127a994e37a2e33cc168d402924eae17aa0c6c9
|
Provenance
The following attestation bundles were made for flin_linkedin_posts_mcp-0.2.0-py3-none-any.whl:
Publisher:
release.yml on flin-agency/flin-linkedin-posts-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flin_linkedin_posts_mcp-0.2.0-py3-none-any.whl -
Subject digest:
ab4e0dca145959d276ba25791772e4f331e61edb99fa405b61c0520f79e1887d - Sigstore transparency entry: 1429098664
- Sigstore integration time:
-
Permalink:
flin-agency/flin-linkedin-posts-mcp@4f31edfefe79408a6ad7bdf54b2b36b53deb0698 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/flin-agency
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4f31edfefe79408a6ad7bdf54b2b36b53deb0698 -
Trigger Event:
push
-
Statement type: