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 Serverdraft a post about AI trends in 2025 with a professional tone"
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 Model Context Protocol server that lets Claude — and any MCP-compatible client — draft, format, analyze, and publish LinkedIn posts straight from a chat.
Stop context-switching between your editor, a "best time to post" blog, and LinkedIn's composer. This server exposes five focused tools so the model can take a raw idea, shape it into a polished post, score it, generate hashtags, and (optionally) publish it to your profile — all without leaving the conversation.
Features
✍️ Draft full posts from a topic, tone, and a few key points
🎨 Format raw text with clean line breaks, spacing, emojis, and hashtags
🏷️ Generate relevant, topic-aware hashtags
📊 Analyze a post and get a score plus concrete improvement suggestions
🚀 Publish to LinkedIn (or save as a draft) with configurable visibility
🧩 Works with Claude Desktop and any other MCP host over stdio
⚡ Bundled with esbuild for fast, low-memory builds
Note: Four of the five tools (
draft_post,format_post,generate_hashtags,analyze_post) run fully offline and need no credentials. Onlycreate_posttalks to the LinkedIn API and requires an access token.
Related MCP server: linkedin-mcp-server
Available Tools
draft_post
Generate a LinkedIn post template from a topic and tone.
Parameter | Type | Required | Default | Description |
|
| ✅ | — | Topic or subject of the post |
|
| — |
| One of |
|
| — | — | Key points to weave into the post |
|
| — | — | Who the post is aimed at |
|
| — | — | Custom call-to-action |
|
| — |
| Whether to append hashtags |
|
| — |
| Number of hashtags (0–10) |
format_post
Format raw content with proper LinkedIn structure and hashtags.
Parameter | Type | Required | Default | Description |
|
| ✅ | — | Raw post text to format |
|
| — |
| Insert readable spacing and line breaks |
|
| — |
| Sprinkle in relevant emojis |
|
| — |
| Hashtags to append |
generate_hashtags
Generate relevant LinkedIn hashtags for a topic.
Parameter | Type | Required | Default | Description |
|
| ✅ | — | Topic to generate hashtags for |
|
| — |
| Number of hashtags (1–10) |
|
| — | — | Seed keywords to bias generation |
analyze_post
Score a LinkedIn post and return improvement suggestions.
Parameter | Type | Required | Default | Description |
|
| ✅ | — | The post text to score and critique |
create_post
Format and publish a LinkedIn post, or save it as a draft. Requires LinkedIn API credentials.
Parameter | Type | Required | Default | Description |
|
| ✅ | — | Post text (max 3000 characters) |
|
| — |
| Hashtags to include |
|
| — |
| One of |
|
| — |
| Save as a draft instead of publishing |
Prerequisites
Node.js 18+ and npm (pnpm or yarn work too)
An MCP-compatible client — e.g. Claude Desktop
(Only for publishing) A LinkedIn developer app and an access token with the
w_member_socialscope
Installation
git clone https://github.com/<your-username>/linkedin-mcp-server.git
cd linkedin-mcp-server
npm install
npm run buildThe build step bundles src/ into a single executable file at dist/index.js.
Configuration
1. LinkedIn API credentials (for create_post)
Create an app in the LinkedIn Developer Portal.
Request the Share on LinkedIn product to unlock the
w_member_socialscope.Complete the OAuth 2.0 flow to obtain an access token.
Create a .env file in the project root:
LINKEDIN_ACCESS_TOKEN=your_access_token_here
# Optional — many setups resolve this from the token via /userinfo.
# Provide it only if your implementation expects it:
LINKEDIN_AUTHOR_URN=urn:li:person:XXXXXXXXXX⚠️ Never commit your
.envfile or share your access token. Add.envto.gitignore.
2. Connect to Claude Desktop
Add the server to your Claude Desktop config:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"linkedin": {
"command": "node",
"args": ["/absolute/path/to/linkedin-mcp-server/dist/index.js"],
"env": {
"LINKEDIN_ACCESS_TOKEN": "your_access_token_here",
"LINKEDIN_AUTHOR_URN": "urn:li:person:XXXXXXXXXX"
}
}
}
}Use an absolute path to dist/index.js, then fully restart Claude Desktop. The LinkedIn tools should now appear in the tools menu.
Usage
Once connected, just talk to the model naturally — it will pick the right tool:
"Draft a LinkedIn post about shipping my first MCP server. Educational tone, aimed at junior devs, and include a CTA to star the repo."
"Format this draft, add line breaks and a couple of emojis: …"
"Generate 8 hashtags for a post about AI compliance for fintech."
"Analyze this post and tell me how to make it stronger: …"
"Publish this to LinkedIn, connections-only."
Development
Why esbuild?
This project bundles with esbuild rather than tsc. Beyond being dramatically faster, it sidesteps the JavaScript heap out of memory errors that tsc can hit when bundling the MCP SDK and its dependencies. tsc is still used for type-checking only.
Scripts
npm run build # Bundle src/ -> dist/index.js with esbuild
npm run typecheck # Type-check with tsc (no emit)
npm start # Run the built server directly (stdio)Example esbuild.config.js
import { build } from "esbuild";
build({
entryPoints: ["src/index.ts"],
outfile: "dist/index.js",
bundle: true,
platform: "node",
format: "esm",
target: "node18",
banner: { js: "#!/usr/bin/env node" },
}).catch(() => process.exit(1));Project structure
linkedin-mcp-server/
├── src/
│ ├── index.ts # MCP server entry — stdio transport + tool registration
│ ├── tools/ # One module per tool
│ │ ├── draftPost.ts
│ │ ├── formatPost.ts
│ │ ├── generateHashtags.ts
│ │ ├── analyzePost.ts
│ │ └── createPost.ts
│ └── linkedin/ # LinkedIn API client (auth + posts)
├── dist/ # Bundled output (esbuild)
├── esbuild.config.js
├── package.json
├── tsconfig.json
└── README.mdBuilt on top of @modelcontextprotocol/sdk.
Troubleshooting
Tools don't appear in Claude Desktop.
Double-check that the path in args is absolute, that npm run build succeeded, and fully quit and reopen Claude Desktop. On macOS, logs live at ~/Library/Logs/Claude/.
JavaScript heap out of memory during build.
Use the bundled esbuild build (npm run build). If you reintroduce tsc for emitting, raise the heap limit with NODE_OPTIONS=--max-old-space-size=4096.
401 Unauthorized from create_post.
Your access token is missing, expired, or lacks the w_member_social scope. Regenerate it and update your .env / config.
License
Built with the Model Context Protocol. Contributions and issues welcome.
Available Tools
5 toolsanalyze_postA
Score a LinkedIn post and return improvement suggestions.
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The LinkedIn post content to analyze |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It indicates a read-only analysis but does not disclose scoring criteria, potential modifications, or authentication requirements. Basic transparency is present but lacks depth.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence that is concise and front-loaded. Every word is necessary and there is no extraneous information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema exists, so description should compensate. It mentions 'score' and 'improvement suggestions' but lacks details on output structure. For a simple tool with one parameter, it is moderately complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with parameter 'content' already described. The description adds no further meaning beyond stating the overall purpose, making it adequate but not additive.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool scores a LinkedIn post and returns improvement suggestions, using specific verbs and resource. It distinguishes from siblings which are creation, drafting, formatting, and hashtag generation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when needing a score and suggestions for a post, but does not explicitly state when to use it versus alternatives or provide any exclusions. Context signals show siblings are different enough to infer usage, but no direct guidance is given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
create_postC
Format and publish a LinkedIn post, or save as draft.
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Post text content | |
| hashtags | No | ||
| visibility | No | PUBLIC | |
| save_as_draft | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description fully bears the burden of behavioral disclosure. It does not reveal any side effects, authentication requirements, rate limits, or what happens to existing posts. The mention of 'format' is ambiguous.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that front-loads the main purpose. No extraneous information, but it could benefit from slight expansion without losing efficiency.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of output schema and annotations, the description is too brief for a creation tool with 4 parameters. It omits return value, draft behavior, formatting rules, and error conditions, leaving the agent underinformed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is only 25% (only 'content' has a description). The tool description adds no parameter details, so it fails to compensate for the low coverage. Critical fields like 'visibility' and 'save_as_draft' remain unexplained.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool creates a LinkedIn post, either publishing or saving as draft. The verb 'create' matches the tool name, and 'format' adds context. However, it does not explicitly distinguish from sibling tools like 'draft_post' or 'format_post', but the scope is broader.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given on when to use this tool versus alternatives like 'analyze_post', 'draft_post', or 'format_post'. The description does not mention prerequisites, exclusions, or context for usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
draft_postC
Generate a LinkedIn post template based on topic and tone.
| Name | Required | Description | Default |
|---|---|---|---|
| cta | No | Custom call-to-action | |
| tone | No | professional | |
| topic | Yes | Topic or subject of the post | |
| key_points | No | Key points to include | |
| hashtag_count | No | ||
| target_audience | No | ||
| include_hashtags | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so the description must fully disclose behavior. It only states 'generate a template' without revealing if this is a read-only operation, whether it calls external APIs, has side effects, or requires authentication. Agent cannot assess safety or constraints.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence is concise, but it sacrifices informativeness. Key behavioral and parameter details are omitted; the tool definition would benefit from a few more sentences to improve clarity without being verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With 7 parameters, low schema coverage, no output schema, and no annotations, the description is insufficient for correct invocation. Agent lacks understanding of expected output format, parameter interactions, and usage context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is low (43%). Description only mentions 'topic and tone', which are already described in the schema. It does not add meaning for key_points, hashtag_count, target_audience, or cta, failing to compensate for missing schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states it generates a LinkedIn post template based on topic and tone. Verb and resource are clear, and the tool is distinguished from siblings (analyze, create, format, generate_hashtags) by implying a draft/pre-creation step, though explicit differentiation is missing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus siblings like create_post or analyze_post. The description does not mention prerequisites, outcomes, or alternative scenarios, leaving the agent to infer usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
format_postB
Format raw content with proper LinkedIn structure and hashtags.
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| hashtags | No | ||
| add_emojis | No | ||
| add_line_breaks | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden for behavioral disclosure. It only says 'format' without detailing what formatting entails (e.g., modifying content, adding structure), nor does it mention any side effects or prerequisites.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no redundant information. Every word contributes to the core purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, no annotations, and 4 parameters with 0% schema coverage, the description is too brief. It fails to explain the transformation logic, return value, or constraints, making it incomplete for reliable tool invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so description must compensate. It mentions 'raw content' and 'hashtags' but does not explain the boolean parameters 'add_emojis' and 'add_line_breaks', leaving their impact unclear.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'format' and the resource 'raw content' with a specific purpose ('proper LinkedIn structure and hashtags'). It effectively distinguishes itself from sibling tools like analyze_post and create_post by focusing on formatting.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No usage guidelines are provided. The description does not specify when to use this tool versus alternatives or under what conditions, leaving the agent to infer its applicability.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_hashtagsC
Generate relevant LinkedIn hashtags for a topic.
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | ||
| topic | Yes | ||
| custom_keywords | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided. The description is too minimal to disclose behavioral traits such as authentication needs, response behavior, or processing details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is very short (one sentence) but does not convey enough information. It is under-specified rather than appropriately concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 3 parameters, no output schema, and no annotations, the description is incomplete. It lacks parameter details and return value information.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%. The description only references 'topic' but provides no details about 'count' or 'custom_keywords', leaving the agent uninformed about these parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (generate), the resource (hashtags), and the context (LinkedIn for a topic). It is distinct from sibling tools which deal with posts.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. No mention of prerequisites or when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a distinct purpose: analyze provides feedback, create publishes or drafts, draft generates templates, format structures content, and generate_hashtags produces hashtags. No overlap.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., analyze_post, create_post).
Five tools is well-scoped for LinkedIn post management, covering creation, formatting, analysis, and hashtag generation without being excessive.
The set covers the key post lifecycle steps (drafting, formatting, creating, analyzing, hashtags) but lacks editing or scheduling capabilities, which are minor gaps.
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.
LinkedIn outreach, commenting, scheduling, and data via Claude and human approval gates.
LinkedIn outreach, commenting, scheduling, and data via Claude and human approval gates.
LinkedIn API as MCP tools to retrieve profile data and publish content. Powered by HAPI MCP.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables posting text and media content directly to LinkedIn from Claude Desktop with support for authentication and visibility controls.10MIT
- AlicenseAqualityDmaintenancePost to LinkedIn from Claude — create posts, upload images, edit/delete posts, and manage company pages via natural language. Uses the official LinkedIn REST API with OAuth 2.0.92142MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with LinkedIn tools and services through the Universal MCP framework, allowing operations like posting and profile management via natural language.1MIT
- AlicenseAqualityDmaintenanceEnables Claude to interact with LinkedIn for posting, commenting, sharing media, and viewing feed and profile.92143MIT
Appeared in Searches
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/utsavagg2007/Linkedin-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server