LinkedIn MCP Server
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., "@LinkedIn MCP Serverpost 'Exploring the future of AI' on LinkedIn"
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 Server
A lightweight Model Context Protocol (MCP) server that lets an MCP-compatible AI assistant publish and manage public text posts on an authenticated LinkedIn profile.
Architecture
AI Assistant
|
| MCP / stdio
v
LinkedIn MCP Server
|
| HTTPS REST API
v
LinkedInRelated MCP server: LinkedIn Custom MCP Server
MCP tools
linkedin_create_post
Publishes a public text post to the authenticated LinkedIn profile.
Input:
{
"text": "Hello from my MCP server 🚀"
}The tool returns the LinkedIn post ID on success.
linkedin_get_profile
Returns the authenticated member's OpenID profile information.
linkedin_get_post
Retrieves a LinkedIn post by a urn:li:share:... or urn:li:ugcPost:... identifier.
linkedin_update_post
Updates the commentary text of an existing LinkedIn post.
Input:
{
"post_id": "urn:li:share:1234567890",
"text": "Updated post text"
}The server validates the post URN and text locally, then uses LinkedIn's Posts API PARTIAL_UPDATE operation. LinkedIn enforces ownership and permission rules; permission failures are returned as structured MCP errors.
linkedin_delete_post
Deletes a LinkedIn post by its share or UGC post URN. See docs/delete-post.md for API behavior and idempotency details.
Response schema
All MCP tools use one stable response contract.
Successful calls return:
{
"success": true,
"data": {
"tool_specific_field": "value"
},
"message": "Optional success message"
}Failures return:
{
"success": false,
"error": {
"code": "machine_readable_code",
"message": "Human-readable description",
"details": {}
}
}data contains the tool-specific payload. message and error.details are optional. See docs/response-schema.md for the complete contract and migration notes.
Requirements
Python 3.11+
A LinkedIn developer application with the required API permissions
A valid LinkedIn access token
The authenticated author's LinkedIn person URN
Install dependencies:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtCredentials
MCP tools obtain credentials through a CredentialProvider abstraction rather than reading secrets directly. The default local-development provider remains file-based for backward compatibility.
Create these files in the project root:
access_token.txt
person_urn.txtaccess_token.txt should contain only the LinkedIn access token.
person_urn.txt should contain a value such as:
urn:li:person:YOUR_SUBJECT_IDSet restrictive permissions:
chmod 600 access_token.txt person_urn.txtProduction deployments can install a secret-manager-backed provider without changing any MCP tool implementation. Never commit tokens, OAuth credentials, or personal credential files. See docs/credentials.md for the provider contract, production integration pattern, and secret-handling rules.
OAuth design
The production authentication design uses LinkedIn's 3-legged authorization-code flow with the minimum scopes required by the current tools:
openid profile w_member_socialLocal development uses a loopback callback, while production requires an HTTPS callback and server-side secret storage. See docs/oauth-flow.md for the flow diagram, token lifecycle, failure states, and security requirements.
Run the MCP server
python -m src.linkedin_mcp.serverThe server uses STDIO, so it intentionally stays running and waits for MCP JSON-RPC messages. Do not print application logs to stdout because stdout is reserved for the MCP protocol.
MCP Inspector
For local development:
npx @modelcontextprotocol/inspector \
python -m src.linkedin_mcp.serverThen connect to the STDIO server and call the LinkedIn tools from the Inspector.
Testing
Run:
pytest -qTests use fake credentials, reusable httpx.MockTransport fixtures, sanitized LinkedIn response samples, and an automatic guard that blocks real HTTP. No LinkedIn secrets or live API access are required. See docs/testing.md for the fixture and network-isolation strategy.
Security notes
MCP tools access secrets only through the credential-provider interface.
Local credential files are ignored by Git and should use restrictive permissions.
.env.examplecontains placeholders only.GitHub push protection should remain enabled.
LinkedIn API errors are sanitized before they are returned to MCP clients.
If a LinkedIn token is ever exposed, revoke/rotate it immediately.
For responsible vulnerability reporting, see SECURITY.md.
Contributing & collaboration
Focused bug fixes, tests, documentation improvements, MCP tool improvements, OAuth/security hardening, and API integration improvements are welcome. See CONTRIBUTING.md before starting a substantial change.
For broader backend, AI/MCP, open-source, or industrial-AI collaboration, visit Amir Behvandi's GitHub profile or join ForgeMind Discussions.
English and Persian participation are both welcome.
Portfolio description
A production-minded MCP server that exposes LinkedIn publishing and post management as structured AI tools, combining the Model Context Protocol, OAuth-based LinkedIn authentication, secure credential-provider abstraction, and REST API integration.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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.
Related MCP Connectors
PerfectPost is a LinkedIn content management platform. This MCP server gives AI assistants read and write access to a user's PerfectPost account: published posts with their engagement analytics, drafts lifecycle (create / edit / schedule), and LinkedIn profile data.
Write LinkedIn posts in your voice: ideas, drafts, scheduling, analytics from your personal AI.
Write LinkedIn posts in your own voice. Drafts only, ego never publishes for you.
- AntworkOAuthio.antwork
Draft, schedule, and publish social posts for your workspace straight from your AI.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables posting text and media content directly to LinkedIn from Claude Desktop with support for authentication and visibility controls.10MIT
- AlicenseAqualityDmaintenanceEnables AI agents to manage professional networking on LinkedIn by providing tools for posting updates, searching for jobs, and analyzing profiles. It facilitates secure interaction with the LinkedIn platform through OAuth 2.0 authentication and the Model Context Protocol.1711MIT
- AlicenseBqualityDmaintenanceAllows AI agents to authenticate with LinkedIn and share posts or links via the Model Context Protocol.2214MIT
- AlicenseBqualityCmaintenanceEnables drafting, formatting, analyzing, and publishing LinkedIn posts directly from MCP-compatible clients like Claude.5214MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/amiradmin/linkedin-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server