LinkedIn MCP Server
Project
A Model Context Protocol (MCP) server that provides a practical, capability-aware LinkedIn API toolset to AI agents such as opencode, Claude, Cursor, and other MCP clients.
Table of Contents
- Why another LinkedIn MCP server
- What it provides
- Getting started
- Prompt examples
- Tool reference
- Data & safety notes
- Limitations
- License
Why another LinkedIn MCP server?
| Feature domain | stickerdaniel/linkedin-mcp-server | southleft/linkedin-mcp | linkedin-mcp |
|---|---|---|---|
| OAuth code flow | ✅ Browser-based auth code exchange | ✅ OAuth 2.0 code flow | ✅ Full auth_start → auth_poll → auth_finish with local callback |
| Write preview mode | ❌ (no dry-run default) | ❌ (no dry-run default) | ✅ All write tools default to execute=false preview; execute=true performs actual write |
| Ads/campaign management | ❌ Not supported | ❌ Not supported | ✅ list_ad_accounts, list_campaign_groups, list_campaigns, create_campaign_group, create_campaign, update_campaign |
| Media upload workflow | ❌ Not supported | ❌ Not supported | ✅ initialize_media_upload → finalize_media_upload workflow |
| Comment/reaction tools | ✅ Basic comment and reaction support | ✅ Basic comment and reaction support | ✅ list_comments, create_comment, list_reactions, create_reaction |
| Direct messaging | ✅ (with session browser) / ⚠️ ToS violation via browser scraping | ✅ (with session browser) / ⚠️ ToS violation via browser scraping | ❌ Not included (requires Sales Navigator/partner approval / w_member_social scope) |
What it provides
Current scaffold includes:
- OAuth code flow for interactive browser login (
auth_start->auth_finish) - token bootstrap and refresh helpers
- per-tool capability matrix in
src/linkedin_mcp/tool_catalog.json - raw authenticated helpers for fast endpoint expansion
- wrapped tools for profile, org ACLs, posts, comments, reactions, media upload, and ads
Getting started
You need an MCP-capable client (opencode, Claude Desktop, Cursor, etc).
LinkedIn app registration
- Open the LinkedIn Developer portal and create a new app.
- In app auth settings, add an OAuth redirect URL, for example
http://127.0.0.1:8765/callback. - Copy
Client IDandClient Secretinto your environment. - Under products/scopes, request only what you need now (start with sign-in scopes).
- Ensure the redirect URL in app settings exactly matches
LINKEDIN_REDIRECT_URI.
1. Install
Option A - local editable install (recommended for development)
Requirements: Python 3.10+.
pip install -e .
linkedin-mcp-full
Option B - uvx from source folder
Requirements: uv (uvx) and a local clone of this repository.
uvx --from . linkedin-mcp-full
2. Configure environment
Copy .env.example and set values (or export directly in shell).
Required variables (and usually the only ones you need):
LINKEDIN_CLIENT_IDLINKEDIN_CLIENT_SECRETLINKEDIN_REDIRECT_URI(example:http://127.0.0.1:8765/callback)
3. Register with your MCP client
Example for opencode (~/.config/opencode/opencode.json):
{
"mcp": {
"linkedin": {
"type": "local",
"enabled": true,
"command": ["uvx", "--from", "git+https://github.com/oliverhruby/linkedin-mcp.git", "linkedin-mcp-full"],
"env": {
"LINKEDIN_CLIENT_ID": "{env:LINKEDIN_CLIENT_ID}",
"LINKEDIN_CLIENT_SECRET": "{env:LINKEDIN_CLIENT_SECRET}",
"LINKEDIN_REDIRECT_URI": "{env:LINKEDIN_REDIRECT_URI}"
}
}
}
}
Restart your MCP client after config changes.
Prompt examples
| User prompt | Likely tool call(s) | Expected response |
|---|---|---|
| "Start LinkedIn login" | auth_start |
Authorization URL + state + listener details |
| "Search for company updates" | list_accessible_organizations |
Organization ACL visibility |
| "Create a post preview" | create_post execute=false |
Dry-run request payload |
| "Create the post now" | create_post execute=true |
API write result |
| "List my campaigns" | list_campaigns |
Ad campaigns list |
| "Get ad analytics" | get_ad_analytics |
Ad analytics data |
| "List my reactions" | list_reactions |
Reactions for a social action |
| "Check account capabilities" | list_capabilities |
Per-tool availability with missing scopes/roles |
Tool reference
| Tool | Description | Writes? |
|---|---|---|
auth_start |
Build OAuth URL and optional local callback listener | ✅ session |
auth_poll |
Poll pending OAuth callback state | |
auth_finish |
Exchange auth code for access token | ✅ session |
auth_refresh |
Refresh access token | ✅ session |
auth_set_access_token |
Manual token bootstrap | ✅ session |
auth_set_role_hints |
Set local role hints used for gating | ✅ session |
auth_status |
Show active session metadata | |
auth_clear |
Clear in-memory session and pending OAuth states | ✅ session |
list_tool_catalog |
Show tool capability metadata | |
list_endpoint_manifest |
Show endpoint coverage scaffold | |
list_capabilities |
Show effective per-tool availability | |
can_execute_tool |
Check one tool against current capabilities | |
linkedin_get |
Raw authenticated GET helper | |
linkedin_post |
Raw authenticated POST helper | ✅ |
whoami |
Resolve current principal profile endpoint | |
get_member_profile |
Fetch member profile | |
list_accessible_organizations |
Fetch organization ACL visibility | |
create_post |
Create post (execute=false preview by default) |
✅ |
get_post |
Fetch post by URN | |
delete_post |
Delete post (execute=false preview by default) |
✅ |
list_comments |
Fetch comments for social action path | |
create_comment |
Create comment (execute=false preview by default) |
✅ |
list_reactions |
Fetch reactions for social action path | |
create_reaction |
Create reaction (execute=false preview by default) |
✅ |
delete_reaction |
Delete reaction (execute=false preview by default) |
✅ |
initialize_media_upload |
Initialize media upload workflow (execute=false preview by default) |
✅ |
finalize_media_upload |
Finalize media upload workflow (execute=false preview by default) |
✅ |
list_ad_accounts |
List ad accounts (approval gated) | |
list_campaign_groups |
List ad campaign groups | |
create_campaign_group |
Create ad campaign group (execute=false preview by default) |
✅ |
list_campaigns |
List ad campaigns | |
create_campaign |
Create ad campaign (execute=false preview by default) |
✅ |
update_campaign |
Update ad campaign (execute=false preview by default) |
✅ |
get_ad_analytics |
Fetch ad analytics (approval gated) |
Data & safety notes
- Write tools are explicit and default to dry-run where feasible.
- Capability checks prevent many avoidable permission failures.
- API behavior still depends on LinkedIn app approvals and user/org roles.
Limitations
- This is a scaffold-first implementation, not complete LinkedIn API coverage.
- LinkedIn API availability depends on app-level approvals and account roles.
- Token persistence is currently in-memory; restart requires re-auth or env token.
License
MIT © Oliver Hrubý
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 linkedin_mcp_full-0.1.0.tar.gz.
File metadata
- Download URL: linkedin_mcp_full-0.1.0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d181e95b4b862c2223204833588b09f6f06f67fe9bf709adb25e3bb0b6f409a
|
|
| MD5 |
afc759bb812045b09c876a1a4c68a27b
|
|
| BLAKE2b-256 |
91083983a73a702016cbfbfb906fe2fc33cdd14656aa1b191b5a773a6dc5d8a4
|
Provenance
The following attestation bundles were made for linkedin_mcp_full-0.1.0.tar.gz:
Publisher:
publish.yml on oliverhruby/linkedin-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
linkedin_mcp_full-0.1.0.tar.gz -
Subject digest:
7d181e95b4b862c2223204833588b09f6f06f67fe9bf709adb25e3bb0b6f409a - Sigstore transparency entry: 2758745410
- Sigstore integration time:
-
Permalink:
oliverhruby/linkedin-mcp@1b0ed00114ae8b69e68fbeed742cd2754dd5dff8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/oliverhruby
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1b0ed00114ae8b69e68fbeed742cd2754dd5dff8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file linkedin_mcp_full-0.1.0-py3-none-any.whl.
File metadata
- Download URL: linkedin_mcp_full-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e738f3c45fc20880bef33ad4074756e65577e8f62fb00e2eea8d46ea14efc6e0
|
|
| MD5 |
1fbf3b5efb18f3a0948125f4bb55161b
|
|
| BLAKE2b-256 |
af0a9e5be26bf0b3bc7ff3cc22688f7dbc7337ab8a5f9795cacb19015c0d98ae
|
Provenance
The following attestation bundles were made for linkedin_mcp_full-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on oliverhruby/linkedin-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
linkedin_mcp_full-0.1.0-py3-none-any.whl -
Subject digest:
e738f3c45fc20880bef33ad4074756e65577e8f62fb00e2eea8d46ea14efc6e0 - Sigstore transparency entry: 2758745482
- Sigstore integration time:
-
Permalink:
oliverhruby/linkedin-mcp@1b0ed00114ae8b69e68fbeed742cd2754dd5dff8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/oliverhruby
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1b0ed00114ae8b69e68fbeed742cd2754dd5dff8 -
Trigger Event:
workflow_dispatch
-
Statement type: