LinkedIn Strategic Posting MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
LinkedIn Strategic Posting MCP Server
An MCP server that helps draft, optimize, schedule, and publish LinkedIn posts programmatically. Built with Domain-Driven Design (DDD) architecture in Python.
Features
Draft posts with structured hooks, body content, and calls to action across multiple tones
Publish to LinkedIn via OAuth2 authentication and LinkedIn REST API v202611
Score engagement potential with a multi-dimensional optimizer (length, readability, hook quality, hashtags, CTA)
Suggest hashtags categorized by industry, trending, niche, and broad reach
Recommend posting times based on LinkedIn algorithm research (Tue-Thu peak windows)
Schedule posts with a draft-to-scheduled-to-published lifecycle
Plan content calendars distributing topics across optimal days with varied content types
Persistent storage via local JSON file at
~/.linkedin-mcp/posts.json
Related MCP server: LinkedIn - Full Tools MCP (via Reepl)
Prerequisites
Python 3.10+
uv package manager
LinkedIn Developer App (for publishing posts)
Setup
1. Clone and Install
git clone <repo-url> && cd linkedin-mcp
uv sync2. Create LinkedIn Developer App
Go to LinkedIn Developers
Create a new app (or use an existing one)
Under "Auth" tab:
Add redirect URL:
http://localhost:8099/callbackRequest these scopes:
openid,profile,w_member_social
Copy your Client ID and Client Secret
3. Configure Environment Variables
Create a .env file in the project root:
LINKEDIN_CLIENT_ID=your_client_id_here
LINKEDIN_CLIENT_SECRET=your_client_secret_hereOr export them in your shell:
export LINKEDIN_CLIENT_ID=your_client_id_here
export LINKEDIN_CLIENT_SECRET=your_client_secret_here4. Configure MCP Client
For Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"linkedin-mcp": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/linkedin-mcp", "run", "linkedin-mcp"],
"env": {
"LINKEDIN_CLIENT_ID": "your_client_id_here",
"LINKEDIN_CLIENT_SECRET": "your_client_secret_here"
}
}
}
}For Claude Code (VSCode Extension)
Use the Claude CLI to add the MCP server:
claude mcp add \
-e LINKEDIN_CLIENT_ID=your_client_id_here \
-e LINKEDIN_CLIENT_SECRET=your_client_secret_here \
linkedin-mcp \
-- uv --directory /absolute/path/to/linkedin-mcp run linkedin-mcpOr manually edit ~/.claude/settings.json:
{
"mcpServers": {
"linkedin-mcp": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/linkedin-mcp", "run", "linkedin-mcp"],
"env": {
"LINKEDIN_CLIENT_ID": "your_client_id_here",
"LINKEDIN_CLIENT_SECRET": "your_client_secret_here"
}
}
}
}Restart Claude Desktop or reload Claude Code (Cmd+R) after configuration changes.
5. Authenticate with LinkedIn
Once the MCP server is running, authenticate:
Call
linkedin_authenticate()- you'll receive an auth URLOpen the URL in your browser and authorize the app
Call
linkedin_auth_callback()- completes the OAuth flowCredentials are saved to
~/.linkedin-mcp/credentials.json
You can check auth status anytime with linkedin_auth_status().
Usage
Testing with MCP Dev Inspector
# Make sure environment variables are set first
export LINKEDIN_CLIENT_ID=your_client_id_here
export LINKEDIN_CLIENT_SECRET=your_client_secret_here
uv run mcp dev src/linkedin_mcp/server.pyMCP Tools
Post Management
Tool | Description |
| Draft a new LinkedIn post with a topic and tone (professional, casual, inspirational, educational, storytelling). Optionally provide custom content instead of template generation. |
| Score a post for engagement potential and get improvement suggestions |
| Get categorized hashtag recommendations (industry, trending, niche, broad), optionally attach to a post |
| Get top 3 posting time recommendations by timezone and industry |
| Schedule a draft post for a specific time (ISO 8601) |
| Plan a multi-day calendar with varied content types (thought-leadership, how-to, story, poll, listicle, case-study) |
| List all draft posts |
| List all scheduled posts |
LinkedIn Publishing
Tool | Description |
| Start OAuth2 flow. Returns auth URL to open in browser. |
| Complete OAuth2 flow after user authorizes. Exchanges code for token and saves credentials. |
| Publish a post directly to LinkedIn (requires authentication) |
| Check if authenticated, view person URN and token expiry |
Configuration
Tool | Description |
| Get current configuration (default tone, valid tones) |
| Set default tone for new posts |
Example Workflow
# 1. Authenticate with LinkedIn
linkedin_authenticate() # Opens browser for OAuth
linkedin_auth_callback() # Completes authentication
# 2. Draft a post
result = draft_post(
topic="Building MCP servers",
content="Just built an MCP server for LinkedIn posting...\n\nIt uses DDD architecture..."
)
post_id = result["post_id"]
# 3. Optimize and add hashtags
optimize_post(post_id) # Get engagement score
suggest_hashtags(topic="MCP servers", post_id=post_id, industry="technology")
# 4. Publish to LinkedIn
linkedin_publish_post(post_id) # Posts immediately
# Or schedule for later
schedule_post(post_id, scheduled_time="2026-02-03T09:00:00Z")Known Issues
LinkedIn API Post Truncation
LinkedIn's REST Posts API (v202502) may truncate post content to approximately 100 characters in some cases, despite accepting the full payload and returning a 201 success response. This appears to be a LinkedIn API bug.
Workaround: Keep opening paragraphs concise or rephrase if truncation occurs. The full content is sent correctly to LinkedIn, but their platform may not display it all.
Architecture
DDD layers with strict dependency rule: Domain <- Application <- Infrastructure
server.py MCP tool handlers (thin adapters)
-> container.py Dependency wiring
-> use cases Orchestrate domain logic
-> domain Services, entities, value objects, repository ABCs
-> infra JSON repository, serializationDomain: Frozen Pydantic value objects, Post entity with state machine, repository ABC, domain services
Application: Use cases with
execute()pattern, Pydantic DTOsInfrastructure: JSON file repository with
fcntllocking, LinkedIn REST API client
Development
uv run ruff check --fix src/ tests/ # Lint with auto-fix
uv run ruff format src/ tests/ # Format code
uv run mypy src/ # Strict type checking
uv run pytest # Run testsFiles and Storage
~/.linkedin-mcp/posts.json- Post storage (draft, scheduled, published)~/.linkedin-mcp/credentials.json- LinkedIn OAuth credentials (access token, person URN, expiry)~/.linkedin-mcp/config.json- User preferences (default tone)
License
MIT - Copyright (c) 2026 Benson Osei Mensah
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Draft LinkedIn posts in your voice, then schedule or publish them through LinkedIn's official API.
Schedule and publish LinkedIn posts to profiles and company pages from AI agents.
Publish and schedule LinkedIn posts from your AI assistant.
LinkedIn post scheduler: write, schedule, publish and delete LinkedIn posts from chat, with images.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables creation of optimized LinkedIn posts using a component-based design system with variants, themes, and composition patterns. Supports multiple post types (text, document, poll, video, carousel) with research-backed optimization for maximum engagement.3Apache 2.0
- AlicenseNot gradedqualityCmaintenanceManage your entire LinkedIn presence - write posts, schedule publishing, track contacts, and access saved content.1MIT
- AlicenseNot gradedqualityDmaintenanceLinkedIn-native AI content creation, scheduling & analytics. Write and post on LinkedIn, create drafts, generate hooks & hashtags, schedule posts, and track engagement — all through natural language.45 npmMIT
- AlicenseAqualityDmaintenanceEnables posting content, sharing articles, and managing LinkedIn profile through natural language using the official LinkedIn REST API with OAuth 2.0.7MIT