LinkedIn MCP
Click on "Deploy 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., "@LinkedIn MCP Draft a LinkedIn post about our launch, don't publish yet"
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.
LinkedIn MCP
An approval-first Model Context Protocol (MCP) server for authorized LinkedIn workflows. It supports OAuth token exchange, basic OpenID profile retrieval, profile rewrite planning, post drafts, and explicit-approval publishing through LinkedIn's official Posts API.
API limitation: LinkedIn does not generally allow ordinary developer apps to edit a member's headline, About, experience, or skills directly. Those features are draft-and-review workflows unless LinkedIn grants a supported API capability. Access to products and scopes is controlled by LinkedIn.
Features
MCP tools usable by compatible LLM clients.
OAuth 2.0 authorization-code flow; secrets are read from environment variables.
Basic member profile fields through OpenID Connect
userinfo.Profile restructuring proposals without pretending to write unsupported fields.
Post drafting and explicit-approval publishing through the official API.
No browser scraping, password collection, or session-cookie automation.
Related MCP server: LinkedIn MCP Server
Quick start
Requirements: Python 3.11+, a LinkedIn developer app, and access to the products/scopes required for your intended operations.
git clone https://github.com/rohankumbhar-01/linkedin-mcp.git
cd linkedin-mcp
python -m venv .venv
source .venv/bin/activate
pip install -e .
cp .env.example .envSet LINKEDIN_CLIENT_ID, LINKEDIN_CLIENT_SECRET, and LINKEDIN_REDIRECT_URI in .env. Add the exact redirect URI in the LinkedIn Developer Portal. Do not commit .env or token files.
Run locally:
linkedin-mcpThe default transport is stdio, suitable for local MCP clients. The server also supports MCP_TRANSPORT=streamable-http, but do not expose it publicly until authentication, TLS, and network access controls have been configured. A public MCP endpoint needs its own client authentication and authorization layer; LinkedIn OAuth alone does not protect the MCP endpoint.
OAuth flow
Call
linkedin_start_oauth.Open the returned authorization URL and approve the permissions.
The redirect URL includes
codeandstate. Pass both tolinkedin_exchange_codein the same running server session.Call
linkedin_connection_statusandlinkedin_get_my_profile.
The configured redirect URI must exactly match the LinkedIn developer app setting. Requested scopes only work if the app has the relevant product access. The token is stored in ~/.linkedin-mcp/token.json with owner-only permissions where supported. For production, use a managed secret store or encrypted token storage and add refresh/revocation handling.
MCP tools
Tool | Purpose |
| Check token status without revealing it |
| Generate authorization URL and CSRF state |
| Exchange the code and store token |
| Read basic OpenID profile data |
| Prepare profile rewrite instructions; no writes |
| Prepare a post draft |
| Publish only when |
| Retrieve your posts when LinkedIn approves |
| Retrieve a specific post by URN where permitted |
| Delete a post only with explicit approval and API permission |
| Report implemented capabilities and API limitations |
LinkedIn API access
OAuth: https://learn.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow
OpenID Connect: https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin-v2
Posts API: https://learn.microsoft.com/en-us/linkedin/marketing/community-management/shares/posts-api
API terms: https://developer.linkedin.com/legal
Before production use, confirm the current supported LINKEDIN_API_VERSION, endpoint payload requirements, and app permissions against the official documentation. API access can vary by app/product approval.
Security checklist before remote hosting
Add authentication for MCP clients; never expose an unauthenticated public MCP endpoint.
Use HTTPS and a reverse proxy with strict access controls.
Store client secrets and tokens in a secret manager or encrypted store.
Implement token refresh/revocation and OAuth callback handling appropriate for the deployment.
Add audit logging without logging secrets or full tokens.
Keep publishing approval explicit and show the exact text before publishing.
Add tests and CI before using this with a real LinkedIn account.
Current scope and limitations
This is an initial implementation, not a promise that every LinkedIn action is available. It does not scrape LinkedIn pages or bypass access restrictions. Direct edits to headline, About, work experience, and skills are not implemented because those write operations are not generally available through standard member APIs. The initial OAuth exchange expects the authorization code and state to be submitted manually to the MCP tool; a production deployment should add a dedicated callback flow and state/session persistence.
License
MIT
Available Tools
11 toolslinkedin_capabilities_and_limitsA
Explain which features are implemented and which depend on LinkedIn API approval.
Inputs: no named parameters. Returns: object
linkedin_connection_statusA
Check whether a LinkedIn access token is stored; never returns the token.
Inputs: no named parameters. Returns: object
linkedin_delete_approved_postB
Delete a post only after explicit approval. This is irreversible and depends on LinkedIn API access.
Inputs: approved (required), post_urn (required). Returns: object
linkedin_draft_profile_changesB
Prepare suggested headline/About/experience text. This tool drafts only; it does not edit LinkedIn.
Inputs: skills (required), target_role (required), current_profile (required), achievements. Returns: object
linkedin_exchange_codeA
Exchange an OAuth authorization code for a token after checking the state generated in this session.
Inputs: code (required), state (required). Returns: object
linkedin_get_my_postsB
Retrieve the authenticated member's posts. Requires LinkedIn approval for r_member_social.
Inputs: count, start. Returns: object
linkedin_get_my_profileA
Read the signed-in member's basic OpenID profile fields, if the app has the required permissions.
Inputs: no named parameters. Returns: object
linkedin_get_postC
Retrieve a specific post by its LinkedIn URN, if the app has permission.
Inputs: post_urn (required). Returns: object
linkedin_prepare_postB
Validate and prepare a post for review; does not publish it.
Inputs: text (required), visibility. Returns: object
linkedin_publish_approved_postB
Publish a post through LinkedIn's official Posts API only when the caller explicitly confirms approval.
Inputs: text (required), approved (required), visibility. Returns: object
linkedin_start_oauthA
Create a LinkedIn OAuth authorization URL. Open it and sign in to authorize the app.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Tools map cleanly to distinct steps: the three OAuth tools (status/start/exchange) are sequential and separable, and get_my_posts vs get_post vs delete_approved_post are clearly differentiated. Minor overlap between linkedin_connection_status and linkedin_capabilities_and_limits, and between the two 'draft' tools, but descriptions make the boundaries clear.
Every name uses the linkedin_ prefix with snake_case and mostly verb_noun structure (start_oauth, exchange_code, get_my_profile, prepare_post, publish_approved_post). A couple of names are noun phrases (connection_status, capabilities_and_limits), a small but readable deviation.
11 tools is well within the ideal range and each earns its place: three auth steps, profile read/draft, and a full post draft-publish-read-delete lifecycle. No filler or redundant tools.
Auth, profile read, and the post lifecycle are covered, but linkedin_draft_profile_changes is a dead end with no corresponding apply/publish tool, and there is no token refresh, revoke/logout, or engagement (comment/reaction) surface. Some gaps are attributable to documented LinkedIn API restrictions, but agents still hit walls.
Related MCP Connectors
LinkedIn campaigns, content, leads and inbox from your AI client. Scoped, revocable keys.
LinkedIn jobs, companies and people for AI agents, plus messages and invites via your own account.
LinkedIn for AI agents: inbox, invitations, Sales Navigator search, posts, jobs, quotas, webhooks.
OAuth 2.1 short-link tools for AI agents with scoped tokens, approvals, audit logs, and revocation.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with LinkedIn for posting, commenting, liking, and managing connections via OAuth2 authentication.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with LinkedIn using the official API for profile access, company management, and job postings.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to audit professional profiles, check policy compliance, preview posts, and publish explicitly confirmed text posts through LinkedIn's official API.MIT
- AlicenseNot gradedqualityCmaintenanceEnables ChatGPT to connect to LinkedIn via OAuth and perform authorized actions like posting, commenting, replying, and analyzing profile/content with user approval.MIT